mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 13:08:15 +00:00
Added option to show search after unlocking the database
This commit is contained in:
@@ -2,4 +2,4 @@ github "MacPass/KeePassKit" "35da75901b293a53b44b1d0fe9d8fb312a4a7602"
|
|||||||
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa"
|
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa"
|
||||||
github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f"
|
github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f"
|
||||||
github "mstarke/HNHUi" "6.0"
|
github "mstarke/HNHUi" "6.0"
|
||||||
github "sparkle-project/Sparkle" "1.24.0"
|
github "sparkle-project/Sparkle" "1.27.0"
|
||||||
|
|||||||
@@ -189,6 +189,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
|
|
||||||
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
||||||
[self showEntries];
|
[self showEntries];
|
||||||
|
BOOL focusSearchAfterUnlock = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyFocusSearchAfterUnlock];
|
||||||
|
if(focusSearchAfterUnlock) {
|
||||||
|
[self.document performCustomSearch:self];
|
||||||
|
}
|
||||||
/* Show password reminders */
|
/* Show password reminders */
|
||||||
[self _presentPasswordIntervalAlerts];
|
[self _presentPasswordIntervalAlerts];
|
||||||
}
|
}
|
||||||
@@ -483,7 +487,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
- (void)showEntries {
|
- (void)showEntries {
|
||||||
self.contentViewController = self.splitViewController;
|
self.contentViewController = self.splitViewController;
|
||||||
[self.splitViewController showOutline];
|
[self.splitViewController showOutline];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showGroupInOutline:(id)sender {
|
- (void)showGroupInOutline:(id)sender {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyReopenLastDatabaseOnLaunch;
|
|||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyQuitOnLastWindowClose; // Quit MacPass when the user closes the last window
|
APPKIT_EXTERN NSString *const kMPSettingsKeyQuitOnLastWindowClose; // Quit MacPass when the user closes the last window
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyFileChangeStrategy;
|
APPKIT_EXTERN NSString *const kMPSettingsKeyFileChangeStrategy;
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableAutosave; // if set to YES MacPass support Autosaving for documents
|
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableAutosave; // if set to YES MacPass support Autosaving for documents
|
||||||
|
APPKIT_EXTERN NSString *const kMPSettingsKeyFocusSearchAfterUnlock; // Enter search after unlocking the database
|
||||||
|
|
||||||
/* URL handling */
|
/* URL handling */
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyBrowserBundleId;
|
APPKIT_EXTERN NSString *const kMPSettingsKeyBrowserBundleId;
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ NSString *const kMPSettingsKeyReopenLastDatabaseOnLaunch = @"Re
|
|||||||
NSString *const kMPSettingsKeyQuitOnLastWindowClose = @"QuitOnLastWindowClose";
|
NSString *const kMPSettingsKeyQuitOnLastWindowClose = @"QuitOnLastWindowClose";
|
||||||
NSString *const kMPSettingsKeyFileChangeStrategy = @"FileChangeStrategy";
|
NSString *const kMPSettingsKeyFileChangeStrategy = @"FileChangeStrategy";
|
||||||
NSString *const kMPSettingsKeyEnableAutosave = @"EnableAutosave";
|
NSString *const kMPSettingsKeyEnableAutosave = @"EnableAutosave";
|
||||||
|
NSString *const kMPSettingsKeyFocusSearchAfterUnlock = @"FocusSearchAfterUnlock";
|
||||||
|
|
||||||
NSString *const kMPSettingsKeyLockOnSleep = @"LockOnSleep";
|
NSString *const kMPSettingsKeyLockOnSleep = @"LockOnSleep";
|
||||||
NSString *const kMPSettingskeyLockOnLogout = @"LockOnLogout";
|
NSString *const kMPSettingskeyLockOnLogout = @"LockOnLogout";
|
||||||
NSString *const kMPSettingskeyLockOnScreenSleep = @"LockOnScreenSleep";
|
NSString *const kMPSettingskeyLockOnScreenSleep = @"LockOnScreenSleep";
|
||||||
@@ -173,7 +175,8 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au
|
|||||||
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
||||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
||||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
||||||
kMPSettingsKeyUseUnifiedToolbar: @YES // Do not use unified toolbar under Big Sur and above
|
kMPSettingsKeyUseUnifiedToolbar: @YES, // Do not use unified toolbar under Big Sur and above
|
||||||
|
kMPSettingsKeyFocusSearchAfterUnlock: @NO // Do not enter search directly after unlocking the database
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return standardDefaults;
|
return standardDefaults;
|
||||||
|
|||||||
@@ -345,6 +345,11 @@ NSString *const MPToolbarItemIdentifierAutotype = @"TOOLBAR_AUTOTYPE";
|
|||||||
}
|
}
|
||||||
/* only make the searchfield first responder if it's not already in an active search */
|
/* only make the searchfield first responder if it's not already in an active search */
|
||||||
if(![self.searchField currentEditor]) {
|
if(![self.searchField currentEditor]) {
|
||||||
|
|
||||||
|
// force search to be enabled since we might end up being called when it's not (yet) enabled
|
||||||
|
if(!searchItem.enabled) {
|
||||||
|
searchItem.enabled = YES;
|
||||||
|
}
|
||||||
[self.searchField.window makeFirstResponder:self.searchField];
|
[self.searchField.window makeFirstResponder:self.searchField];
|
||||||
[self.searchField selectText:self];
|
[self.searchField selectText:self];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,19 +21,19 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPToolbarItem.h"
|
#import "MPToolbarItem.h"
|
||||||
#import "MPActionHelper.h"
|
|
||||||
|
|
||||||
@implementation MPToolbarItem
|
@implementation MPToolbarItem
|
||||||
|
|
||||||
- (void)validate {
|
- (void)validate {
|
||||||
if(![self.view menu]) {
|
if(![self.view menu]) {
|
||||||
id target = [NSApp targetForAction:[self action] to:nil from:self];
|
id target = [NSApp targetForAction:self.action to:nil from:self];
|
||||||
BOOL isValid = (nil != target);
|
BOOL isValid = (nil != target);
|
||||||
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
|
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
|
||||||
if(validateTarget) {
|
if(validateTarget) {
|
||||||
isValid &= [validateTarget validateToolbarItem:self];
|
isValid &= [validateTarget validateToolbarItem:self];
|
||||||
}
|
}
|
||||||
self.enabled = isValid;
|
self.enabled = isValid;
|
||||||
|
NSLog(@"Validating ToolbarItem:%@ valid:%@", self, isValid ? @"YES" : @"NO");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user