move dock badging preference change notification into the Badger

This commit is contained in:
Mitchell Livingston 2007-11-05 12:47:20 +00:00
parent cbb3e0643e
commit dcb411e310
3 changed files with 8 additions and 12 deletions

View File

@ -55,6 +55,10 @@
[[NSApp dockTile] setContentView: view];
[view release];
}
//change that just impacts the dock badge
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateBadge)
name: @"DockBadgeChange" object: nil];
}
return self;
@ -62,6 +66,8 @@
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[fDockIcon release];
[fAttributes release];

View File

@ -216,8 +216,6 @@
- (void) doNothing: (id) sender; //needed for menu items that use bindings with no associated action
- (void) updateDockBadge: (NSNotification *) notification;
- (void) setWindowSizeToFit;
- (NSRect) sizedWindowFrame;

View File

@ -411,10 +411,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[nc addObserver: self selector: @selector(updateTorrentsInQueue)
name: @"UpdateQueue" object: nil];
//change that just impacts the dock badge
[nc addObserver: self selector: @selector(updateDockBadge:)
name: @"DockBadgeChange" object: nil];
//open newly created torrent file
[nc addObserver: self selector: @selector(beginCreateFile:)
name: @"BeginCreateTorrentFile" object: nil];
@ -589,7 +585,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
//clear badge
[fBadger clearBadge];
//wait for running transfers to stop and for NAT to be disabled (5 second timeout)
//wait for NAT to be disabled (5 second timeout)
NSDate * startDate = [NSDate date];
#warning do this in tr_close?
@ -612,6 +608,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[fPendingTorrentDownloads release];
[fTempTorrentFiles release];
//complete cleanup
tr_close(fLib);
}
@ -3209,11 +3206,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
return fDockMenu;
}
- (void) updateDockBadge: (NSNotification *) notification
{
[fBadger updateBadge];
}
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
{
//if auto size is enabled, the current frame shouldn't need to change