From 1bf7220ca576a3c09b9d9e53e24e0c6f30f15850 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sat, 10 Apr 2010 18:16:25 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20"Import=20from=20Clipboard"=20?= =?UTF-8?q?=E2=8C=A5=E2=87=A7=E2=8C=98I=20-=20sheet=20showing=20the=20firs?= =?UTF-8?q?t=204kB=20of=20pasteboard=20content=20and=20the=20SQL/CSV=20acc?= =?UTF-8?q?essory=20view=20-=20pasteboard=20content=20will=20be=20saved=20?= =?UTF-8?q?as=20temp=20file=20and=20read=20by=20using=20the=20current=20ta?= =?UTF-8?q?ble/connection=20encoding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableDocument.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Source/TableDocument.m') diff --git a/Source/TableDocument.m b/Source/TableDocument.m index ab8a7ac5..3e442d6e 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1684,7 +1684,7 @@ } [createTableSyntaxTextField setStringValue:[NSString stringWithFormat:@"Create syntax for %@ '%@'", typeString, [self table]]]; - + [createTableSyntaxTextView setEditable:YES]; [createTableSyntaxTextView setString:@""]; [createTableSyntaxTextView insertText:([tablesListInstance tableType] == SPTableTypeView) ? [[tableSyntax createViewSyntaxPrettifier] stringByAppendingString:@";"] : [tableSyntax stringByAppendingString:@";"]]; @@ -3022,6 +3022,14 @@ [tableDumpInstance importFile]; } +/** + * Passes the request to the tableDump object + */ +- (IBAction)importFromClipboard:(id)sender +{ + [tableDumpInstance importFromClipboard]; +} + /** * Passes the request to the tableDump object */ @@ -3086,7 +3094,13 @@ { return ([self database] != nil); } - + + if ([menuItem action] == @selector(importFromClipboard:)) + { + return ([[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:NSStringPboardType, nil]]) ? YES : NO; + + } + // Change "Save Query/Queries" menu item title dynamically // and disable it if no query in the editor if ([menuItem action] == @selector(saveConnectionSheet:) && [menuItem tag] == 0) { -- cgit v1.2.3