aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-30 21:28:40 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-30 21:28:40 +0000
commitc6d9ccf48dcc12c907fd6e86035b5964972ab881 (patch)
tree0619736b463a946653f847e45a24186e5d5b2d5b /Source/CustomQuery.m
parente322bb1f2baf8c5f91ab6d676e81c682e93291ea (diff)
downloadsequelpro-c6d9ccf48dcc12c907fd6e86035b5964972ab881.tar.gz
sequelpro-c6d9ccf48dcc12c907fd6e86035b5964972ab881.tar.bz2
sequelpro-c6d9ccf48dcc12c907fd6e86035b5964972ab881.zip
• added "MySQL Help" to the MainMenu > Help submenu
- it shows the MySQL Help TOC of the front most tableDocument mysql connection, i.e. each tableDocument has its own Help window (due to the fact that the Help is version specific), and makes it the keyWindow - changed the way for getting the mySQLversion into the CustomQuery; now a new tableDocument set it via [customQueryInstance setMySQLversion:foo]; the other way was to unsafe regarding to get the version if MySQL Help was invoked via MainMenu • Help window and Create Table Syntax window will be released while closing the tableDocument
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m31
1 files changed, 22 insertions, 9 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 10cf95f7..755b980f 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -37,7 +37,6 @@
#define SP_HELP_SHOW_TOC_BUTTON 1
#define SP_HELP_GOFORWARD_BUTTON 2
#define SP_HELP_NOT_AVAILABLE @"__no_help_available"
-#define SP_HELP_TOC_SEARCH_STRING @"contents"
@implementation CustomQuery
@@ -1383,6 +1382,21 @@ traps enter key and
#pragma mark -
#pragma mark MySQL Help
+/*
+ * Set the MySQL version as X.Y for Help window title and online search
+ */
+- (void)setMySQLversion:(NSString *)theVersion
+{
+ mySQLversion = [[theVersion substringToIndex:3] retain];
+}
+
+/*
+ * Return the Help window.
+ */
+- (NSWindow *)helpWebViewWindow
+{
+ return helpWebViewWindow;
+}
/*
* Show the data for "HELP 'searchString'".
@@ -1390,18 +1404,13 @@ traps enter key and
- (void)showHelpFor:(NSString *)searchString addToHistory:(BOOL)addToHistory
{
NSString * helpString = [self getHTMLformattedMySQLHelpFor:searchString];
+
// Order out resp. init the Help window if not visible
if(![helpWebViewWindow isVisible])
{
- // get current MySQL version for title and online search
- mySQLversion = [[[(TableDocument *)[[textView window] delegate] mySQLVersion] substringToIndex:3] retain];
-
+ // set title of the Help window
[helpWebViewWindow setTitle:[NSString stringWithFormat:@"%@ (%@ %@)", NSLocalizedString(@"MySQL Help", @"mysql help"), NSLocalizedString(@"version", @"version"), mySQLversion]];
-
- // init search history
- [helpWebView setMaintainsBackForwardList:YES];
- [[helpWebView backForwardList] setCapacity:20];
-
+
// init goback/forward buttons
if([[helpWebView backForwardList] backListCount] < 1)
{
@@ -1872,6 +1881,10 @@ traps enter key and
NSBeep();
}
+ // init search history
+ [helpWebView setMaintainsBackForwardList:YES];
+ [[helpWebView backForwardList] setCapacity:20];
+
return self;
}