aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-17 22:17:50 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-17 22:17:50 +0000
commit3eb56d9c389b9915a47d59f77ed1316ebbbc1544 (patch)
treecb3b6ec08724f154c297ec062cd891f15ac205a2 /Source/CustomQuery.m
parent79a8715c6860dd51bf43daf0210d0c84684632fa (diff)
downloadsequelpro-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/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m22
1 files changed, 17 insertions, 5 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