From 2328cfd33463381741f29b196e867fc87676b799 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 16 Jun 2009 16:59:13 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed:=20"Duplicate=20field"=20will=20be=20?= =?UTF-8?q?disabled=20explicitly=20if=20selected=20table=20is=20not=20a=20?= =?UTF-8?q?BASE=20TABLE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableSource.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/TableSource.m b/Source/TableSource.m index 91037469..0e57234b 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -223,8 +223,11 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab // Enable 'Duplicate field' if at least one field is specified // if no field is selected 'Duplicate field' will copy the last field - if([tableSourceView numberOfRows] > 0) - [copyFieldButton setEnabled:YES]; + // Enable 'Duplicate field' only for tables! + if([tablesListInstance tableType] == SP_TABLETYPE_TABLE) + [copyFieldButton setEnabled:([tableSourceView numberOfRows] > 0)]; + else + [copyFieldButton setEnabled:NO]; //query finished [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; @@ -1104,10 +1107,9 @@ would result in a position change. // and change button state accordingly if ([tableSourceView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SP_TABLETYPE_TABLE) { [removeFieldButton setEnabled:YES]; - // [copyFieldButton setEnabled:YES]; } else { [removeFieldButton setEnabled:NO]; - // [copyFieldButton setEnabled:YES]; + [copyFieldButton setEnabled:NO]; } } else if ([aNotification object] == indexView) { -- cgit v1.2.3