From 9e67d0a1ef974a851b13d55f264049fd399b578a Mon Sep 17 00:00:00 2001 From: michael starke Date: Thu, 18 May 2017 12:16:13 +0200 Subject: [PATCH] Merge button is default action --- MacPass/MPDocument.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 7ccaedca..73c12e44 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -290,20 +290,23 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou alert.alertStyle = NSWarningAlertStyle; alert.messageText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_MESSAGE_TEXT", @"Message displayed when an open file was changed from another application"); alert.informativeText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_INFO_TEXT", @"Informative text displayed when the file was change from another application"); - [alert addButtonWithTitle:NSLocalizedString(@"KEEP_MINE", @"Ignore the changes to an open file!")]; - [alert addButtonWithTitle:NSLocalizedString(@"LOAD_CHANGES", @"Reopen the file!")]; [alert addButtonWithTitle:NSLocalizedString(@"MERGE_CHANGES", @"Merge changes into file!")]; + [alert addButtonWithTitle:NSLocalizedString(@"LOAD_CHANGES", @"Reopen the file!")]; + [alert addButtonWithTitle:NSLocalizedString(@"KEEP_MINE", @"Ignore the changes to an open file!")]; [alert beginSheetModalForWindow:welf.windowForSheet completionHandler:^(NSModalResponse returnCode) { welf.fileChangeDialogOpen = NO; switch(returnCode) { + case NSAlertFirstButtonReturn: { + [welf mergeWithContentsFromURL:self.fileURL]; + break; + } case NSAlertSecondButtonReturn: [welf revertToContentsOfURL:welf.fileURL ofType:welf.fileType error:nil]; break; - case NSAlertThirdButtonReturn: { - [welf mergeWithContentsFromURL:self.fileURL]; - } + case NSAlertThirdButtonReturn: + // do not change anything default: break; }