From 0dd4a2cc1f6e7cd860797c848ed31f19cf1ab10b Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 17 May 2017 19:05:49 +0200 Subject: [PATCH] added synchronization on database change --- Cartfile | 2 +- Cartfile.resolved | 2 +- MacPass/MPDocument.m | 16 +++++++++++++--- MacPass/de.lproj/Localizable.strings | Bin 15124 -> 15258 bytes MacPass/en.lproj/Localizable.strings | Bin 14072 -> 14206 bytes MacPass/fr.lproj/Localizable.strings | Bin 15388 -> 15522 bytes MacPass/it.lproj/Localizable.strings | Bin 14686 -> 14820 bytes MacPass/nl.lproj/Localizable.strings | Bin 14608 -> 14742 bytes MacPass/pl.lproj/Localizable.strings | Bin 13942 -> 14574 bytes MacPass/ru.lproj/Localizable.strings | Bin 14810 -> 14944 bytes MacPass/sp.lproj/Localizable.strings | Bin 14926 -> 15060 bytes 11 files changed, 15 insertions(+), 5 deletions(-) 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 7c61ba1afebaed4d04a411b711051436330000f2..7f2c6ea8c22e0746188267532052f751dfa16d4c 100644 GIT binary patch delta 124 zcmbPIHmiKY2~&Q31}z2!2499$h9ZV^hSbS|hQiUA40#MC4EaFuG=@xu9H5*ckgdg_ z&%ni?1XSzF5X9gPB;y&J89W#q8T`P!V4$1=gDnt))IiMx@{$=c7!rXd0!?Qq-n`#5 GlobF1fEPCa delta 12 TcmbPLKBa8K3DeDfWA_ diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index 041c86d1edc2dfbec0c0881026095a469886cdf4..45ba6eb6b5e40efaa6316e72c60b1ce7d37ebd40 100644 GIT binary patch delta 132 zcmey7`!8?93d70I41^}{GVJ5mXV79$VDM!~Whi1uXGooVQCB!RlOd0xgdra&p2m>L zkOP!c1hTal^clDqlz?ho8G;zxfn+>`GlK_%BZD897YvkBV6X*ZkQ%6YKwdIK216py PM4;&m#hdMocCr8ffGr#> delta 18 acmeyD_ak@13PZ-w$tw-#Z$4+Vfdv3xB?%+| diff --git a/MacPass/fr.lproj/Localizable.strings b/MacPass/fr.lproj/Localizable.strings index 13eb21aa16ee5090299aa2525462b1691785ac1e..2fcca0085982bd375c99da9bbcf3a02ebe88abcb 100644 GIT binary patch delta 110 zcmbPJv8Zx`jybPBgBF7VgD*oWLlHyzB diff --git a/MacPass/it.lproj/Localizable.strings b/MacPass/it.lproj/Localizable.strings index 91859244b0ff6c832d3cc1dcc3c20907049cad62..1e1751675f94727420fcd3f9911a4667e7e1025b 100644 GIT binary patch delta 86 zcmcat^rU!0oC&W!gBF7VgD*oWLlHyzWJY6A^-P95h7yK+plBLHCPNNTMiI!?V$f&c dVo(CAbY%!)aA$Cx%xxmgj?gE(In0EE6#zv55m5jD delta 11 ScmaD-e6MIjoXO%RCaeG_UhGd2ehD4x==|EmFgW_gZ H6K+-joa7ZV delta 12 TcmbPMJfUaJ~BO?TU diff --git a/MacPass/pl.lproj/Localizable.strings b/MacPass/pl.lproj/Localizable.strings index def247b6ed13a2f781a14e8f3209d048d43ed234..8304bd6bee08fc788345c869e54c26f9eee2449e 100644 GIT binary patch delta 541 zcmZ`$Jxc>Y6r4g4(%KjmT+bqKkgvi@EUq|2Br3TiAQs{Dk|;SZn%fX8Bu)N6*gqoV zclcK5D^iH3Vn3&iY^`zGgFKyzbSK#l6fl}{MI_k))LJo&bWL8 zX69~Bt}UA=3g?1N(Lt7v5DER1|MAmZ;u;T2ZxMMk_nn=ngA!Rio@5@)e-iX2gw_pX zJ6ud`WToUfLK+n0p0r}1N24F6MMikyDIx0M1UarUTvltgKV`o# w%`3&-jq`P7XwkoFVpfw^tsdZzxl7I*`D?t+x?HOHuI%MSA(LnBRgX7+0OrGG%m4rY delta 17 YcmaD?_$_CHjP7PWeLa@Vhm3Vt0ZBUswg3PC diff --git a/MacPass/ru.lproj/Localizable.strings b/MacPass/ru.lproj/Localizable.strings index eb65643d72bb639427c9d7fb58d3c34474459470..0a5f0a8af098fddb24b3378b43d68ae09f7664c3 100644 GIT binary patch delta 103 zcmcar{GepR6BB-Y1}z2!2499$h9ZV^hSbS{2Eyu@40#MC4EaFuG=@xu9H5*ckgdg_ s&%ni?1XSzF5X9il;5xbAL|O{26R0AYA%h_is26AsLovhVJ0|~F0N*SZ82|tP delta 12 TcmaD*a;td56O+wZrr%fqFu?}4 diff --git a/MacPass/sp.lproj/Localizable.strings b/MacPass/sp.lproj/Localizable.strings index 0103734bf39b9c18170cf5866728b0f81c082527..4851e90d24acaf17410e34ac6cb2059b2886dd8b 100644 GIT binary patch delta 187 zcmX?Ca;22%|G$mQkC~Yn)D$+qWL9JXGkDpeIl+u0kX^!%4`ihQ**QQpia@p& jgFXWngA!1uD?<>2JA>=wexXn@A>}ATr%E$l!jbSJk delta 96 zcmcaodai`|-+zXUOplqF71S6uzhG8m0yB8nqB+5gEPiGdCIz+0fqbHyTZHekf(6qg mKSN|=l%2UbfEtw;tQoi_H>yidF3>mI{6jB-ZSytLzbpVZ5gS7Q