diff options
-rw-r--r-- | Interfaces/English.lproj/DBView.xib | 1 | ||||
-rw-r--r-- | Source/SPDataImport.h | 47 | ||||
-rw-r--r-- | Source/SPDataImport.m | 60 |
3 files changed, 56 insertions, 52 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 031b67f0..0ea23312 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -4636,7 +4636,6 @@ Gw <outlet property="singleProgressSheet" destination="6125" id="6139"/> <outlet property="singleProgressText" destination="6130" id="6140"/> <outlet property="singleProgressTitle" destination="6132" id="6238"/> - <outlet property="tableContentInstance" destination="67" id="1025"/> <outlet property="tableDataInstance" destination="4702" id="4713"/> <outlet property="tableDocumentInstance" destination="-2" id="534"/> <outlet property="tableSourceInstance" destination="69" id="1172"/> diff --git a/Source/SPDataImport.h b/Source/SPDataImport.h index 545e02ff..ca1cd7dc 100644 --- a/Source/SPDataImport.h +++ b/Source/SPDataImport.h @@ -30,6 +30,13 @@ // More info at <https://github.com/sequelpro/sequelpro> @class SPMySQLConnection; +@class SPFieldMapperController; +@class SPFileHandle; +@class SPDatabaseDocument; +@class SPCustomQuery; +@class SPTableData; +@class SPTableStructure; +@class SPTablesList; typedef enum { SPFieldMapperInProgress = 1, @@ -37,16 +44,14 @@ typedef enum { SPFieldMapperCancelled = 3 } SPFieldMapperSheetStatus; -@class SPFieldMapperController, SPFileHandle; - @interface SPDataImport : NSObject <NSOpenSavePanelDelegate> { - IBOutlet id tableDocumentInstance; - IBOutlet id tablesListInstance; - IBOutlet id tableSourceInstance; - IBOutlet id tableContentInstance; - IBOutlet id tableDataInstance; - IBOutlet id customQueryInstance; +#warning Outlets belong to multiple xib files! + IBOutlet SPDatabaseDocument *tableDocumentInstance; + IBOutlet SPTablesList *tablesListInstance; + IBOutlet SPTableStructure *tableSourceInstance; + IBOutlet SPTableData *tableDataInstance; + IBOutlet SPCustomQuery *customQueryInstance; IBOutlet id importView; IBOutlet id importTabView; @@ -55,7 +60,6 @@ typedef enum { IBOutlet id importFieldsEnclosedField; IBOutlet id importFieldsEscapedField; IBOutlet id importLinesTerminatedField; - IBOutlet id importFieldMapperSheetWindow; IBOutlet NSPopUpButton *importFormatPopup; IBOutlet NSPopUpButton *importEncodingPopup; @@ -67,21 +71,13 @@ typedef enum { IBOutlet NSTextView *importFromClipboardTextView; - IBOutlet id addDropTableSwitch; - IBOutlet id addCreateTableSwitch; - IBOutlet id addTableContentSwitch; - IBOutlet id addErrorsSwitch; - IBOutlet id sqlFullStreamingSwitch; - IBOutlet id sqlCompressionSwitch; - IBOutlet id csvFullStreamingSwitch; - IBOutlet id multiCSVFullStreamingSwitch; - IBOutlet id multiXMLFullStreamingSwitch; - IBOutlet id errorsSheet; - IBOutlet id errorsView; - IBOutlet id singleProgressSheet; - IBOutlet id singleProgressBar; - IBOutlet id singleProgressTitle; - IBOutlet id singleProgressText; + IBOutlet NSWindow *errorsSheet; + IBOutlet NSTextView *errorsView; + + IBOutlet NSPanel *singleProgressSheet; + IBOutlet NSProgressIndicator *singleProgressBar; + IBOutlet NSTextField *singleProgressTitle; + IBOutlet NSTextField *singleProgressText; SPMySQLConnection *mySQLConnection; @@ -108,7 +104,6 @@ typedef enum { BOOL importMethodIsUpdate; BOOL importIntoNewTable; - NSUInteger exportMode; NSUserDefaults *prefs; BOOL progressCancelled; BOOL _mainNibLoaded; @@ -119,8 +114,6 @@ typedef enum { NSMutableIndexSet *bitFieldsMapIndex; NSMutableArray *nullableNumericFields; NSMutableIndexSet *nullableNumericFieldsMapIndex; - - NSSavePanel *currentExportPanel; } // IBAction methods diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 17e083f1..f6b865e7 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -210,9 +210,9 @@ [NSApp beginSheet:importFromClipboardSheet modalForWindow:[tableDocumentInstance parentWindow] - modalDelegate:self + modalDelegate:self didEndSelector:@selector(importFromClipboardSheetDidEnd:returnCode:contextInfo:) - contextInfo:nil]; + contextInfo:nil]; } /** @@ -407,7 +407,11 @@ [singleProgressBar startAnimation:self]; // Open the progress sheet - [NSApp beginSheet:singleProgressSheet modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:nil contextInfo:nil]; + [NSApp beginSheet:singleProgressSheet + modalForWindow:[tableDocumentInstance parentWindow] + modalDelegate:nil + didEndSelector:NULL + contextInfo:NULL]; [singleProgressSheet makeKeyWindow]; }); @@ -695,12 +699,12 @@ // Re-query the structure of all databases in the background [[tableDocumentInstance databaseStructureRetrieval] queryDbStructureInBackgroundWithUserInfo:@{@"forceUpdate" : @YES}]; - - // Import finished Growl notification - [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished" - description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@",@"description for finished importing growl notification"), [filename lastPathComponent]] - document:tableDocumentInstance - notificationName:@"Import Finished"]; + + // Import finished Growl notification + [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished" + description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@", @"description for finished importing growl notification"), [filename lastPathComponent]] + document:tableDocumentInstance + notificationName:@"Import Finished"]; } #pragma mark - @@ -791,7 +795,11 @@ [singleProgressBar startAnimation:self]; // Open the progress sheet - [NSApp beginSheet:singleProgressSheet modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:nil contextInfo:nil]; + [NSApp beginSheet:singleProgressSheet + modalForWindow:[tableDocumentInstance parentWindow] + modalDelegate:nil + didEndSelector:NULL + contextInfo:NULL]; [singleProgressSheet makeKeyWindow]; }); @@ -973,7 +981,11 @@ [singleProgressBar setMaxValue:fileTotalLength]; [singleProgressBar setIndeterminate:NO]; [singleProgressBar startAnimation:self]; - [NSApp beginSheet:singleProgressSheet modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; + [NSApp beginSheet:singleProgressSheet + modalForWindow:[tableDocumentInstance parentWindow] + modalDelegate:nil + didEndSelector:NULL + contextInfo:NULL]; [singleProgressSheet makeKeyWindow]; }); @@ -1210,10 +1222,10 @@ } // Import finished Growl notification - [[SPGrowlController sharedGrowlController] notifyWithTitle:NSLocalizedString(@"Import Finished" , @"title for finished importing growl notification") - description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@",@"description for finished importing growl notification"), [filename lastPathComponent]] - document:tableDocumentInstance - notificationName:@"Import Finished"]; + [[SPGrowlController sharedGrowlController] notifyWithTitle:NSLocalizedString(@"Import Finished", @"title for finished importing growl notification") + description:[NSString stringWithFormat:NSLocalizedString(@"Finished importing %@", @"description for finished importing growl notification"), [filename lastPathComponent]] + document:tableDocumentInstance + notificationName:@"Import Finished"]; SPMainQSync(^{ if(importIntoNewTable) { @@ -1294,10 +1306,10 @@ // Show field mapper sheet and set the focus to it [NSApp beginSheet:[fieldMapperController window] - modalForWindow:[tableDocumentInstance parentWindow] - modalDelegate:self - didEndSelector:@selector(fieldMapperDidEndSheet:returnCode:contextInfo:) - contextInfo:nil]; + modalForWindow:[tableDocumentInstance parentWindow] + modalDelegate:self + didEndSelector:@selector(fieldMapperDidEndSheet:returnCode:contextInfo:) + contextInfo:NULL]; [[fieldMapperController window] makeKeyWindow]; }); @@ -1719,11 +1731,11 @@ cleanup: } [errorsView setString:message]; - [NSApp beginSheet:errorsSheet - modalForWindow:[tableDocumentInstance parentWindow] - modalDelegate:self - didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) - contextInfo:nil]; + [NSApp beginSheet:errorsSheet + modalForWindow:[tableDocumentInstance parentWindow] + modalDelegate:self + didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; [errorsSheet makeKeyWindow]; } |