aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-07-02 01:08:20 +0000
committerstuconnolly <stuart02@gmail.com>2009-07-02 01:08:20 +0000
commit633b7969c21612273fb1b27a1ddefdcc628576e4 (patch)
tree6a0a5b298505a85230f938c9c239868f0fe48b00 /Source/SPTableRelations.m
parent33032bcebcf4254755db1b6d9b7cb51e806f2fc3 (diff)
downloadsequelpro-633b7969c21612273fb1b27a1ddefdcc628576e4.tar.gz
sequelpro-633b7969c21612273fb1b27a1ddefdcc628576e4.tar.bz2
sequelpro-633b7969c21612273fb1b27a1ddefdcc628576e4.zip
Add contextual menus to the table content and table relations views. Completes the implementation of issue #139 as all views now have contextual menus.
Diffstat (limited to 'Source/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index d3212a0e..a65de7ea 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -302,6 +302,21 @@
}
}
+/**
+ * Menu validation
+ */
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+ // Remove row
+ if ([menuItem action] == @selector(removeRelation:)) {
+ [menuItem setTitle:([relationsTableView numberOfSelectedRows] > 1) ? @"Delete Relations" : @"Delete Relation"];
+
+ return ([relationsTableView numberOfSelectedRows] > 0);
+ }
+
+ return [super validateMenuItem:menuItem];
+}
+
/*
* Dealloc.
*/