diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-04-28 15:03:56 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-04-28 15:03:56 +0000 |
commit | 86b0a94eab63cf4b0835f620a9902bee26c3853c (patch) | |
tree | 9ef6c83949b6b5c934e6dda57b4834d58605e106 | |
parent | 91f5c9d1123ed2709f54901ddd10c441069a940e (diff) | |
download | sequelpro-86b0a94eab63cf4b0835f620a9902bee26c3853c.tar.gz sequelpro-86b0a94eab63cf4b0835f620a9902bee26c3853c.tar.bz2 sequelpro-86b0a94eab63cf4b0835f620a9902bee26c3853c.zip |
• MySQL Help
- if the connected database doesn't support the HELP statement or the admin deleted the help tables in mysql the search falls back to the online search according to the connected mysql version
- changed slightly the example css output style
-rw-r--r-- | Source/CustomQuery.m | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 419085fd..6064c979 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1374,10 +1374,7 @@ traps enter key and if(![helpWebViewWindow isVisible]) { mySQLversion = [[[(TableDocument *)[[textView window] delegate] mySQLVersion] substringToIndex:3] retain]; - [helpWebViewWindow setTitle:[NSString stringWithFormat:@"%@ (%@ %@)", - NSLocalizedString(@"MySQL Help", @"mysql help"), - NSLocalizedString(@"version", @"version"), - mySQLversion]]; + [helpWebViewWindow setTitle:[NSString stringWithFormat:@"%@ (%@ %@)", NSLocalizedString(@"MySQL Help", @"mysql help"), NSLocalizedString(@"version", @"version"), mySQLversion]]; [helpWebView setMaintainsBackForwardList:YES]; [[helpWebView backForwardList] setCapacity:20]; if([[helpWebView backForwardList] backListCount] < 1) @@ -1388,7 +1385,8 @@ traps enter key and [helpNavigator setEnabled:[[helpWebView backForwardList] backListCount] forSegment:0]; [helpNavigator setEnabled:[[helpWebView backForwardList] forwardListCount] forSegment:2]; } - [helpWebViewWindow orderFront:helpWebView]; + if(![helpString isEqualToString:@"__no_help_available"]) + [helpWebViewWindow orderFront:helpWebView]; helpTarget = 2; // set default to search in MySQL help [self helpTargetValidation]; } @@ -1575,6 +1573,9 @@ traps enter key and @" .code {" @" font-family:Monaco;" @" }" + @" .example {" + @" font-family:Courier;" + @" }" @" .searchstring {" @" }" @" .header {" @@ -1587,7 +1588,16 @@ traps enter key and ]; theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@'", aString]]; - if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] || ![theResult numOfRows]) return @""; + if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] || ![theResult numOfRows]) + { + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString: + [[NSString stringWithFormat: + MYSQL_DEV_SEARCH_URL, + aString, + [mySQLversion stringByReplacingOccurrencesOfString:@"." withString:@""]] + stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; + return @"__no_help_available"; + } tableDetails = [[NSDictionary alloc] initWithDictionary:[theResult fetchRowAsDictionary]]; @@ -1661,7 +1671,7 @@ traps enter key and if([tableDetails objectForKey:@"example"]){ NSString *examples = [[[tableDetails objectForKey:@"example"] copy] autorelease]; if([examples length]){ - [theHelp appendString:@"<br><br><i><b>Example:</b></i><br><br><pre class='code'>"]; + [theHelp appendString:@"<br><i><b>Example:</b></i><br><pre class='example'>"]; [theHelp appendString:examples]; [theHelp appendString:@"</pre>"]; } |