diff --git a/Cartfile b/Cartfile index 2d010fd9..a00a20ec 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ github "sparkle-project/Sparkle" ~> 1.17.0 -github "mstarke/KeePassKit" "4fd7f5fa86e500c0b748258328546256f8148e98" +github "mstarke/KeePassKit" "eb282e54e69c46cf428cda4f81b5a5eb763df38b" github "mstarke/HNHUi" ~> 1.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 5f303186..91cab3e7 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ github "mstarke/HNHUi" "1.1" -github "mstarke/KeePassKit" "4fd7f5fa86e500c0b748258328546256f8148e98" +github "mstarke/KeePassKit" "eb282e54e69c46cf428cda4f81b5a5eb763df38b" github "sparkle-project/Sparkle" "1.17.0" diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index a8f93272..d779f5d0 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -291,12 +291,22 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou 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 beginSheetModalForWindow:self.windowForSheet completionHandler:^(NSModalResponse returnCode) { self.fileChangeDialogOpen = NO; - if(returnCode == NSAlertSecondButtonReturn) { - [self revertToContentsOfURL:self.fileURL ofType:self.fileType error:nil]; + switch(returnCode) { + case NSAlertSecondButtonReturn: + [self revertToContentsOfURL:self.fileURL ofType:self.fileType error:nil]; + break; + case NSAlertThirdButtonReturn: { + KPKTree *otherTree = [[KPKTree alloc] initWithContentsOfUrl:self.fileURL key:self.compositeKey error:nil]; + [self.tree syncronizeWithTree:otherTree options:KPKSynchronizationSynchronizeOption]; + break; + } + default: + break; } }]; }); @@ -350,7 +360,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou [[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidLockDatabaseNotification object:self]; } - + - (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL error:(NSError *__autoreleasing*)error{ self.compositeKey = [[KPKCompositeKey alloc] initWithPassword:password key:keyFileURL]; self.tree = [[KPKTree alloc] initWithData:self.encryptedData key:self.compositeKey error:error]; diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings index 7c61ba1a..7f2c6ea8 100644 Binary files a/MacPass/de.lproj/Localizable.strings and b/MacPass/de.lproj/Localizable.strings differ diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index 041c86d1..45ba6eb6 100644 Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ diff --git a/MacPass/fr.lproj/Localizable.strings b/MacPass/fr.lproj/Localizable.strings index 13eb21aa..2fcca008 100644 Binary files a/MacPass/fr.lproj/Localizable.strings and b/MacPass/fr.lproj/Localizable.strings differ diff --git a/MacPass/it.lproj/Localizable.strings b/MacPass/it.lproj/Localizable.strings index 91859244..1e175167 100644 Binary files a/MacPass/it.lproj/Localizable.strings and b/MacPass/it.lproj/Localizable.strings differ diff --git a/MacPass/nl.lproj/Localizable.strings b/MacPass/nl.lproj/Localizable.strings index 147fcd42..740af0a0 100644 Binary files a/MacPass/nl.lproj/Localizable.strings and b/MacPass/nl.lproj/Localizable.strings differ diff --git a/MacPass/pl.lproj/Localizable.strings b/MacPass/pl.lproj/Localizable.strings index def247b6..8304bd6b 100644 Binary files a/MacPass/pl.lproj/Localizable.strings and b/MacPass/pl.lproj/Localizable.strings differ diff --git a/MacPass/ru.lproj/Localizable.strings b/MacPass/ru.lproj/Localizable.strings index eb65643d..0a5f0a8a 100644 Binary files a/MacPass/ru.lproj/Localizable.strings and b/MacPass/ru.lproj/Localizable.strings differ diff --git a/MacPass/sp.lproj/Localizable.strings b/MacPass/sp.lproj/Localizable.strings index 0103734b..4851e90d 100644 Binary files a/MacPass/sp.lproj/Localizable.strings and b/MacPass/sp.lproj/Localizable.strings differ