mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
fixed wrong content display when clearing search or exiting history display.
This commit is contained in:
@@ -19,11 +19,17 @@ NSString *const MPDocumentHideEntryHistoryNotification = @"MPDocumentHideEntryH
|
|||||||
if(entries.count != 1) {
|
if(entries.count != 1) {
|
||||||
return; // only single selection is used
|
return; // only single selection is used
|
||||||
}
|
}
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentShowEntryHistoryNotification object:self userInfo:@{ MPDocumentEntryKey: entries.firstObject }];
|
if(self.hasSearch) {
|
||||||
|
[self exitSearch:sender];
|
||||||
|
}
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentShowEntryHistoryNotification
|
||||||
|
object:self
|
||||||
|
userInfo:@{ MPDocumentEntryKey: entries.firstObject }];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)hideEntryHistory:(id)sender {
|
- (void)hideEntryHistory:(id)sender {
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentHideEntryHistoryNotification object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentHideEntryHistoryNotification
|
||||||
|
object:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,6 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
NSArray *result = notification.userInfo[kMPDocumentSearchResultsKey];
|
NSArray *result = notification.userInfo[kMPDocumentSearchResultsKey];
|
||||||
NSAssert(result != nil, @"Resutls should never be nil");
|
NSAssert(result != nil, @"Resutls should never be nil");
|
||||||
self.filteredEntries = result;
|
self.filteredEntries = result;
|
||||||
[self.entryArrayController unbind:NSContentArrayBinding];
|
|
||||||
[self.entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:NSStringFromSelector(@selector(filteredEntries)) options:nil];
|
[self.entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:NSStringFromSelector(@selector(filteredEntries)) options:nil];
|
||||||
[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = NO;
|
[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = NO;
|
||||||
[self _updateContextBar];
|
[self _updateContextBar];
|
||||||
@@ -468,9 +467,13 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
|
|
||||||
- (void)_didExitSearch:(NSNotification *)notification {
|
- (void)_didExitSearch:(NSNotification *)notification {
|
||||||
[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = YES;
|
[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = YES;
|
||||||
|
[self.entryArrayController unbind:NSContentArrayBinding];
|
||||||
|
self.entryArrayController.content = nil;
|
||||||
self.filteredEntries = nil;
|
self.filteredEntries = nil;
|
||||||
self.displayMode = MPDisplayModeEntries;
|
self.displayMode = MPDisplayModeEntries;
|
||||||
[self _updateContextBar];
|
[self _updateContextBar];
|
||||||
|
MPDocument *document = notification.object;
|
||||||
|
document.selectedGroups = document.selectedGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_didEnterSearch:(NSNotification *)notification {
|
- (void)_didEnterSearch:(NSNotification *)notification {
|
||||||
@@ -493,14 +496,17 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
self.displayMode = MPDisplayModeHistory;
|
self.displayMode = MPDisplayModeHistory;
|
||||||
KPKEntry *entry = notification.userInfo[MPDocumentEntryKey];
|
KPKEntry *entry = notification.userInfo[MPDocumentEntryKey];
|
||||||
NSAssert(entry != nil, @"Resutls should never be nil");
|
NSAssert(entry != nil, @"Resutls should never be nil");
|
||||||
[self.entryArrayController unbind:NSContentArrayBinding];
|
|
||||||
[self.entryArrayController bind:NSContentArrayBinding toObject:entry withKeyPath:NSStringFromSelector(@selector(history)) options:nil];
|
[self.entryArrayController bind:NSContentArrayBinding toObject:entry withKeyPath:NSStringFromSelector(@selector(history)) options:nil];
|
||||||
[self _updateContextBar];
|
[self _updateContextBar];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_hideEntryHistory:(NSNotification *)notification {
|
- (void)_hideEntryHistory:(NSNotification *)notification {
|
||||||
self.displayMode = MPDisplayModeEntries;
|
self.displayMode = MPDisplayModeEntries;
|
||||||
|
[self.entryArrayController unbind:NSContentArrayBinding];
|
||||||
|
self.entryArrayController.content = nil;
|
||||||
[self _updateContextBar];
|
[self _updateContextBar];
|
||||||
|
MPDocument *document = notification.object;
|
||||||
|
document.selectedGroups = document.selectedGroups;
|
||||||
}
|
}
|
||||||
#pragma mark ContextBar
|
#pragma mark ContextBar
|
||||||
- (void)_updateContextBar {
|
- (void)_updateContextBar {
|
||||||
|
|||||||
Reference in New Issue
Block a user