aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authormltownsend <mltownsend@gmail.com>2010-05-28 21:17:32 +0000
committermltownsend <mltownsend@gmail.com>2010-05-28 21:17:32 +0000
commit8c545d7dfd8bea5f1776395826297ae2c6cb1433 (patch)
tree6a4a86d76b84377f70036735ac0347eda7ff242e /Source
parent8e16c198062a4e03b1a28718be8416c597e8fcf7 (diff)
downloadsequelpro-8c545d7dfd8bea5f1776395826297ae2c6cb1433.tar.gz
sequelpro-8c545d7dfd8bea5f1776395826297ae2c6cb1433.tar.bz2
sequelpro-8c545d7dfd8bea5f1776395826297ae2c6cb1433.zip
Changed the SPUserManager instance to an allocated instance when the SPUserManager is selected. SPUserManager is released when the user his cancel or apply. This forces the UI to refresh itself.
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.h2
-rw-r--r--Source/SPDatabaseDocument.m15
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
*/