diff options
author | stuconnolly <stuart02@gmail.com> | 2009-11-17 23:55:28 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-11-17 23:55:28 +0000 |
commit | 5b16e971e7afde07fb4089c60702a25b3f1ec59f (patch) | |
tree | 46d8d9a6022297bdc6f5a7a9b9342532a5462ee8 /Source | |
parent | 547643d46fc32ca0396315742525341e5b1a7cc2 (diff) | |
download | sequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.tar.gz sequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.tar.bz2 sequelpro-5b16e971e7afde07fb4089c60702a25b3f1ec59f.zip |
New separator in query favorites dropdown.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CustomQuery.m | 11 |
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]; |