mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52:21 +00:00
Merge button is default action
This commit is contained in:
@@ -290,20 +290,23 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
alert.alertStyle = NSWarningAlertStyle;
|
alert.alertStyle = NSWarningAlertStyle;
|
||||||
alert.messageText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_MESSAGE_TEXT", @"Message displayed when an open file was changed from another application");
|
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.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(@"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) {
|
[alert beginSheetModalForWindow:welf.windowForSheet completionHandler:^(NSModalResponse returnCode) {
|
||||||
|
|
||||||
welf.fileChangeDialogOpen = NO;
|
welf.fileChangeDialogOpen = NO;
|
||||||
|
|
||||||
switch(returnCode) {
|
switch(returnCode) {
|
||||||
|
case NSAlertFirstButtonReturn: {
|
||||||
|
[welf mergeWithContentsFromURL:self.fileURL];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case NSAlertSecondButtonReturn:
|
case NSAlertSecondButtonReturn:
|
||||||
[welf revertToContentsOfURL:welf.fileURL ofType:welf.fileType error:nil];
|
[welf revertToContentsOfURL:welf.fileURL ofType:welf.fileType error:nil];
|
||||||
break;
|
break;
|
||||||
case NSAlertThirdButtonReturn: {
|
case NSAlertThirdButtonReturn:
|
||||||
[welf mergeWithContentsFromURL:self.fileURL];
|
// do not change anything
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user