From 2cd8213451d16c37c465a30cc5bd9bdc90b4ee31 Mon Sep 17 00:00:00 2001 From: drx777 Date: Thu, 29 Apr 2010 19:51:43 +0000 Subject: Changed appearance of copy/rename DB to match that of copyTable. Added the to be copied/renamed database name to the name input sheet. Added necessary outlets. Added the current db name as preset value in the rename input field. Renamed databaseNewSheet to databaseCopySheet and copyOnlyStructureButton to copyDatabaseDataButton and inverted behaviour of the button. --- Source/TableDocument.h | 13 +++++++++---- Source/TableDocument.m | 8 +++++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'Source') diff --git a/Source/TableDocument.h b/Source/TableDocument.h index 8eb6cb4b..b3cbb6e7 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -65,7 +65,7 @@ IBOutlet id titleStringView; IBOutlet id databaseSheet; - IBOutlet id databaseNewSheet; + IBOutlet id databaseCopySheet; IBOutlet id databaseRenameSheet; IBOutlet id queryProgressBar; @@ -77,13 +77,18 @@ IBOutlet id favoritesButton; IBOutlet id databaseNameField; - IBOutlet id databaseCopyNameField; - IBOutlet id databaseRenameNameField; IBOutlet id databaseEncodingButton; - IBOutlet id copyOnlyStructureButton; IBOutlet id addDatabaseButton; + + IBOutlet id databaseCopyNameField; + IBOutlet id copyDatabaseDataButton; + IBOutlet id copyDatabaseMessageField; IBOutlet id copyDatabaseButton; + + IBOutlet id databaseRenameNameField; + IBOutlet id renameDatabaseMessageField; IBOutlet id renameDatabaseButton; + IBOutlet id chooseDatabaseButton; IBOutlet id historyControl; IBOutlet NSTabView *tableTabView; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 49f30030..a5dc87b4 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -940,8 +940,9 @@ if (![tablesListInstance selectionShouldChangeInTableView:nil]) return; [databaseCopyNameField setStringValue:@""]; + [copyDatabaseMessageField setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Duplicate database '%@' to:", @"duplicate database message"), selectedDatabase]]; - [NSApp beginSheet:databaseNewSheet + [NSApp beginSheet:databaseCopySheet modalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) @@ -955,7 +956,8 @@ { if (![tablesListInstance selectionShouldChangeInTableView:nil]) return; - [databaseRenameNameField setStringValue:@""]; + [databaseRenameNameField setStringValue:selectedDatabase]; + [renameDatabaseMessageField setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Rename database '%@' to:", @"rename database message"), selectedDatabase]]; [NSApp beginSheet:databaseRenameSheet modalForWindow:tableWindow @@ -4158,7 +4160,7 @@ [dbActionCopy setConnection: [self getConnection]]; [dbActionCopy setMessageWindow: tableWindow]; - BOOL copyWithContent = [copyOnlyStructureButton state] == NSOffState; + BOOL copyWithContent = [copyDatabaseDataButton state] == NSOnState; if ([dbActionCopy copyDatabaseFrom: [self database] to: [databaseCopyNameField stringValue] -- cgit v1.2.3