diff options
author | Max <post@wickenrode.com> | 2014-10-12 22:41:36 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-10-12 22:41:36 +0200 |
commit | 0e4ad8eb9cddbbd755d55bb50f7707f1e8160121 (patch) | |
tree | 72c584ec63ee53895ffa99bc35240fa92d8f0b8c /Source/SPDatabaseDocument.m | |
parent | f9ed97815c219939e7bc05eb92da62f508210a18 (diff) | |
download | sequelpro-0e4ad8eb9cddbbd755d55bb50f7707f1e8160121.tar.gz sequelpro-0e4ad8eb9cddbbd755d55bb50f7707f1e8160121.tar.bz2 sequelpro-0e4ad8eb9cddbbd755d55bb50f7707f1e8160121.zip |
Add a "Go to Database" dialog
The dialog enables
* searching for a database by name (substring matching),
* using C&P to select databases
* navigating to databases not in the database dropdown
* faster keyboard-based navigation
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 330716c3..9a736f90 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -109,6 +109,7 @@ enum { #endif #import "SPCharsetCollationHelper.h" +#import "SPGotoDatabaseController.h" #import <SPMySQL/SPMySQL.h> @@ -206,6 +207,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; mySQLVersion = nil; allDatabases = nil; allSystemDatabases = nil; + gotoDatabaseController = nil; #ifndef SP_CODA /* init ivars */ mainToolbar = nil; @@ -1131,6 +1133,22 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return [[SPNavigatorController sharedNavigatorController] allSchemaKeysForConnection:[self connectionID]]; } +- (IBAction)showGotoDatabase:(id)sender +{ + if(!gotoDatabaseController) { + gotoDatabaseController = [[SPGotoDatabaseController alloc] init]; + } + + NSMutableArray *dbList = [[NSMutableArray alloc] init]; + [dbList addObjectsFromArray:[self allSystemDatabaseNames]]; + [dbList addObjectsFromArray:[self allDatabaseNames]]; + [gotoDatabaseController setDatabaseList:[dbList autorelease]]; + + if([gotoDatabaseController runModal]) { + [self selectDatabase:[gotoDatabaseController selectedDatabase] item:nil]; + } +} + #ifndef SP_CODA /* console and navigator methods */ #pragma mark - @@ -6269,6 +6287,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [allDatabases release]; [allSystemDatabases release]; + [gotoDatabaseController release]; #ifndef SP_CODA /* dealloc ivars */ [undoManager release]; [printWebView release]; |