aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-14 15:07:25 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-14 15:07:25 +0000
commit0eb001d5b887776b827d503568921f6230bf862a (patch)
tree5836b41c3fcb7506f21769eaf59000d98bd3661e /Source
parent080b6b90f0021d6f58090cc19f268f8f0df86351 (diff)
downloadsequelpro-0eb001d5b887776b827d503568921f6230bf862a.tar.gz
sequelpro-0eb001d5b887776b827d503568921f6230bf862a.tar.bz2
sequelpro-0eb001d5b887776b827d503568921f6230bf862a.zip
• added AppleScript support for "make new document"
• fixed validation of the main menu item "Print" - only enabled if one table is selected (otherwise it throws an exception)
Diffstat (limited to 'Source')
-rw-r--r--Source/SPAppController.m10
-rw-r--r--Source/TableDocument.m4
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index 15e36fc4..43d7b8c5 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -546,6 +546,16 @@
return [[NSDocumentController sharedDocumentController] documents];
}
+/* Support for "make new document"
+*/
+- (void)insertInOrderedDocuments:(TableDocument *)doc {
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"AutoConnectToDefault"])
+ [doc setShouldAutomaticallyConnect:YES];
+ [[NSDocumentController sharedDocumentController] addDocument:doc];
+ [doc makeWindowControllers];
+ [doc showWindows];
+}
+
/*
* AppleScript calls that method to get the available windows
*/
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index f465628c..427e73fd 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -2674,6 +2674,10 @@
return ([self database] != nil && [self table] != nil);
}
+ if ([menuItem action] == @selector(printDocument:)) {
+ return ([self database] != nil && [[tablesListInstance valueForKeyPath:@"tablesListView"] numberOfSelectedRows] == 1);
+ }
+
if ([menuItem action] == @selector(chooseEncoding:)) {
return [self supportsEncoding];
}