diff options
author | drx777 <david.rekowski@gmx.de> | 2010-04-29 18:26:19 +0000 |
---|---|---|
committer | drx777 <david.rekowski@gmx.de> | 2010-04-29 18:26:19 +0000 |
commit | e2810ccbe30371974a7df888dc5656ac9311677f (patch) | |
tree | 55e4f24a71ed0862620f3a75f9efcf001d257c89 | |
parent | 47d42106c45d7663c05aaf6d3f0feab71798b51c (diff) | |
download | sequelpro-e2810ccbe30371974a7df888dc5656ac9311677f.tar.gz sequelpro-e2810ccbe30371974a7df888dc5656ac9311677f.tar.bz2 sequelpro-e2810ccbe30371974a7df888dc5656ac9311677f.zip |
Now longer using [NSApp mainWindow] but a reference to the correct window for message sheets. It could have caused messages appearing in the wrong window.
-rw-r--r-- | Source/SPDBActionCommons.h | 12 | ||||
-rw-r--r-- | Source/SPDBActionCommons.m | 3 | ||||
-rw-r--r-- | Source/SPDatabaseCopy.m | 4 | ||||
-rw-r--r-- | Source/SPDatabaseInfo.m | 2 | ||||
-rw-r--r-- | Source/SPDatabaseRename.m | 4 | ||||
-rw-r--r-- | Source/SPTableCopy.m | 2 | ||||
-rw-r--r-- | Source/TableDocument.m | 4 |
7 files changed, 12 insertions, 19 deletions
diff --git a/Source/SPDBActionCommons.h b/Source/SPDBActionCommons.h index 042fd5dc..334b0c78 100644 --- a/Source/SPDBActionCommons.h +++ b/Source/SPDBActionCommons.h @@ -32,8 +32,7 @@ @interface SPDBActionCommons : NSObject { MCPConnection *connection; - NSObject *parent; - NSDocument *messageDocument; + NSWindow *messageWindow; } /** @@ -42,13 +41,8 @@ @property (retain) MCPConnection *connection; /** - * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages + * @property the NSWindow instance to send message sheets to */ -@property (retain) NSObject *parent; - -/** - * @property the NSDocument instance to send message sheets to - */ -@property (retain) NSDocument *messageDocument; +@property (assign) NSWindow *messageWindow; @end diff --git a/Source/SPDBActionCommons.m b/Source/SPDBActionCommons.m index c0580622..977b3b5d 100644 --- a/Source/SPDBActionCommons.m +++ b/Source/SPDBActionCommons.m @@ -30,7 +30,6 @@ @implementation SPDBActionCommons @synthesize connection; -@synthesize parent; -@synthesize messageDocument; +@synthesize messageWindow; @end diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m index e5daae0c..6fc52ae8 100644 --- a/Source/SPDatabaseCopy.m +++ b/Source/SPDatabaseCopy.m @@ -36,13 +36,13 @@ } else { dbInfo = [[SPDatabaseInfo alloc] init]; [dbInfo setConnection:[self connection]]; - [dbInfo setParent:[self parent]]; + [dbInfo setMessageWindow:messageWindow]; } return dbInfo; } - (NSObject *)getTableWindow { - return [NSApp mainWindow]; + return messageWindow; } - (BOOL)copyDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName withContent:(BOOL)copyWithContent { diff --git a/Source/SPDatabaseInfo.m b/Source/SPDatabaseInfo.m index 9dbf2098..6c5b3f66 100644 --- a/Source/SPDatabaseInfo.m +++ b/Source/SPDatabaseInfo.m @@ -28,7 +28,7 @@ @implementation SPDatabaseInfo - (NSObject *)getTableWindow { - return [NSApp mainWindow]; + return messageWindow; } -(BOOL)databaseExists:(NSString *)databaseName { diff --git a/Source/SPDatabaseRename.m b/Source/SPDatabaseRename.m index 75478412..aa3a401a 100644 --- a/Source/SPDatabaseRename.m +++ b/Source/SPDatabaseRename.m @@ -37,13 +37,13 @@ } else { dbInfo = [[SPDatabaseInfo alloc] init]; [dbInfo setConnection:[self connection]]; - [dbInfo setParent:[self parent]]; + [dbInfo setMessageWindow:messageWindow]; } return dbInfo; } - (NSObject *)getTableWindow { - return [NSApp mainWindow]; + return messageWindow; } - (BOOL)renameDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName { diff --git a/Source/SPTableCopy.m b/Source/SPTableCopy.m index 6a73bb20..19bff7c2 100644 --- a/Source/SPTableCopy.m +++ b/Source/SPTableCopy.m @@ -28,7 +28,7 @@ @implementation SPTableCopy - (NSObject *)getTableWindow { - return [NSApp mainWindow]; + return messageWindow; } - (NSString *)getCreateTableStatementFor: (NSString *)tableName inDB: (NSString *)sourceDB { diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 724afca6..7b5c3d2f 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -4146,7 +4146,7 @@ } SPDatabaseCopy *dbActionCopy = [[SPDatabaseCopy alloc] init]; [dbActionCopy setConnection: [self getConnection]]; - [dbActionCopy setParent: self]; + [dbActionCopy setMessageWindow: tableWindow]; BOOL copyWithContent = [copyOnlyStructureButton state] == NSOffState; @@ -4166,7 +4166,7 @@ } SPDatabaseRename *dbActionRename = [[SPDatabaseRename alloc] init]; [dbActionRename setConnection: [self getConnection]]; - [dbActionRename setParent: self]; + [dbActionRename setMessageWindow: tableWindow]; [dbActionRename renameDatabaseFrom: [self database] to: [databaseRenameNameField stringValue]]; |