aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-05-19 19:57:34 +0000
committerstuconnolly <stuart02@gmail.com>2009-05-19 19:57:34 +0000
commitdad2c2af5af18890fa927d171f1ff58530a1a810 (patch)
tree3ec05044742bdad1a6e963fe19b2d5057e5fdafe /Source/TableDocument.m
parent641eeff363a2864456a985b246576bfd5d41b144 (diff)
downloadsequelpro-dad2c2af5af18890fa927d171f1ff58530a1a810.tar.gz
sequelpro-dad2c2af5af18890fa927d171f1ff58530a1a810.tar.bz2
sequelpro-dad2c2af5af18890fa927d171f1ff58530a1a810.zip
New preference to allow the displaying of vertical grid lines in table views.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m25
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 0169a86e..6cd9284a 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -63,28 +63,38 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
- (id)init
{
if ((self = [super init])) {
+
_encoding = [@"utf8" retain];
chooseDatabaseButton = nil;
chooseDatabaseToolbarItem = nil;
+
+ printWebView = [[WebView alloc] init];
+ [printWebView setFrameLoadDelegate:self];
+
+ prefs = [NSUserDefaults standardUserDefaults];
}
- printWebView = [[WebView alloc] init];
- [printWebView setFrameLoadDelegate:self];
+
return self;
}
- (void)awakeFromNib
{
- // register selection did change handler for favorites controller (used in connect sheet)
+ // Register selection did change handler for favorites controller (used in connect sheet)
[favoritesController addObserver:self forKeyPath:@"selectionIndex" options:NSKeyValueChangeInsertion context:TableDocumentFavoritesControllerSelectionIndexDidChange];
- // register double click for the favorites view (double click favorite to connect)
+ // Register observers for when the DisplayTableViewVerticalGridlines preference changes
+ [prefs addObserver:tableSourceInstance forKeyPath:@"DisplayTableViewVerticalGridlines" options:NSKeyValueObservingOptionNew context:NULL];
+ [prefs addObserver:tableContentInstance forKeyPath:@"DisplayTableViewVerticalGridlines" options:NSKeyValueObservingOptionNew context:NULL];
+ [prefs addObserver:customQueryInstance forKeyPath:@"DisplayTableViewVerticalGridlines" options:NSKeyValueObservingOptionNew context:NULL];
+
+ // Register double click for the favorites view (double click favorite to connect)
[connectFavoritesTableView setTarget:self];
[connectFavoritesTableView setDoubleAction:@selector(connect:)];
- // find the Database -> Database Encoding menu (it's not in our nib, so we can't use interface builder)
+ // Find the Database -> Database Encoding menu (it's not in our nib, so we can't use interface builder)
selectEncodingMenu = [[[[[NSApp mainMenu] itemWithTag:1] submenu] itemWithTag:1] submenu];
- // hide the tabs in the tab view (we only show them to allow switching tabs in interface builder)
+ // Hide the tabs in the tab view (we only show them to allow switching tabs in interface builder)
[tableTabView setTabViewType:NSNoTabsNoBorder];
}
@@ -1927,8 +1937,6 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
NSEnumerator *theCols = [[variablesTableView tableColumns] objectEnumerator];
NSTableColumn *theCol;
- prefs = [[NSUserDefaults standardUserDefaults] retain];
-
//register for notifications
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willPerformQuery:)
name:@"SMySQLQueryWillBePerformed" object:nil];
@@ -2130,7 +2138,6 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[variables release];
[selectedDatabase release];
[mySQLVersion release];
- [prefs release];
[super dealloc];
}