aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryConsole.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-28 09:00:15 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-28 09:00:15 +0000
commitaf81a0dfbad3e68ae0a5e6cb40e86303d6bd744c (patch)
treee571635812ea707913c96ea1e9a4e066f26637eb /Source/SPQueryConsole.m
parenta26da55e75166b2fad38f64548363ed1a6fa6462 (diff)
downloadsequelpro-af81a0dfbad3e68ae0a5e6cb40e86303d6bd744c.tar.gz
sequelpro-af81a0dfbad3e68ae0a5e6cb40e86303d6bd744c.tar.bz2
sequelpro-af81a0dfbad3e68ae0a5e6cb40e86303d6bd744c.zip
• added "Show HELP statements" to MySQL Console
Diffstat (limited to 'Source/SPQueryConsole.m')
-rw-r--r--Source/SPQueryConsole.m24
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/SPQueryConsole.m b/Source/SPQueryConsole.m
index 6e65b3a2..5314028b 100644
--- a/Source/SPQueryConsole.m
+++ b/Source/SPQueryConsole.m
@@ -85,6 +85,7 @@ static SPQueryConsole *sharedQueryConsole = nil;
messagesFilteredSet = [[NSMutableArray alloc] init];
showSelectStatementsAreDisabled = NO;
+ showHelpStatementsAreDisabled = NO;
filterIsActive = NO;
activeFilterString = [[NSMutableString alloc] init];
@@ -117,6 +118,7 @@ static SPQueryConsole *sharedQueryConsole = nil;
[self setWindowFrameAutosaveName:CONSOLE_WINDOW_AUTO_SAVE_NAME];
[[consoleTableView tableColumnWithIdentifier:TABLEVIEW_DATE_COLUMN_IDENTIFIER] setHidden:![[NSUserDefaults standardUserDefaults] boolForKey:@"ConsoleShowTimestamps"]];
showSelectStatementsAreDisabled = ![[NSUserDefaults standardUserDefaults] boolForKey:@"ConsoleShowSelectsAndShows"];
+ showHelpStatementsAreDisabled = ![[NSUserDefaults standardUserDefaults] boolForKey:@"ConsoleShowHelps"];
[self _updateFilterState];
}
@@ -218,6 +220,17 @@ static SPQueryConsole *sharedQueryConsole = nil;
}
/**
+ * Toggles the hiding of messages containing HELP statements
+ */
+- (IBAction)toggleShowHelpStatements:(id)sender
+{
+ // Store the state of the toggle for later quick reference
+ showHelpStatementsAreDisabled = [sender state];
+
+ [self _updateFilterState];
+}
+
+/**
* Shows the supplied message in the console.
*/
- (void)showMessageInConsole:(NSString *)message
@@ -400,7 +413,7 @@ static SPQueryConsole *sharedQueryConsole = nil;
// If filtering is disabled and all show/selects are shown, empty the filtered
// result set and set the full set to visible.
- if (!filterIsActive && !showSelectStatementsAreDisabled) {
+ if (!filterIsActive && !showSelectStatementsAreDisabled && !showHelpStatementsAreDisabled) {
messagesVisibleSet = messagesFullSet;
[consoleTableView reloadData];
@@ -461,7 +474,7 @@ static SPQueryConsole *sharedQueryConsole = nil;
[messagesFullSet addObject:consoleMessage];
// If filtering is active, determine whether to add a reference to the filtered set
- if ((showSelectStatementsAreDisabled || filterIsActive)
+ if ((showSelectStatementsAreDisabled || showHelpStatementsAreDisabled || filterIsActive)
&& [self _messageMatchesCurrentFilters:[consoleMessage message]])
{
[messagesFilteredSet addObject:[messagesFullSet lastObject]];
@@ -496,6 +509,13 @@ static SPQueryConsole *sharedQueryConsole = nil;
{
messageMatchesCurrentFilters = NO;
}
+ // If hiding HELP is toggled to on, check whether the message is a HELP
+ if (messageMatchesCurrentFilters
+ && showHelpStatementsAreDisabled
+ && ([[message uppercaseString] hasPrefix:@"HELP"]))
+ {
+ messageMatchesCurrentFilters = NO;
+ }
return messageMatchesCurrentFilters;
}