diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-24 12:31:16 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-24 12:31:16 +0000 |
commit | 47f354070f1fa8dfeb46c4065075ee53de4c1626 (patch) | |
tree | f3fd6c947d3966baa4cf59d08b8ca02f0a756256 /Source/SPNavigatorOutlineView.m | |
parent | 1ddc896d2f88bea86e4b0457d63f7a53b846851d (diff) | |
download | sequelpro-47f354070f1fa8dfeb46c4065075ee53de4c1626.tar.gz sequelpro-47f354070f1fa8dfeb46c4065075ee53de4c1626.tar.bz2 sequelpro-47f354070f1fa8dfeb46c4065075ee53de4c1626.zip |
• Navigator
- ENTER and RETURN selects schema path in active connection window
- outsourced some stuff to SPNavigatorOutlineView
• added rotating sync arrows to project for future usage
Diffstat (limited to 'Source/SPNavigatorOutlineView.m')
-rw-r--r-- | Source/SPNavigatorOutlineView.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/SPNavigatorOutlineView.m b/Source/SPNavigatorOutlineView.m index 26a37198..ee41620f 100644 --- a/Source/SPNavigatorOutlineView.m +++ b/Source/SPNavigatorOutlineView.m @@ -24,6 +24,7 @@ // More info at <http://code.google.com/p/sequel-pro/> #import "SPNavigatorOutlineView.h" +#import "SPNavigatorController.h" @implementation SPNavigatorOutlineView @@ -35,10 +36,25 @@ - (void)keyDown:(NSEvent *)theEvent { + // Enter or Return selects in active document the chosen item if ([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { - ; + [[self delegate] selectInActiveDocumentItem:[self itemAtRow:[self selectedRow]] fromView:self]; + return; } + [super keyDown:theEvent]; } +/* + * Return the data source item of the selected row, if no or multiple selections + * return nil + */ +- (id)selectedItem +{ + if([self numberOfSelectedRows] == 1) + return [self itemAtRow:[self selectedRow]]; + + return nil; +} + @end |