mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 02:23:36 +00:00
Improved "Add Entry" workflow (issue #156)
- New entry is automatically scrolled to and selected - Title textfield is automatically focused - Pre-generate a password using the deault password creation settings
This commit is contained in:
@@ -206,6 +206,11 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
name:MPDocumentCurrentItemChangedNotification
|
||||
object:document];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didAddItem:)
|
||||
name:MPDocumentItemAddedNotification
|
||||
object:document];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didEnterSearch:)
|
||||
name:MPDocumentDidEnterSearchNotification
|
||||
@@ -221,7 +226,6 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
name:MPDocumentDidChangeSearchResults
|
||||
object:document];
|
||||
|
||||
|
||||
[self.contextBarViewController registerNotificationsForDocument:document];
|
||||
|
||||
/* Setup warning message at the bottom*/
|
||||
@@ -371,6 +375,13 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_didAddItem:(NSNotification *)notification {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
NSInteger row = document.selectedGroup.entries.count - 1;
|
||||
[self.entryTable scrollRowToVisible:row];
|
||||
[self.entryTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (void)_didUpdateSearchResults:(NSNotification *)notification {
|
||||
[self _showContextBar];
|
||||
NSArray *result = [notification userInfo][kMPDocumentSearchResultsKey];
|
||||
|
||||
Reference in New Issue
Block a user