diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseDocument.h | 2 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index ae92ec84..315b231c 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -54,7 +54,7 @@ IBOutlet id statusTableView; IBOutlet id statusTableCopyChecksum; - IBOutlet SPUserManager *userManagerInstance; + SPUserManager *userManagerInstance; IBOutlet NSSearchField *listFilterField; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 2120a85d..92f83a79 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -669,7 +669,7 @@ [tableDataInstance setConnection:mySQLConnection]; [extendedTableInfoInstance setConnection:mySQLConnection]; [databaseDataInstance setConnection:mySQLConnection]; - userManagerInstance.mySqlConnection = mySQLConnection; +// userManagerInstance.mySqlConnection = mySQLConnection; // Set the cutom query editor's MySQL version [customQueryInstance setMySQLversion:mySQLVersion]; @@ -2327,6 +2327,12 @@ */ - (IBAction)showUserManager:(id)sender { + if (!userManagerInstance) + { + userManagerInstance = [[SPUserManager alloc] init]; + userManagerInstance.mySqlConnection = mySQLConnection; + } + // Before displaying the user manager make sure the current user has access to the mysql.user table. MCPResult *result = [mySQLConnection queryString:@"SELECT * FROM `mysql`.`user` ORDER BY `user`"]; @@ -2347,11 +2353,16 @@ [NSApp beginSheet:[userManagerInstance window] modalForWindow:parentWindow - modalDelegate:userManagerInstance + modalDelegate:self didEndSelector:@selector(userManagerSheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; } +- (void)userManagerSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void*)context +{ + [userManagerInstance release], userManagerInstance = nil; +} + /** * Passes query to tablesListInstance */ |