From e29132e608c9281d374d849cfff4555d95e49d28 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 29 Apr 2009 13:12:16 +0000 Subject: =?UTF-8?q?=E2=80=A2=20MySQL=20Help=20-=20change=20help=20target?= =?UTF-8?q?=20buttons=20into=20a=20NSSegmentedControl=20-=20fixed=20minor?= =?UTF-8?q?=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CustomQuery.m | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'Source/CustomQuery.m') 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; } -- cgit v1.2.3