another attempt of fixing the dock badge on quit on tiger

This commit is contained in:
Mitchell Livingston 2007-12-20 02:09:44 +00:00
parent 21d3614f7c
commit b079df809c
2 changed files with 17 additions and 6 deletions

View File

@ -27,13 +27,15 @@
@interface Badger : NSObject
{
tr_handle * fLib;
tr_handle * fLib;
NSImage * fDockIcon, * fBadge;
NSImage * fDockIcon, * fBadge;
NSDictionary * fAttributes;
int fCompleted, fCompletedBadged;
BOOL fSpeedBadge;
NSDictionary * fAttributes;
int fCompleted, fCompletedBadged;
BOOL fSpeedBadge;
BOOL fQuittingTiger;
}
- (id) initWithLib: (tr_handle *) lib;

View File

@ -56,6 +56,8 @@
[[NSApp dockTile] setContentView: view];
[view release];
}
else
fQuittingTiger = NO;
//change that just impacts the dock badge
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateBadge) name: @"DockBadgeChange" object: nil];
@ -81,6 +83,11 @@
[[NSApp dockTile] display];
return;
}
else
{
if (fQuittingTiger)
return;
}
//set completed badge to top right
BOOL completedChange = fCompleted != fCompletedBadged;
@ -227,10 +234,12 @@
}
else
{
fQuittingTiger = YES;
fSpeedBadge = NO;
fCompleted = 0;
fCompletedBadged = 0;
[NSApp setApplicationIconImage: @"NSApplicationIcon"];
[NSApp setApplicationIconImage: nil];
}
}