aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-12-17 09:34:49 +0000
committerrowanbeentje <rowan@beent.je>2012-12-17 09:34:49 +0000
commit5a194fdff493435091e550a96d9e8ce79f1ee463 (patch)
treeb9b060238298d4eb4a06e1701711707b82118921 /Source/SPDatabaseDocument.m
parent0dc6bc96075af5a17f09598c6c179f32dd4cfda5 (diff)
downloadsequelpro-5a194fdff493435091e550a96d9e8ce79f1ee463.tar.gz
sequelpro-5a194fdff493435091e550a96d9e8ce79f1ee463.tar.bz2
sequelpro-5a194fdff493435091e550a96d9e8ce79f1ee463.zip
- Rearrange some menu shortcuts: ⌘F is now used on the Content tab to set the focus to the Filter Content tab bar. ⇧⌘F is used to show the advanced content filter table. This allows ^⌘F to be used for the standard OS X fullscreen window command, addressing Issue #1513.
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m32
1 files changed, 30 insertions, 2 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 63381d90..bc6cce5c 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -2302,6 +2302,26 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
}
/**
+ * Switches to the content view and makes the advanced filter view the first responder
+ */
+- (IBAction)showFilterTable:(id)sender
+{
+ [self viewContent:self];
+
+ [tableContentInstance performSelector:@selector(showFilterTable:) withObject:sender afterDelay:0.1];
+}
+
+/**
+ * Allow Command-F to set the focus to the content view filter if that view is active
+ */
+- (void)performFindPanelAction:(id)sender
+{
+ if ([sender tag] == 1 && [[self selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent]) {
+ [tableContentInstance makeContentFilterHaveFocus];
+ }
+}
+
+/**
* Exports the selected tables in the chosen file format.
*/
- (IBAction)exportSelectedTablesAs:(id)sender
@@ -3378,6 +3398,14 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
}
/**
+ * Forwards a responder request to set the focus to the table list filter area or table list
+ */
+- (IBAction) makeTableListFilterHaveFocus:(id)sender
+{
+ [tablesListInstance performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.1];
+}
+
+/**
* Menu item validation.
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
@@ -3522,12 +3550,12 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
}
// Focus on table content filter
- if ([menuItem action] == @selector(focusOnTableContentFilter:)) {
+ if ([menuItem action] == @selector(focusOnTableContentFilter:) || [menuItem action] == @selector(showFilterTable:)) {
return ([self table] != nil && [[self table] isNotEqualTo:@""]);
}
// Focus on table list or filter resp.
- if ([menuItem action] == @selector(focusOnTableListFilter:)) {
+ if ([menuItem action] == @selector(makeTableListFilterHaveFocus:)) {
if([[tablesListInstance valueForKeyPath:@"tables"] count] > 20)
[menuItem setTitle:NSLocalizedString(@"Filter Tables", @"filter tables menu item")];