mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
pressing down in search input will focus entries (#707)
This commit is contained in:
@@ -109,10 +109,10 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
|
|||||||
|
|
||||||
#pragma mark MPDocument Notifications
|
#pragma mark MPDocument Notifications
|
||||||
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateFilterButtons) name:MPDocumentDidChangeSearchFlags object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_updateFilterButtons) name:MPDocumentDidChangeSearchFlags object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeCurrentItem:) name:MPDocumentCurrentItemChangedNotification object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didChangeCurrentItem:) name:MPDocumentCurrentItemChangedNotification object:document];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_didEnterSearch:(NSNotification *)notification {
|
- (void)_didEnterSearch:(NSNotification *)notification {
|
||||||
|
|||||||
@@ -212,37 +212,15 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didChangeCurrentItem:) name:MPDocumentCurrentItemChangedNotification object:document];
|
||||||
selector:@selector(_didChangeCurrentItem:)
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didAddItem:) name:MPDocumentDidAddEntryNotification object:document];
|
||||||
name:MPDocumentCurrentItemChangedNotification
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document];
|
||||||
object:document];
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didExitSearch:) name:MPDocumentDidExitSearchNotification object:document];
|
||||||
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didUpdateSearchResults:) name:MPDocumentDidChangeSearchResults object:document];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:document];
|
||||||
selector:@selector(_didAddItem:)
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
|
||||||
name:MPDocumentDidAddEntryNotification
|
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_hideEntryHistory:) name:MPDocumentHideEntryHistoryNotification object:document];
|
||||||
object:document];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(_didEnterSearch:)
|
|
||||||
name:MPDocumentDidEnterSearchNotification
|
|
||||||
object:document];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(_didExitSearch:)
|
|
||||||
name:MPDocumentDidExitSearchNotification
|
|
||||||
object:document];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(_didUpdateSearchResults:)
|
|
||||||
name:MPDocumentDidChangeSearchResults
|
|
||||||
object:document];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(_didUnlockDatabase:)
|
|
||||||
name:MPDocumentDidUnlockDatabaseNotification
|
|
||||||
object:document];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_hideEntryHistory:) name:MPDocumentHideEntryHistoryNotification object:document];
|
|
||||||
|
|
||||||
[self.contextBarViewController registerNotificationsForDocument:document];
|
[self.contextBarViewController registerNotificationsForDocument:document];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
|
|||||||
|
|
||||||
#pragma mark - NSSearchFieldDelegate
|
#pragma mark - NSSearchFieldDelegate
|
||||||
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
|
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
|
||||||
if(commandSelector == @selector(insertNewline:)) {
|
if(commandSelector == @selector(insertNewline:) || commandSelector == @selector(moveDown:)) {
|
||||||
[[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self];
|
[[NSApp targetForAction:@selector(focusEntries:) to:nil from:self] focusEntries:self];
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
|
|||||||
Reference in New Issue
Block a user