aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-14 22:21:13 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-14 22:21:13 +0000
commit694e5a55fe9f2579fdef121e3da9d300ed372f89 (patch)
tree6a3e033bc5437ef157a225d2cdf7975ea4cfb9af /Source/TableDocument.m
parent1ac04adbfe9ad64a9aaa35780301309718ff85d9 (diff)
downloadsequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.tar.gz
sequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.tar.bz2
sequelpro-694e5a55fe9f2579fdef121e3da9d300ed372f89.zip
Updates to the 'use monospaced font' preference, making it a lot more consistent across all table views. Also includes live updating when the preference is changed as well as its implementation in the query console, process list and variables table views.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m24
1 files changed, 6 insertions, 18 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index df856d33..69fc54d5 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -174,6 +174,12 @@
[prefs addObserver:tableRelationsInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
[prefs addObserver:[SPQueryController sharedQueryController] forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
+ // Register observers for the when the UseMonospacedFonts preference changes
+ [prefs addObserver:tableSourceInstance forKeyPath:SPUseMonospacedFonts options:NSKeyValueObservingOptionNew context:NULL];
+ [prefs addObserver:tableContentInstance forKeyPath:SPUseMonospacedFonts options:NSKeyValueObservingOptionNew context:NULL];
+ [prefs addObserver:customQueryInstance forKeyPath:SPUseMonospacedFonts options:NSKeyValueObservingOptionNew context:NULL];
+ [prefs addObserver:[SPQueryController sharedQueryController] forKeyPath:SPUseMonospacedFonts options:NSKeyValueObservingOptionNew context:NULL];
+
// Register observers for when the logging preference changes
[prefs addObserver:[SPQueryController sharedQueryController] forKeyPath:SPConsoleEnableLogging options:NSKeyValueObservingOptionNew context:NULL];
@@ -3300,9 +3306,6 @@
[aController setShouldCascadeWindows:YES];
[super windowControllerDidLoadNib:aController];
- //NSEnumerator *theCols = [[variablesTableView tableColumns] objectEnumerator];
- //NSTableColumn *theCol;
-
//register for notifications
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willPerformQuery:)
name:@"SMySQLQueryWillBePerformed" object:self];
@@ -3310,21 +3313,6 @@
name:@"SMySQLQueryHasBeenPerformed" object:self];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:)
name:@"NSApplicationWillTerminateNotification" object:nil];
-
- //set up interface
- /*if ( [prefs boolForKey:SPUseMonospacedFonts] ) {
- [[SPQueryController sharedQueryController] setConsoleFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
-
- while ( (theCol = [theCols nextObject]) ) {
- [[theCol dataCell] setFont:[NSFont fontWithName:@"Monaco" size:10]];
- }
- } else {
- [[SPQueryController sharedQueryController] setConsoleFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
-
- while ( (theCol = [theCols nextObject]) ) {
- [[theCol dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- }
- }*/
}
// NSWindow delegate methods