added synchronization on database change

This commit is contained in:
michael starke
2017-05-17 19:05:49 +02:00
parent 441496f260
commit 0dd4a2cc1f
11 changed files with 15 additions and 5 deletions

View File

@@ -1,3 +1,3 @@
github "sparkle-project/Sparkle" ~> 1.17.0
github "mstarke/KeePassKit" "4fd7f5fa86e500c0b748258328546256f8148e98"
github "mstarke/KeePassKit" "eb282e54e69c46cf428cda4f81b5a5eb763df38b"
github "mstarke/HNHUi" ~> 1.1

View File

@@ -1,3 +1,3 @@
github "mstarke/HNHUi" "1.1"
github "mstarke/KeePassKit" "4fd7f5fa86e500c0b748258328546256f8148e98"
github "mstarke/KeePassKit" "eb282e54e69c46cf428cda4f81b5a5eb763df38b"
github "sparkle-project/Sparkle" "1.17.0"

View File

@@ -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];

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.