From c5a6b6b111534fb48ebb0fd5bada08eb42056d16 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 28 Sep 2007 03:44:53 +0000 Subject: [PATCH] use the system's default bold font for dock badging --- macosx/Badger.m | 5 +---- macosx/Torrent.m | 17 ++++++----------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/macosx/Badger.m b/macosx/Badger.m index 9d4ff9c81..e11abc3f7 100644 --- a/macosx/Badger.m +++ b/macosx/Badger.m @@ -217,12 +217,9 @@ [stringShadow setShadowOffset: NSMakeSize(2.0, -2.0)]; [stringShadow setShadowBlurRadius: 4.0]; - NSFont * boldFont = [[NSFontManager sharedFontManager] convertFont: - [NSFont fontWithName: @"Helvetica" size: 28.0] toHaveTrait: NSBoldFontMask]; - fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor whiteColor], NSForegroundColorAttributeName, - boldFont, NSFontAttributeName, stringShadow, NSShadowAttributeName, nil]; + [NSFont boldSystemFontOfSize: 26.0], NSFontAttributeName, stringShadow, NSShadowAttributeName, nil]; [stringShadow release]; } diff --git a/macosx/Torrent.m b/macosx/Torrent.m index a1d6550b2..e1bfa6f40 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -593,7 +593,6 @@ static int static_lastid = 0; return NO; } - return YES; } @@ -760,13 +759,11 @@ static int static_lastid = 0; eta / 3600, (eta / 60) % 60]; else { - int days = eta / 86400; + int days = eta / 86400, hours = (eta / 3600) % 24; if (days > 1) - return [NSString stringWithFormat: NSLocalizedString(@"%d days %d hr", "Torrent -> remaining time"), - days, (eta / 3600) % 24]; + return [NSString stringWithFormat: NSLocalizedString(@"%d days %d hr", "Torrent -> remaining time"), days, hours]; else - return [NSString stringWithFormat: NSLocalizedString(@"1 day %d hr", "Torrent -> remaining time"), - (eta / 3600) % 24]; + return [NSString stringWithFormat: NSLocalizedString(@"1 day %d hr", "Torrent -> remaining time"), hours]; } } @@ -852,11 +849,9 @@ static int static_lastid = 0; [dic setObject: [NSNumber numberWithFloat: peer->downloadFromRate] forKey: @"DL From Rate"]; [dic setObject: [NSNumber numberWithBool: peer->isEncrypted] forKey: @"Encryption"]; + + [dic setObject: [NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding] forKey: @"Client"]; } - - #warning why would connected clients have null value? - if (peer->client) - [dic setObject: [NSString stringWithCString: (char *) peer->client encoding: NSUTF8StringEncoding] forKey: @"Client"]; else [dic setObject: @"" forKey: @"Client"]; //needed to be set here for client sort @@ -992,7 +987,7 @@ static int static_lastid = 0; else stringToAppend = @""; - string = [NSString stringWithFormat: @"%@ - %@UL: %@", string, stringToAppend, [NSString stringForSpeed: [self uploadRate]]]; + string = [string stringByAppendingFormat: @" - %@UL: %@", stringToAppend, [NSString stringForSpeed: [self uploadRate]]]; } return string;