[[UKKQueue sharedFileWatcher] setDelegate: self];
[[SUUpdater sharedUpdater] setDelegate: self];
- fUpdateInProgress = NO;
+ fQuitRequested = NO;
fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0;
}
- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) sender
{
- if (!fUpdateInProgress && [fDefaults boolForKey: @"CheckQuit"])
+ if (!fQuitRequested && [fDefaults boolForKey: @"CheckQuit"])
{
NSInteger active = 0, downloading = 0;
for (Torrent * torrent in fTorrents)
- (void) updaterWillRelaunchApplication: (SUUpdater *) updater
{
- fUpdateInProgress = YES;
+ fQuitRequested = YES;
}
- (NSDictionary *) registrationDictionaryForGrowl
[fPrefsController performSelectorOnMainThread: @selector(rpcUpdatePrefs) withObject: nil waitUntilDone: NO];
break;
+ case TR_RPC_SESSION_CLOSE:
+ fQuitRequested = YES;
+ [NSApp performSelectorOnMainThread: @selector(terminate:) withObject: self waitUntilDone: NO];
+ break;
+
default:
NSAssert1(NO, @"Unknown RPC command received: %d", type);
[torrent release];