diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-25 19:44:59 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-25 19:44:59 +0000 |
commit | c6779c7de40f38c8ff7f8d8ffa7c649164921556 (patch) | |
tree | 0913f34b374d14d72a8b95c47e0f208fdb0c003d | |
parent | 9163b4ff5779f2abc03855542448f5a01d5f23e4 (diff) | |
download | sequelpro-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
-rw-r--r-- | Interfaces/English.lproj/MainMenu.xib | 14 | ||||
-rw-r--r-- | Source/TableDocument.m | 10 | ||||
-rw-r--r-- | Source/TablesList.m | 10 |
3 files changed, 24 insertions, 10 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 705eaafb..8798d869 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -12,7 +12,7 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="498"/> + <integer value="758"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1629,7 +1629,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSMenuItem" id="759561673"> <reference key="NSMenu" ref="1056168652"/> - <string key="NSTitle">Filter Content...</string> + <string key="NSTitle">Filter Content</string> <string key="NSKeyEquiv">f</string> <int key="NSKeyEquivModMask">1310720</int> <int key="NSMnemonicLoc">2147483647</int> @@ -1638,7 +1638,7 @@ </object> <object class="NSMenuItem" id="328775074"> <reference key="NSMenu" ref="1056168652"/> - <string key="NSTitle">Filter Tables…</string> + <string key="NSTitle">Filter Tables</string> <string key="NSKeyEquiv">f</string> <int key="NSKeyEquivModMask">1835008</int> <int key="NSMnemonicLoc">2147483647</int> @@ -4804,7 +4804,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{470, 265}, {280, 283}}</string> + <string>{{387, 375}, {280, 283}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{654, 613}, {157, 223}}</string> @@ -4836,7 +4836,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{449, 1007}, {197, 53}}</string> - <string>{{447, 658}, {511, 20}}</string> + <string>{{194, 636}, {511, 20}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{506, 836}, {511, 20}}</string> @@ -4889,7 +4889,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{639, 365}, {251, 293}}</string> + <string>{{431, 365}, {251, 293}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{698, 703}, {184, 133}}</string> @@ -4984,7 +4984,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{645, 315}, {279, 233}}</string> + <string>{{517, 403}, {279, 233}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{829, 663}, {268, 173}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 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]; + + } } /** |