From c6779c7de40f38c8ff7f8d8ffa7c649164921556 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 25 Mar 2010 19:44:59 +0000 Subject: =?UTF-8?q?=E2=80=A2=20changed=20behaviour=20of=20^=E2=8C=A5?= =?UTF-8?q?=E2=8C=98F=20=20"Filter=20Table"=20or=20"Change=20Focus=20to=20?= =?UTF-8?q?Table=20List"=20-=20if=20>=2020=20tables=20are=20listed=20it=20?= =?UTF-8?q?sets=20the=20focus=20on=20the=20search=20field=20-=20if=20<=3D?= =?UTF-8?q?=2020=20it=20sets=20the=20focus=20on=20the=20table=20list,=20an?= =?UTF-8?q?d=20-=20if=20no=20selection=20-=20it=20selects=20the=20first=20?= =?UTF-8?q?table=20item=20-=20this=20fixes=20i597?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/MainMenu.xib | 14 +++++++------- Source/TableDocument.m | 10 ++++++++-- 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 @@ YES - + YES @@ -1629,7 +1629,7 @@ YES - Filter Content... + Filter Content f 1310720 2147483647 @@ -1638,7 +1638,7 @@ - Filter Tables… + Filter Tables f 1835008 2147483647 @@ -4804,7 +4804,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{470, 265}, {280, 283}} + {{387, 375}, {280, 283}} com.apple.InterfaceBuilder.CocoaPlugin {{654, 613}, {157, 223}} @@ -4836,7 +4836,7 @@ com.apple.InterfaceBuilder.CocoaPlugin {{449, 1007}, {197, 53}} - {{447, 658}, {511, 20}} + {{194, 636}, {511, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{506, 836}, {511, 20}} @@ -4889,7 +4889,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{639, 365}, {251, 293}} + {{431, 365}, {251, 293}} com.apple.InterfaceBuilder.CocoaPlugin {{698, 703}, {184, 133}} @@ -4984,7 +4984,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{645, 315}, {279, 233}} + {{517, 403}, {279, 233}} com.apple.InterfaceBuilder.CocoaPlugin {{829, 663}, {268, 173}} com.apple.InterfaceBuilder.CocoaPlugin 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]; + + } } /** -- cgit v1.2.3