mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
#3686 "add rpc command to cleanly shutdown daemon" - added for Mac client
This commit is contained in:
@@ -103,8 +103,7 @@ typedef enum
|
||||
#warning change to QLPreviewPanel
|
||||
id fPreviewPanel;
|
||||
BOOL fQuitting;
|
||||
|
||||
BOOL fUpdateInProgress;
|
||||
BOOL fQuitRequested;
|
||||
BOOL fPauseOnLaunch;
|
||||
|
||||
Badger * fBadger;
|
||||
|
||||
@@ -390,7 +390,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||
[[UKKQueue sharedFileWatcher] setDelegate: self];
|
||||
|
||||
[[SUUpdater sharedUpdater] setDelegate: self];
|
||||
fUpdateInProgress = NO;
|
||||
fQuitRequested = NO;
|
||||
|
||||
fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0;
|
||||
}
|
||||
@@ -677,7 +677,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||
|
||||
- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) sender
|
||||
{
|
||||
if (!fUpdateInProgress && [fDefaults boolForKey: @"CheckQuit"])
|
||||
if (!fQuitRequested && [fDefaults boolForKey: @"CheckQuit"])
|
||||
{
|
||||
NSInteger active = 0, downloading = 0;
|
||||
for (Torrent * torrent in fTorrents)
|
||||
@@ -4358,7 +4358,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||
|
||||
- (void) updaterWillRelaunchApplication: (SUUpdater *) updater
|
||||
{
|
||||
fUpdateInProgress = YES;
|
||||
fQuitRequested = YES;
|
||||
}
|
||||
|
||||
- (NSDictionary *) registrationDictionaryForGrowl
|
||||
@@ -4440,6 +4440,11 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||
[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];
|
||||
|
||||
Reference in New Issue
Block a user