Just update the value when there is a change....it's modified only when torrent counts change and just updates a string...nothing too strenuous

This commit is contained in:
Mitchell Livingston 2006-06-16 03:45:12 +00:00
parent e5aab6902a
commit fa23d6d30c
3 changed files with 5 additions and 9 deletions

View File

@ -85,7 +85,7 @@ static void sleepCallBack( void * controller, io_service_t y,
- (void) awakeFromNib
{
[fPrefsController setPrefsWindow: fLib];
[fPrefsController setPrefs: fLib];
[fAdvancedBarItem setState: [fDefaults
boolForKey: @"UseAdvancedBar"] ? NSOnState : NSOffState];
@ -417,12 +417,9 @@ static void sleepCallBack( void * controller, io_service_t y,
- (void) torrentNumberChanged
{
if (fStatusBarVisible)
{
int count = [fTorrents count];
[fTotalTorrentsField setStringValue: [NSString stringWithFormat:
int count = [fTorrents count];
[fTotalTorrentsField setStringValue: [NSString stringWithFormat:
@"%d Transfer%s", count, count == 1 ? "" : "s"]];
}
}
- (void) advancedChanged: (id) sender
@ -1022,7 +1019,6 @@ static void sleepCallBack( void * controller, io_service_t y,
fStatusBarVisible = !fStatusBarVisible;
//reloads stats
[self torrentNumberChanged];
[self updateUI: nil];
//set views to not autoresize

View File

@ -51,7 +51,7 @@
NSUserDefaults * fDefaults;
}
- (void) setPrefsWindow: (tr_handle_t *) handle;
- (void) setPrefs: (tr_handle_t *) handle;
- (void) setShowMessage: (id) sender;
- (void) setBadge: (id) sender;

View File

@ -70,7 +70,7 @@
[super dealloc];
}
- (void) setPrefsWindow: (tr_handle_t *) handle
- (void) setPrefs: (tr_handle_t *) handle
{
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[fToolbar setDelegate: self];