From 1ffe77ae75328174b30e0fbe8067222698aa67b9 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 28 Apr 2009 13:22:24 +0000 Subject: =?UTF-8?q?=E2=80=A2=20MySQL=20Help:=20-=20simplified=20code=20for?= =?UTF-8?q?=20getting=20mySQLversion=20(this=20eliminates=20complier=20war?= =?UTF-8?q?ning=20too)=20-=20change=20HTML/CSS=20output=20slightly=20for?= =?UTF-8?q?=20keyword=20header=20-=20changed=20back/forward=20tooltip=20to?= =?UTF-8?q?=20be=20consistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/DBView.xib | 10 +++++----- Source/CustomQuery.m | 26 +++++++++----------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 4af1525d..6566796f 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -6481,7 +6481,7 @@ NSImage NSLeftFacingTriangleTemplate - Go Back + Show the previous page 0 @@ -6502,7 +6502,7 @@ NSRightFacingTriangleTemplate - Go Forward + Show the next page 0 @@ -21498,8 +21498,8 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{792, 192}, {351, 309}} - {{792, 192}, {351, 309}} + {{704, 285}, {351, 309}} + {{704, 285}, {351, 309}} {351, 120} 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;" @" }" @" " @"" @@ -1601,7 +1593,7 @@ traps enter key and if ([tableDetails objectForKey:@"description"]) { // one single help topic found if ([tableDetails objectForKey:@"name"]) { - [theHelp appendString:@"

  "]; + [theHelp appendString:@"

"]; [theHelp appendString:[[[tableDetails objectForKey:@"name"] copy] autorelease]]; [theHelp appendString:@"

"]; -- cgit v1.2.3