aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
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];
}