From de6f4edd315c319bd7fbc37907176d665aa454dc Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 26 May 2009 13:26:00 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20key-binding=20for=20RETURN=20to=20"?= =?UTF-8?q?Duplicate"=20button=20in=20the=20"duplicate=20table=20sheet"=20?= =?UTF-8?q?via=20delegate=20method=20controlTextDidEndEditing:=20=E2=80=A2?= =?UTF-8?q?=20improved=20controlTextDidEndEditing:=20to=20recognize=20only?= =?UTF-8?q?=20the=20RETURN/ENTER=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TablesList.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/TablesList.m b/Source/TablesList.m index 2866bd3c..0029aac1 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -807,16 +807,27 @@ } } +/* + * Controls the NSTextField's press RETURN event of Add/Rename/Duplicate sheets + */ - (void)controlTextDidEndEditing:(NSNotification *)notification { id object = [notification object]; + // Only RETURN/ENTER will be recognized for Add/Rename/Duplicate sheets to + // activate the Add/Rename/Duplicate buttons + if([[[notification userInfo] objectForKey:@"NSTextMovement"] intValue] != 0) + return; + if (object == tableRenameField) { [renameTableButton performClick:object]; } - if (object == tableNameField) { + else if (object == tableNameField) { [addTableButton performClick:object]; } + else if (object == copyTableNameField) { + [copyTableButton performClick:object]; + } } #pragma mark Getter methods -- cgit v1.2.3