From 38b05838737d41d752f13164c1bda8bca7ca4ca4 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 28 Apr 2009 15:20:15 +0000 Subject: =?UTF-8?q?=E2=80=A2=20MySQL=20Help=20-=20fixed=20logic=20to=20det?= =?UTF-8?q?ect=20whether=20db=20connection=20supports=20HELP=20statement?= =?UTF-8?q?=20-=20improved=20the=20while=20typing=20search,=20e.g.=20type?= =?UTF-8?q?=20in=20the=20Help=20search=20field=20"sel"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CustomQuery.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 6064c979..ed3486dc 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1390,6 +1390,8 @@ traps enter key and helpTarget = 2; // set default to search in MySQL help [self helpTargetValidation]; } + if([helpString isEqualToString:@"__no_help_available"]) + [helpWebViewWindow close]; if(![helpString length]) return; @@ -1588,7 +1590,7 @@ traps enter key and ]; theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@'", aString]]; - if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] || ![theResult numOfRows]) + if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString: [[NSString stringWithFormat: @@ -1598,7 +1600,11 @@ traps enter key and stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; return @"__no_help_available"; } - + if(![theResult numOfRows]) { + theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@%%'", aString]]; + if(![theResult numOfRows]) + return @""; + } tableDetails = [[NSDictionary alloc] initWithDictionary:[theResult fetchRowAsDictionary]]; if ([tableDetails objectForKey:@"description"]) { // one single help topic found -- cgit v1.2.3