diff options
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]; |