mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 22:42:18 +00:00
fixed #505 for good
fixed typo for locking switched to notifications on locking to prevent UI changes on failure
This commit is contained in:
@@ -334,7 +334,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
if(self != document) {
|
if(self != document) {
|
||||||
return; // wrong parameters
|
return; // wrong parameters
|
||||||
}
|
}
|
||||||
if(didSave) {
|
if(!didSave) {
|
||||||
return; // not saved!
|
return; // not saved!
|
||||||
}
|
}
|
||||||
/* FIXME: User feedback is ignored */
|
/* FIXME: User feedback is ignored */
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:document];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didAddEntry:) name:MPDocumentDidAddEntryNotification object:document];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didAddEntry:) name:MPDocumentDidAddEntryNotification object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didAddGroup:) name:MPDocumentDidAddGroupNotification object:document];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didAddGroup:) name:MPDocumentDidAddGroupNotification object:document];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didLockDatabase:) name:MPDocumentDidLockDatabaseNotification object:document];
|
||||||
|
|
||||||
[self.entryViewController regsiterNotificationsForDocument:document];
|
[self.entryViewController regsiterNotificationsForDocument:document];
|
||||||
[self.inspectorViewController registerNotificationsForDocument:document];
|
[self.inspectorViewController registerNotificationsForDocument:document];
|
||||||
@@ -181,12 +182,17 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
[self showInspector:self];
|
[self showInspector:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)_didLockDatabase:(NSNotification *)notification {
|
||||||
|
[self showPasswordInput];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
||||||
[self showEntries];
|
[self showEntries];
|
||||||
/* Show password reminders */
|
/* Show password reminders */
|
||||||
[self _presentPasswordIntervalAlerts];
|
[self _presentPasswordIntervalAlerts];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
- (void)saveDocument:(id)sender {
|
- (void)saveDocument:(id)sender {
|
||||||
MPDocument *document = self.document;
|
MPDocument *document = self.document;
|
||||||
@@ -345,7 +351,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
if(document.encrypted) {
|
if(document.encrypted) {
|
||||||
return; // Document already locked
|
return; // Document already locked
|
||||||
}
|
}
|
||||||
[self showPasswordInput];
|
|
||||||
[document lockDatabase:sender];
|
[document lockDatabase:sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user