Added option to close MacPass if the last window is closed (default is NO)

This commit is contained in:
Michael Starke
2018-11-14 21:15:27 +01:00
parent e57e20cbe0
commit bfeb71585d
3 changed files with 8 additions and 1 deletions

View File

@@ -156,6 +156,10 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
return [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyQuitOnLastWindowClose];
}
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
if([[MPTemporaryFileStorageCenter defaultCenter] hasPendingStorages]) {
dispatch_async(dispatch_get_main_queue(), ^{