aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-29 13:12:16 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-29 13:12:16 +0000
commite29132e608c9281d374d849cfff4555d95e49d28 (patch)
tree6f088f6c15e711a3d7fbae3d99291b72e2fbb45f /Source
parent0d04e4a8cfe9d5a19a1402664d526bece15c00f9 (diff)
downloadsequelpro-e29132e608c9281d374d849cfff4555d95e49d28.tar.gz
sequelpro-e29132e608c9281d374d849cfff4555d95e49d28.tar.bz2
sequelpro-e29132e608c9281d374d849cfff4555d95e49d28.zip
• MySQL Help
- change help target buttons into a NSSegmentedControl - fixed minor typo
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.h14
-rw-r--r--Source/CustomQuery.m44
2 files changed, 33 insertions, 25 deletions
diff --git a/Source/CustomQuery.h b/Source/CustomQuery.h
index 3e3b51ea..42b2ae66 100644
--- a/Source/CustomQuery.h
+++ b/Source/CustomQuery.h
@@ -48,9 +48,6 @@
IBOutlet id copyQueryFavoriteButton;
IBOutlet id runSelectionButton;
IBOutlet id runAllButton;
- IBOutlet id helpTargetPageButton;
- IBOutlet id helpTargetOnlineButton;
- IBOutlet id helpTargetMySQLButton;
IBOutlet NSMenuItem *runSelectionMenuItem;
IBOutlet NSMenuItem *clearHistoryMenuItem;
@@ -67,6 +64,8 @@
IBOutlet NSSearchField *helpSearchField;
IBOutlet NSSearchFieldCell *helpSearchFieldCell;
IBOutlet NSSegmentedControl *helpNavigator;
+ IBOutlet NSSegmentedControl *helpTargetSelector;
+
NSArray *queryResult;
NSUserDefaults *prefs;
@@ -93,12 +92,13 @@
- (IBAction)gearMenuItemSelected:(id)sender;
- (IBAction)getHelpForCurrentWord:(id)sender;
- (IBAction)showHelpForSearchString:(id)sender;
-- (IBAction)helpSegmentDispachter:(id)sender;
-- (IBAction)helpTargetPageButton:(id)sender;
-- (IBAction)helpTargetOnlineButton:(id)sender;
-- (IBAction)helpTargetMySQLButton:(id)sender;
+- (IBAction)helpSegmentDispatcher:(id)sender;
+- (IBAction)helpTargetDispatcher:(id)sender;
- (IBAction)helpSearchFindNextInPage:(id)sender;
- (IBAction)helpSearchFindPreviousInPage:(id)sender;
+- (IBAction)helpSelectHelpTargetMySQL:(id)sender;
+- (IBAction)helpSelectHelpTargetPage:(id)sender;
+- (IBAction)helpSelectHelpTargetWeb:(id)sender;
// queryFavoritesSheet methods
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 2798139d..3ae3c718 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1388,6 +1388,7 @@ traps enter key and
if(![helpString isEqualToString:@"__no_help_available"])
[helpWebViewWindow orderFront:helpWebView];
helpTarget = 2; // set default to search in MySQL help
+ [helpTargetSelector setSelectedSegment:2];
[self helpTargetValidation];
}
if([helpString isEqualToString:@"__no_help_available"])
@@ -1485,10 +1486,11 @@ traps enter key and
if(![helpWebView searchFor:[[helpSearchField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] direction:NO caseSensitive:NO wrap:YES])
NSBeep();
}
+
/*
* Navigation for back/TOC/forward
*/
-- (IBAction)helpSegmentDispachter:(id)sender
+- (IBAction)helpSegmentDispatcher:(id)sender
{
switch([helpNavigator selectedSegment])
{
@@ -1516,23 +1518,40 @@ traps enter key and
/*
* Set helpTarget
*/
-
-- (IBAction)helpTargetPageButton:(id)sender
+- (IBAction)helpSelectHelpTargetMySQL:(id)sender
+{
+ helpTarget = 2;
+ [helpTargetSelector setSelectedSegment:2];
+ [self helpTargetValidation];
+}
+- (IBAction)helpSelectHelpTargetPage:(id)sender
{
helpTarget = 0;
+ [helpTargetSelector setSelectedSegment:1];
[self helpTargetValidation];
}
-- (IBAction)helpTargetOnlineButton:(id)sender
+- (IBAction)helpSelectHelpTargetWeb:(id)sender
{
helpTarget = 1;
+ [helpTargetSelector setSelectedSegment:0];
[self helpTargetValidation];
}
-- (IBAction)helpTargetMySQLButton:(id)sender
+- (IBAction)helpTargetDispatcher:(id)sender
{
- helpTarget = 2;
+ switch([helpTargetSelector selectedSegment])
+ {
+ case 0:
+ helpTarget = 1;
+ break;
+ case 1:
+ helpTarget = 0;
+ break;
+ case 2:
+ helpTarget = 2;
+ break;
+ }
[self helpTargetValidation];
}
-
/*
* Control search target buttons and help behaviour
*/
@@ -1541,21 +1560,10 @@ traps enter key and
switch(helpTarget)
{
case 0: // page
- [helpTargetPageButton setState:NSOnState];
- [helpTargetOnlineButton setState:NSOffState];
- [helpTargetMySQLButton setState:NSOffState];
- [helpSearchFieldCell setSendsWholeSearchString:YES];
- break;
case 1: // online
- [helpTargetPageButton setState:NSOffState];
- [helpTargetOnlineButton setState:NSOnState];
- [helpTargetMySQLButton setState:NSOffState];
[helpSearchFieldCell setSendsWholeSearchString:YES];
break;
case 2: // MySQL
- [helpTargetPageButton setState:NSOffState];
- [helpTargetOnlineButton setState:NSOffState];
- [helpTargetMySQLButton setState:NSOnState];
[helpSearchFieldCell setSendsWholeSearchString:NO];
break;
}