diff options
author | stuconnolly <stuart02@gmail.com> | 2009-11-17 22:17:50 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-11-17 22:17:50 +0000 |
commit | 3eb56d9c389b9915a47d59f77ed1316ebbbc1544 (patch) | |
tree | cb3b6ec08724f154c297ec062cd891f15ac205a2 /Source | |
parent | 79a8715c6860dd51bf43daf0210d0c84684632fa (diff) | |
download | sequelpro-3eb56d9c389b9915a47d59f77ed1316ebbbc1544.tar.gz sequelpro-3eb56d9c389b9915a47d59f77ed1316ebbbc1544.tar.bz2 sequelpro-3eb56d9c389b9915a47d59f77ed1316ebbbc1544.zip |
Change the placeholder value of a few search fields to simply 'Filter' to make them look less cramped.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CustomQuery.m | 22 | ||||
-rw-r--r-- | Source/TablesList.m | 4 |
2 files changed, 18 insertions, 8 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index dc0d9b76..5fecc8a4 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -2796,23 +2796,35 @@ return self; } +/** + * Filters the query favorites menu. + */ - (IBAction)filterQueryFavorites:(id)sender { - int i; + NSUInteger i; NSMenu *menu = [queryFavoritesButton menu]; NSString *searchPattern = [queryFavoritesSearchField stringValue]; - for (i=6; i< [menu numberOfItems]; i++) + + for (i = 6; i < [menu numberOfItems]; i++) + { [[menu itemAtIndex:i] setHidden:([[menu itemAtIndex:i] tag] != SP_FAVORITE_HEADER_MENUITEM_TAG - && ![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", searchPattern]])]; + && ![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", searchPattern]])]; + } } +/** + * Filters the query history menu. + */ - (IBAction)filterQueryHistory:(id)sender { - int i; + NSUInteger i; NSMenu *menu = [queryHistoryButton menu]; NSString *searchPattern = [queryHistorySearchField stringValue]; - for (i=2; i< [menu numberOfItems]; i++) + + for (i = 3; i < [menu numberOfItems]; i++) + { [[menu itemAtIndex:i] setHidden:(![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", searchPattern]])]; + } } - (void)awakeFromNib diff --git a/Source/TablesList.m b/Source/TablesList.m index 72f7afce..3a7dbacf 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -238,9 +238,7 @@ // Set the filter placeholder text if ([tableDocumentInstance database]) { - if ([theResult numOfRows]) [[listFilterField cell] setPlaceholderString:NSLocalizedString(@"Filter tables, views, procs & funcs", @"Filter placeholder when all tables types are present")]; - else if (tableListContainsViews) [[listFilterField cell] setPlaceholderString:NSLocalizedString(@"Filter tables and views", @"Filter placeholder when tables and views are present")]; - else [[listFilterField cell] setPlaceholderString:NSLocalizedString(@"Filter tables", @"Filter placeholder when only tables are present")]; + [[listFilterField cell] setPlaceholderString:NSLocalizedString(@"Filter", @"Filter placeholder")]; } if (previousSelectedTable) [previousSelectedTable release]; |