mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52:21 +00:00
Added method to put focus on group, entry or inspector view via keyboard shortcuts. This might be better done via a simple "cmd + arrow" shortcut to move about
This commit is contained in:
@@ -205,6 +205,25 @@
|
||||
<action selector="toggleInspector:" target="-1" id="1199"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Coa-ar-1wb"/>
|
||||
<menuItem title="Focus Groups" keyEquivalent="g" id="HxM-dV-LIH">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="focusGroups:" target="-1" id="WDh-av-H8i"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Focus Entries" keyEquivalent="e" id="2VP-vB-IeX">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="focusEntries:" target="-1" id="Vgp-9G-oI3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Focus Inspector" keyEquivalent="i" id="Zje-Me-5c8">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="focusInspector:" target="-1" id="Gug-vY-M8N"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="1179"/>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
|
||||
@@ -37,8 +37,13 @@
|
||||
|
||||
- (IBAction)lock:(id)sender;
|
||||
|
||||
- (void)createGroup:(id)sender;
|
||||
- (void)toggleInspector:(id)sender;
|
||||
- (IBAction)createGroup:(id)sender;
|
||||
|
||||
#pragma mark View Actions
|
||||
- (IBAction)toggleInspector:(id)sender;
|
||||
- (IBAction)focusGroups:(id)sender;
|
||||
- (IBAction)focusEntries:(id)sender;
|
||||
- (IBAction)focusInspector:(id)sender;
|
||||
|
||||
#pragma mark MPPasswordEditWindowDelegater
|
||||
- (void)didFinishPasswordEditing:(BOOL)changedPasswordOrKey;
|
||||
|
||||
@@ -275,6 +275,18 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:inspectorVisible forKey:kMPSettingsKeyShowInspector];
|
||||
}
|
||||
|
||||
- (void)focusEntries:(id)sender {
|
||||
[[self window] makeFirstResponder:[self.entryViewController reconmendedFirstResponder]];
|
||||
}
|
||||
|
||||
- (void)focusGroups:(id)sender {
|
||||
[[self window] makeFirstResponder:[self.outlineViewController reconmendedFirstResponder]];
|
||||
}
|
||||
|
||||
- (void)focusInspector:(id)sender {
|
||||
[[self window] makeFirstResponder:[self.inspectorViewController reconmendedFirstResponder]];
|
||||
}
|
||||
|
||||
- (void)showEntries {
|
||||
NSView *contentView = [[self window] contentView];
|
||||
if(_splitView == contentView) {
|
||||
@@ -361,7 +373,7 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) {
|
||||
/* Save lossy */
|
||||
[[self document] saveDocument:nil];
|
||||
return;
|
||||
|
||||
|
||||
case NSAlertSecondButtonReturn:
|
||||
/* Change Format */
|
||||
//[[self document] setFileType:[MPDocument fileTypeForVersion:KPKXmlVersion]];
|
||||
@@ -374,8 +386,6 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) {
|
||||
return; // Cancel or unknown
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Helper
|
||||
- (void)_showDatabaseSetting:(MPDatabaseSettingsTab)tab {
|
||||
if(!self.documentSettingsWindowController) {
|
||||
_documentSettingsWindowController = [[MPDatabaseSettingsWindowController alloc] initWithDocument:[self document]];
|
||||
|
||||
@@ -125,7 +125,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
- (void)didLoadView {
|
||||
[[self view] setWantsLayer:YES];
|
||||
[self _hideFilterBarAnimated];
|
||||
|
||||
|
||||
[_bottomBar setBorderType:HNHBorderTop];
|
||||
[self.addEntryButton setAction:[MPActionHelper actionOfType:MPActionAddEntry]];
|
||||
|
||||
@@ -195,6 +195,10 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
|
||||
}
|
||||
|
||||
- (NSResponder *)reconmendedFirstResponder {
|
||||
return self.entryTable;
|
||||
}
|
||||
|
||||
- (void)setupNotifications:(MPDocumentWindowController *)windowController {
|
||||
MPDocument *document = [windowController document];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
|
||||
@@ -65,6 +65,10 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (NSResponder *)reconmendedFirstResponder {
|
||||
return [self view];
|
||||
}
|
||||
|
||||
#pragma mark Properties
|
||||
- (void)setActiveTab:(NSUInteger)activeTab {
|
||||
if(_activeTab != activeTab) {
|
||||
|
||||
@@ -82,6 +82,11 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
selector:@selector(_didBecomeFirstResponder:)
|
||||
name:MPDidActivateViewNotification
|
||||
object:_outlineView];
|
||||
|
||||
}
|
||||
|
||||
- (NSResponder *)reconmendedFirstResponder {
|
||||
return self.outlineView;
|
||||
}
|
||||
|
||||
#pragma mark Outline handling
|
||||
|
||||
Reference in New Issue
Block a user