aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-26 13:26:00 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-26 13:26:00 +0000
commitde6f4edd315c319bd7fbc37907176d665aa454dc (patch)
treed7429639276d7204dc2a42534b2f6e4a7bb28475
parent610b3c590dc35bc8e1ea3ef17aa59ba72e8e3d55 (diff)
downloadsequelpro-de6f4edd315c319bd7fbc37907176d665aa454dc.tar.gz
sequelpro-de6f4edd315c319bd7fbc37907176d665aa454dc.tar.bz2
sequelpro-de6f4edd315c319bd7fbc37907176d665aa454dc.zip
• added key-binding for RETURN to "Duplicate" button in the "duplicate table sheet" via delegate method controlTextDidEndEditing:
• improved controlTextDidEndEditing: to recognize only the RETURN/ENTER key
-rw-r--r--Source/TablesList.m13
1 files changed, 12 insertions, 1 deletions
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