aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-17 23:55:28 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-17 23:55:28 +0000
commit5b16e971e7afde07fb4089c60702a25b3f1ec59f (patch)
tree46d8d9a6022297bdc6f5a7a9b9342532a5462ee8 /Source/CustomQuery.m
parent547643d46fc32ca0396315742525341e5b1a7cc2 (diff)
downloadsequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.tar.gz
sequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.tar.bz2
sequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.zip
New separator in query favorites dropdown.
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 5fecc8a4..5886471f 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -211,7 +211,6 @@
if(replaceContent)
[textView setSelectedRange:NSMakeRange(0,[[textView string] length])];
- // [textView insertText:[[[prefs objectForKey:SPQueryFavorites] objectAtIndex:([queryFavoritesButton indexOfSelectedItem] - 6)] objectForKey:@"query"]];
// The actual query strings have been already stored as tooltip
[textView insertText:[[queryFavoritesButton selectedItem] toolTip]];
}
@@ -2560,7 +2559,7 @@
NSMenu *menu = [queryFavoritesButton menu];
// Remove all favorites beginning from the end
- while([queryFavoritesButton numberOfItems] > 6)
+ while([queryFavoritesButton numberOfItems] > 7)
[queryFavoritesButton removeItemAtIndex:[queryFavoritesButton numberOfItems]-1];
// Build document-based list
@@ -2805,7 +2804,7 @@
NSMenu *menu = [queryFavoritesButton menu];
NSString *searchPattern = [queryFavoritesSearchField stringValue];
- for (i = 6; i < [menu numberOfItems]; i++)
+ for (i = 7; 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]])];
@@ -2827,6 +2826,9 @@
}
}
+/**
+ * Setup various interface controls.
+ */
- (void)awakeFromNib
{
// Set pre-defined menu tags
@@ -2847,6 +2849,9 @@
object:tableDocumentInstance];
}
+/**
+ * Dealloc.
+ */
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];