diff options
author | rowanbeentje <rowan@beent.je> | 2011-04-10 15:35:43 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2011-04-10 15:35:43 +0000 |
commit | 0930c6b49fa7988cb14bdd5fe81c71d5d27f1936 (patch) | |
tree | 53815f39cfd69070e908c148f9f48b76ff512645 /Source/SPTablesList.m | |
parent | 15d0b8bac7736e249e121492ea119e43b61d6bca (diff) | |
download | sequelpro-0930c6b49fa7988cb14bdd5fe81c71d5d27f1936.tar.gz sequelpro-0930c6b49fa7988cb14bdd5fe81c71d5d27f1936.tar.bz2 sequelpro-0930c6b49fa7988cb14bdd5fe81c71d5d27f1936.zip |
- Add support in SPTableView to disable edit-on-tab behaviour
- Use this new support in SPTablesList to prevent the tab key entering rename mode when focus is on the table list - this addresses Issue #1028
Diffstat (limited to 'Source/SPTablesList.m')
-rw-r--r-- | Source/SPTablesList.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 9c1a1d0c..67ab3069 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -31,6 +31,7 @@ #import "SPTableData.h" #import "SPTableInfo.h" #import "SPDataImport.h" +#import "SPTableView.h" #import "ImageAndTextCell.h" #import "RegexKitLite.h" #import "SPDatabaseData.h" @@ -1428,15 +1429,16 @@ */ - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command { + + // When enter/return is used, save the row. if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(insertNewline:)] ) { - //save current line [[control window] makeFirstResponder:control]; return TRUE; + // When the escape key is used, abort the rename. } else if ( [[control window] methodForSelector:command] == [[control window] methodForSelector:@selector(cancelOperation:)] || [textView methodForSelector:command] == [textView methodForSelector:@selector(complete:)] ) { - //abort editing [control abortEditing]; [[NSApp mainWindow] makeFirstResponder:tablesListView]; @@ -1903,6 +1905,9 @@ [tableListFilterSplitView setCollapsibleSubviewCollapsed:YES]; } + // Disable tab edit behaviour in the tables list + [tablesListView setTabEditingDisabled:YES]; + // Add observers for document task activity [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startDocumentTaskForTab:) |