aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-09-04 11:55:54 +0000
committerBibiko <bibiko@eva.mpg.de>2009-09-04 11:55:54 +0000
commit3352744652a821093ef1138187609cdca5c9fef7 (patch)
tree61722ea2c5d6f37ec7af942553ade03158abf09f /Source
parent51246e91d7709ea1083039be88b9076bec7b3c44 (diff)
downloadsequelpro-3352744652a821093ef1138187609cdca5c9fef7.tar.gz
sequelpro-3352744652a821093ef1138187609cdca5c9fef7.tar.bz2
sequelpro-3352744652a821093ef1138187609cdca5c9fef7.zip
• prepared Query Name Sheet for choosing the target of the to be saved query favorite (global or not)
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.h1
-rw-r--r--Source/CustomQuery.m19
2 files changed, 14 insertions, 6 deletions
diff --git a/Source/CustomQuery.h b/Source/CustomQuery.h
index cedccab0..9d1559e6 100644
--- a/Source/CustomQuery.h
+++ b/Source/CustomQuery.h
@@ -76,6 +76,7 @@
IBOutlet NSWindow *queryFavoritesSheet;
IBOutlet NSButton *saveQueryFavoriteButton;
IBOutlet NSTextField *queryFavoriteNameTextField;
+ IBOutlet id saveQueryFavoriteGlobal;
IBOutlet NSWindow *helpWebViewWindow;
IBOutlet WebView *helpWebView;
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index d679a1de..bbad9edc 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -154,6 +154,7 @@
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:@"addSelectionToNewQueryFavorite"];
+
}
if ([queryFavoritesButton indexOfSelectedItem] == 2) {
@@ -2489,14 +2490,20 @@
queryToBeAddded = [textView string];
}
- [favorites addObject:[NSDictionary dictionaryWithObjects:
- [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil]
- forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
-
- [prefs setObject:favorites forKey:@"queryFavorites"];
- [prefs synchronize];
+ if([saveQueryFavoriteGlobal state] == NSOnState) {
+ [favorites addObject:[NSDictionary dictionaryWithObjects:
+ [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil]
+ forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
+ [prefs setObject:favorites forKey:@"queryFavorites"];
+ } else {
+ [SPTooltip showWithObject:@"Not yet implemented"];
+ }
+
+ [saveQueryFavoriteGlobal setState:NSOffState];
+
[self queryFavoritesHaveBeenUpdated:nil];
+
}
}