aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m19
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];