aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-06-11 08:45:53 +0000
committerstuconnolly <stuart02@gmail.com>2009-06-11 08:45:53 +0000
commit94a35280d5f542211abdef0e8c9de83a4e374d10 (patch)
treefdd35ed8f4190865d8a353f4ad86c9bbe3a97d97 /Source/TableDocument.m
parentf54791648b44925321f2d9c631d9782574fecf51 (diff)
downloadsequelpro-94a35280d5f542211abdef0e8c9de83a4e374d10.tar.gz
sequelpro-94a35280d5f542211abdef0e8c9de83a4e374d10.tar.bz2
sequelpro-94a35280d5f542211abdef0e8c9de83a4e374d10.zip
Add a very basic preference to disable all query logging. This can be expanded upon to disable different types of queries.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 56ca2422..ef0958ab 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -100,6 +100,9 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[prefs addObserver:tableContentInstance forKeyPath:@"DisplayTableViewVerticalGridlines" options:NSKeyValueObservingOptionNew context:NULL];
[prefs addObserver:customQueryInstance forKeyPath:@"DisplayTableViewVerticalGridlines" options:NSKeyValueObservingOptionNew context:NULL];
+ // Register observers for when the preference changes
+ [prefs addObserver:[SPQueryConsole sharedQueryConsole] forKeyPath:@"ConsoleEnableLogging" options:NSKeyValueObservingOptionNew context:NULL];
+
// Register double click for the favorites view (double click favorite to connect)
[connectFavoritesTableView setTarget:self];
[connectFavoritesTableView setDoubleAction:@selector(initiateConnection:)];
@@ -2300,7 +2303,9 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
*/
- (void)willQueryString:(NSString *)query
{
- [[SPQueryConsole sharedQueryConsole] showMessageInConsole:query];
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ConsoleEnableLogging"]) {
+ [[SPQueryConsole sharedQueryConsole] showMessageInConsole:query];
+ }
}
/**