diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-04-28 13:22:24 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-04-28 13:22:24 +0000 |
commit | 1ffe77ae75328174b30e0fbe8067222698aa67b9 (patch) | |
tree | a762d1e983431366e716ff1f58ded8299717809b /Source/CustomQuery.m | |
parent | a2f339ecc420468f54cbf55d70f380bbf0d64151 (diff) | |
download | sequelpro-1ffe77ae75328174b30e0fbe8067222698aa67b9.tar.gz sequelpro-1ffe77ae75328174b30e0fbe8067222698aa67b9.tar.bz2 sequelpro-1ffe77ae75328174b30e0fbe8067222698aa67b9.zip |
• MySQL Help:
- simplified code for getting mySQLversion (this eliminates complier warning too)
- change HTML/CSS output slightly for keyword header
- changed back/forward tooltip to be consistent
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index b3602941..419085fd 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -27,6 +27,7 @@ #import "SPGrowlController.h" #import "SPStringAdditions.h" #import "SPTextViewAdditions.h" +#import "TableDocument.h" #define MYSQL_DEV_SEARCH_URL @"http://search.mysql.com/search?q=%@&site=refman-%@" @@ -1372,20 +1373,11 @@ traps enter key and // Order out the Help window if not visible if(![helpWebViewWindow isVisible]) { - - // Get the major MySQL server version in the form of x.x, which is basically the first 3 characters of the returned version string - //get mysql version - CMMCPResult *theResult = nil; - theResult = [mySQLConnection queryString:@"SHOW VARIABLES LIKE 'version'"]; - NSString *version = [[theResult fetchRowAsArray] objectAtIndex:1]; - if ( [version isKindOfClass:[NSData class]] ) { - // starting with MySQL 4.1.14 the mysql variables are returned as nsdata - mySQLversion = [[NSString alloc] initWithData:version encoding:[mySQLConnection encoding]]; - } else { - mySQLversion = [[NSString stringWithString:version] retain]; - } - // init Help view - [helpWebViewWindow setTitle:[NSString stringWithFormat:@"%@ (%@ %@)", NSLocalizedString(@"MySQL Help", @"mysql help"), NSLocalizedString(@"version", @"version"), [mySQLversion substringToIndex:3]]]; + mySQLversion = [[[(TableDocument *)[[textView window] delegate] mySQLVersion] substringToIndex:3] retain]; + [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) @@ -1437,7 +1429,7 @@ traps enter key and [[NSString stringWithFormat: MYSQL_DEV_SEARCH_URL, searchTerm, - [[mySQLversion substringToIndex:3] stringByReplacingOccurrencesOfString:@"." withString:@""]] + [mySQLversion stringByReplacingOccurrencesOfString:@"." withString:@""]] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; // [[helpWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: // [[NSString stringWithFormat: @@ -1586,7 +1578,7 @@ traps enter key and @" .searchstring {" @" }" @" .header {" - @" padding:2mm;" + @" padding-bottom:5px;" @" }" @" </style>" @"</head>" @@ -1601,7 +1593,7 @@ traps enter key and if ([tableDetails objectForKey:@"description"]) { // one single help topic found if ([tableDetails objectForKey:@"name"]) { - [theHelp appendString:@"<h2 class='header'> "]; + [theHelp appendString:@"<h2 class='header'>"]; [theHelp appendString:[[[tableDetails objectForKey:@"name"] copy] autorelease]]; [theHelp appendString:@"</h2>"]; |