aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-10-01 15:23:33 +0000
committerstuconnolly <stuart02@gmail.com>2009-10-01 15:23:33 +0000
commitd766381344119184158738d2d5a23484a8a1b3a1 (patch)
treeb74e3e39419d4271ee56931e9a06a1799e9b4035 /Source/TableDocument.m
parent9f7b5dccfae711371970031b3e79f671213441d6 (diff)
downloadsequelpro-d766381344119184158738d2d5a23484a8a1b3a1.tar.gz
sequelpro-d766381344119184158738d2d5a23484a8a1b3a1.tar.bz2
sequelpro-d766381344119184158738d2d5a23484a8a1b3a1.zip
- Add copy create syntax button to the create syntax sheet.
- Fix the Growl notification prefs message as well as making the dialog a sheet. - Re-run genstrings to update localizable.strings and also remove use of multiple comments for a single string.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index c685c89b..be05b720 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1743,6 +1743,27 @@
[panel beginSheetForDirectory:nil file:@"CreateSyntax" modalForWindow:createTableSyntaxWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"CreateSyntax"];
}
+/**
+ * Copy the create syntax in the create syntax text view to the pasteboard.
+ */
+- (IBAction)copyCreateTableSyntaxFromSheet:(id)sender
+{
+ NSString *createSyntax = [createTableSyntaxTextView string];
+
+ if ([createSyntax length] > 0) {
+ // Copy to the clipboard
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+
+ [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
+ [pb setString:createSyntax forType:NSStringPboardType];
+
+ // Table syntax copied Growl notification
+ [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Syntax Copied"
+ description:[NSString stringWithFormat:NSLocalizedString(@"Syntax for %@ table copied", @"description for table syntax copied growl notification"), [self table]]
+ notificationName:@"Syntax Copied"];
+ }
+}
+
#pragma mark -
#pragma mark Other Methods