aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-25 19:44:59 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-25 19:44:59 +0000
commitc6779c7de40f38c8ff7f8d8ffa7c649164921556 (patch)
tree0913f34b374d14d72a8b95c47e0f208fdb0c003d /Source
parent9163b4ff5779f2abc03855542448f5a01d5f23e4 (diff)
downloadsequelpro-c6779c7de40f38c8ff7f8d8ffa7c649164921556.tar.gz
sequelpro-c6779c7de40f38c8ff7f8d8ffa7c649164921556.tar.bz2
sequelpro-c6779c7de40f38c8ff7f8d8ffa7c649164921556.zip
• changed behaviour of ^⌥⌘F "Filter Table" or "Change Focus to Table List"
- if > 20 tables are listed it sets the focus on the search field - if <= 20 it sets the focus on the table list, and - if no selection - it selects the first table item - this fixes i597
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDocument.m10
-rw-r--r--Source/TablesList.m10
2 files changed, 17 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 0a68eda2..65cf9049 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -3137,9 +3137,15 @@
return ([self table] != nil && [[self table] isNotEqualTo:@""]);
}
- // Focus on table list filter
+ // Focus on table list or filter resp.
if ([menuItem action] == @selector(focusOnTableListFilter:)) {
- return ([[tablesListInstance valueForKeyPath:@"tables"] count] > 20);
+
+ if([[tablesListInstance valueForKeyPath:@"tables"] count] > 20)
+ [menuItem setTitle:NSLocalizedString(@"Filter Tables", @"filter tables menu item")];
+ else
+ [menuItem setTitle:NSLocalizedString(@"Change Focus to Table List", @"change focus to table list menu item")];
+
+ return ([[tablesListInstance valueForKeyPath:@"tables"] count] > 1);
}
return [super validateMenuItem:menuItem];
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 76e653be..6ef3d315 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -1609,7 +1609,15 @@
*/
- (void) makeTableListFilterHaveFocus
{
- [tableWindow makeFirstResponder:listFilterField];
+ if([tables count] > 20) {
+ [tableWindow makeFirstResponder:listFilterField];
+ }
+ else if([tables count] > 2) {
+ [tableWindow makeFirstResponder:tablesListView];
+ if([tablesListView numberOfSelectedRows] < 1)
+ [tablesListView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
+
+ }
}
/**