diff options
author | rowanbeentje <rowan@beent.je> | 2010-05-23 21:44:59 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-05-23 21:44:59 +0000 |
commit | c661b409eaa0e29d9e012b79e7a66574a554817a (patch) | |
tree | 49b310ded9a226a66aa53444c9ba112824854f68 /Source/SPExportController.m | |
parent | b66006f3755c6a57dfc60d4133bc4dc4da0fef56 (diff) | |
download | sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.gz sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.bz2 sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.zip |
Initial implementation of tabs:
- Addition of PSMTabBar framework
- Rework away from a document-based TableDocument
- Support tabs throughout the application
- Add menu items for creating tabs, and add support for dragging tabs to different windows
Diffstat (limited to 'Source/SPExportController.m')
-rw-r--r-- | Source/SPExportController.m | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m index dce7857b..559e8071 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -54,6 +54,7 @@ tables = [[NSMutableArray alloc] init]; operationQueue = [[NSOperationQueue alloc] init]; tableExportMapping = [NSMutableDictionary dictionary]; + nibObjectsToRelease = [[NSMutableArray alloc] init]; } return self; @@ -76,7 +77,16 @@ */ - (void)export { - if (!exportWindow) [NSBundle loadNibNamed:@"ExportDialog" owner:self]; + + // If the dialog hasn't been loaded yet, do so, retaining a reference to the top-level objects that need releasing. + if (!exportWindow) + { + NSArray *exportDialogTopLevelObjects = nil; + NSNib *nibLoader = [[NSNib alloc] initWithNibNamed:@"ExportDialog" bundle:[NSBundle mainBundle]]; + [nibLoader instantiateNibWithOwner:self topLevelObjects:&exportDialogTopLevelObjects]; + [nibObjectsToRelease addObjectsFromArray:exportDialogTopLevelObjects]; + [nibLoader release]; + } NSUInteger i; @@ -99,7 +109,7 @@ [exportPathField setStringValue:NSHomeDirectory()]; [NSApp beginSheet:exportWindow - modalForWindow:tableWindow + modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; @@ -277,6 +287,8 @@ { [tables release], tables = nil; [operationQueue release], operationQueue = nil; + for (id retainedObject in nibObjectsToRelease) [retainedObject release]; + [nibObjectsToRelease release], nibObjectsToRelease = nil; [super dealloc]; } @@ -364,7 +376,7 @@ // Open the progress sheet [NSApp beginSheet:exportProgressWindow - modalForWindow:tableWindow + modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:nil contextInfo:nil]; |