aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPQueryConsole.h5
-rw-r--r--Source/SPQueryConsole.m24
2 files changed, 26 insertions, 3 deletions
diff --git a/Source/SPQueryConsole.h b/Source/SPQueryConsole.h
index 8b1d912d..c3211f18 100644
--- a/Source/SPQueryConsole.h
+++ b/Source/SPQueryConsole.h
@@ -29,11 +29,12 @@
IBOutlet NSSearchField *consoleSearchField;
IBOutlet NSProgressIndicator *progressIndicator;
IBOutlet NSButton *includeTimeStampsButton, *saveConsoleButton, *clearConsoleButton;
- IBOutlet NSMenuItem *showTimeStampsMenuItem, *showSelectShowStatementsMenuItem;
+ IBOutlet NSMenuItem *showTimeStampsMenuItem, *showSelectShowStatementsMenuItem, *showHelpMenuItem;
NSFont *consoleFont;
NSMutableArray *messagesFullSet, *messagesFilteredSet, *messagesVisibleSet;
BOOL showSelectStatementsAreDisabled;
+ BOOL showHelpStatementsAreDisabled;
BOOL filterIsActive;
NSMutableString *activeFilterString;
}
@@ -47,6 +48,8 @@
- (IBAction)saveConsoleAs:(id)sender;
- (IBAction)toggleShowTimeStamps:(id)sender;
- (IBAction)toggleShowSelectShowStatements:(id)sender;
+- (IBAction)toggleShowHelpStatements:(id)sender;
+
- (void)showMessageInConsole:(NSString *)message;
- (void)showErrorInConsole:(NSString *)error;
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;
}