diff options
author | stuconnolly <stuart02@gmail.com> | 2009-11-01 01:26:24 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-11-01 01:26:24 +0000 |
commit | 99ddc3164f3e7da15bf65e663a939e9d7009fcd4 (patch) | |
tree | 4c4629096e8b41a7199a82991528aaf753d816e8 | |
parent | a291267ca72e112a33693e72c5a269d104ebd900 (diff) | |
download | sequelpro-99ddc3164f3e7da15bf65e663a939e9d7009fcd4.tar.gz sequelpro-99ddc3164f3e7da15bf65e663a939e9d7009fcd4.tar.bz2 sequelpro-99ddc3164f3e7da15bf65e663a939e9d7009fcd4.zip |
Enable the display of vertical grid lines in the table relations table view.
-rw-r--r-- | Source/SPTableRelations.m | 14 | ||||
-rw-r--r-- | Source/TableDocument.m | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 5c51fcbc..92eebfaf 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -28,6 +28,7 @@ #import "TablesList.h" #import "SPTableData.h" #import "SPStringAdditions.h" +#import "SPConstants.h" @interface SPTableRelations (PrivateAPI) @@ -57,6 +58,9 @@ */ - (void)awakeFromNib { + // Set the table relation view's vertical gridlines if required + [relationsTableView setGridStyleMask:([[NSUserDefaults standardUserDefaults] boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tableSelectionChanged:) name:NSTableViewSelectionDidChangeNotification @@ -311,6 +315,16 @@ } /** + * This method is called as part of Key Value Observing which is used to watch for prefernce changes which effect the interface. + */ +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:SPDisplayTableViewVerticalGridlines]) { + [relationsTableView setGridStyleMask:([[change objectForKey:NSKeyValueChangeNewKey] boolValue]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone]; + } +} + +/** * Menu validation */ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 6cbccd60..83b68bd4 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -165,6 +165,7 @@ [prefs addObserver:tableSourceInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL]; [prefs addObserver:tableContentInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL]; [prefs addObserver:customQueryInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL]; + [prefs addObserver:tableRelationsInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL]; // Register observers for when the logging preference changes [prefs addObserver:[SPQueryController sharedQueryController] forKeyPath:SPConsoleEnableLogging options:NSKeyValueObservingOptionNew context:NULL]; |