aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m14
1 files changed, 14 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