From 729acc2f2d4954130798ed382dca478eade14302 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 24 Oct 2010 11:30:12 +0000 Subject: - Split out all of SPExportController's delegate methods to their own category. - Prepare for the implementation of PDF and HTML export by hiding the export options box for export types that don't need it. - Fix some spacing issues on the export dialog. - Create a new SPCategoryAdditions header that is included in the apps precompiled header, making all additions available to all classes. - Update strings files. --- Interfaces/English.lproj/ExportDialog.xib | 295 ++++----------------- .../English.lproj/DataMigrationDialog.strings | Bin 19638 -> 21316 bytes Resources/English.lproj/ExportDialog.strings | Bin 23706 -> 23252 bytes Source/GeneratePreviewForURL.m | 1 - Source/NSNotificationAdditions.h | 10 +- Source/NSNotificationAdditions.m | 56 ++-- Source/NoodleLineNumberView.m | 1 - Source/SPAlertSheets.m | 2 - Source/SPArrayAdditions.m | 1 - Source/SPCSVExporter.m | 2 - Source/SPCSVExporterDelegate.m | 1 - Source/SPCSVParser.m | 1 - Source/SPCategoryAdditions.h | 43 +++ Source/SPCopyTable.m | 3 - Source/SPCustomQuery.m | 5 - Source/SPDataImport.m | 4 - Source/SPDatabaseData.m | 1 - Source/SPDatabaseDocument.m | 4 - Source/SPDotExporter.m | 1 - Source/SPDotExporterDelegate.m | 1 - Source/SPExportController.h | 6 - Source/SPExportController.m | 114 ++++---- Source/SPExportControllerDelegate.h | 37 +++ Source/SPExportControllerDelegate.m | 88 ++++++ Source/SPExportInitializer.m | 2 - Source/SPExtendedTableInfo.m | 1 - Source/SPFieldEditorController.m | 4 - Source/SPFieldMapperController.m | 3 - Source/SPGrowlController.m | 1 - Source/SPHistoryController.m | 2 - Source/SPNarrowDownCompletion.m | 2 - Source/SPNavigatorController.m | 2 +- Source/SPPreferenceController.m | 3 - Source/SPProcessListController.m | 1 - Source/SPQueryController.m | 1 - Source/SPSQLExporter.m | 2 - Source/SPSQLExporterDelegate.m | 1 - Source/SPSSHTunnel.m | 1 - Source/SPServerVariablesController.m | 1 - Source/SPTableContent.m | 6 - Source/SPTableData.m | 2 - Source/SPTableInfo.m | 1 - Source/SPTableRelations.m | 1 - Source/SPTableStructure.m | 3 - Source/SPTableTriggers.m | 1 - Source/SPTableView.m | 1 - Source/SPTablesList.m | 5 - Source/SPTextView.m | 3 - Source/SPTextViewAdditions.m | 3 - Source/SPTooltip.m | 1 - Source/SPUserManager.m | 2 - Source/SPXMLExporter.m | 2 - Source/SPXMLExporterDelegate.m | 2 - Source/Sequel-Pro.pch | 3 + UnitTests/SPDatabaseCopyTest.m | 2 +- UnitTests/SPDatabaseRenameTest.m | 3 +- sequel-pro.xcodeproj/project.pbxproj | 12 +- 57 files changed, 323 insertions(+), 434 deletions(-) create mode 100644 Source/SPCategoryAdditions.h create mode 100644 Source/SPExportControllerDelegate.h create mode 100644 Source/SPExportControllerDelegate.m diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib index 6afa968d..17f90795 100644 --- a/Interfaces/English.lproj/ExportDialog.xib +++ b/Interfaces/English.lproj/ExportDialog.xib @@ -3,7 +3,7 @@ 1050 10F569 - 788 + 823 1038.29 461.00 @@ -15,30 +15,23 @@ YES - 788 + 823 1.2.5 YES + - - - YES - com.apple.InterfaceBuilder.CocoaPlugin com.brandonwalkin.BWToolkit + com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -54,12 +47,12 @@ 4111 2 - {{610, 291}, {449, 480}} + {{610, 291}, {451, 480}} 611845120 Export NSWindow - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {449, 480} @@ -69,17 +62,16 @@ 18 - {{-14, 69}, {473, 405}} + {{-8, 69}, {467, 405}} YES sql - + 256 - {{10, 33}, {453, 359}} - + {{10, 33}, {447, 359}} SQL @@ -88,7 +80,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -98,7 +90,7 @@ 256 - {{10, 33}, {451, 359}} + {{10, 33}, {447, 359}} CSV @@ -109,7 +101,7 @@ 256 - {{10, 33}, {451, 359}} + {{10, 33}, {447, 359}} XML @@ -118,16 +110,17 @@ dot - + 256 - {{10, 33}, {451, 359}} + {{10, 33}, {447, 359}} + Dot - + LucidaGrande 13 @@ -137,7 +130,7 @@ YES YES - + @@ -432,12 +425,12 @@ - {449, 480} + {451, 480} {{0, 0}, {1680, 1028}} {449, 502} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} SPExportWindow @@ -450,10 +443,10 @@ View - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {213, 50} - + 256 YES @@ -571,11 +564,10 @@ {379, 139} - {{0, 0}, {1680, 1028}} {213, 72} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} 9 @@ -587,10 +579,10 @@ View - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {213, 107} - + 256 YES @@ -771,11 +763,10 @@ {405, 267} - {{0, 0}, {1680, 1028}} {213, 129} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} @@ -1454,7 +1445,9 @@ NaN YES - + + YES + YES @@ -1795,7 +1788,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA csv - + 256 YES @@ -2298,8 +2291,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - {{10, 7}, {189, 229}} - + {{10, 7}, {168, 229}} CSV @@ -2310,48 +2302,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 - - YES - - - 268 - {{12, 176}, {71, 18}} - - YES - - -2080244224 - 131072 - Structure - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{11, 200}, {53, 14}} - - YES - - 68288064 - 272761856 - Include: - - - - - - - - {{10, 7}, {189, 229}} + {{10, 7}, {168, 229}} HTML @@ -2407,50 +2358,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA pdf - + 256 - - YES - - - 268 - {{12, 176}, {71, 18}} - - YES - - -2080244224 - 131072 - Structure - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{11, 200}, {53, 14}} - - YES - - 68288064 - 272761856 - Include: - - - - - - - {{10, 7}, {189, 229}} + PDF @@ -2468,14 +2379,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - + 4 YES YES YES - + @@ -3128,22 +3039,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1284 - - - exportHTMLIncludeStructureCheck - - - - 1285 - - - - exportPDFIncludeStructureCheck - - - - 1286 - exportInputPopUpButton @@ -4468,39 +4363,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES - - - - 1211 - - - YES - - - - - - 1212 - - - YES - - - - - - 1213 - - - - - 1214 - - - 1215 @@ -4544,39 +4409,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES - - - - 1221 - - - YES - - - - - - 1222 - - - YES - - - - - - 1223 - - - - - 1224 - - - 1225 @@ -4849,6 +4684,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1087.IBPluginDependency 1088.IBAttributePlaceholdersKey 1088.IBPluginDependency + 1088.IBViewBoundsToFrameTransform 1092.IBPluginDependency 1093.IBPluginDependency 1094.IBPluginDependency @@ -4981,20 +4817,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 1208.IBPluginDependency 1209.IBPluginDependency 1210.IBPluginDependency - 1211.IBPluginDependency - 1212.IBPluginDependency - 1213.IBPluginDependency - 1214.IBPluginDependency 1215.IBPluginDependency 1216.IBPluginDependency 1217.IBPluginDependency 1218.IBPluginDependency 1219.IBPluginDependency 1220.IBPluginDependency - 1221.IBPluginDependency - 1222.IBPluginDependency - 1223.IBPluginDependency - 1224.IBPluginDependency 1225.IBPluginDependency 1226.IBPluginDependency 1227.IBPluginDependency @@ -5100,15 +4928,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES com.apple.InterfaceBuilder.CocoaPlugin - {{395, 209}, {449, 480}} + {{509, 248}, {451, 480}} com.apple.InterfaceBuilder.CocoaPlugin - {{395, 209}, {449, 480}} + {{509, 248}, {451, 480}} {449, 480} - {{439, 411}, {450, 359}} + {{226, 235}, {450, 359}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -5120,6 +4948,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDYQAAw4OAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -5332,14 +5163,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin YES @@ -5483,7 +5306,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - 1350 + 1354 @@ -5495,13 +5318,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Frameworks/PSMTabBar/PSMTabDragAssistant.h - - NSObject - - IBProjectSource - Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h - - NSObject @@ -5865,11 +5681,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA exportExcelSheetOrFilePerTableMatrix exportFilePerTableCheck exportFilenameDividerBox - exportHTMLIncludeStructureCheck exportInputPopUpButton exportOptionsTabBar exportOutputCompressionFormatPopupButton - exportPDFIncludeStructureCheck exportPathField exportProcessLowMemoryButton exportProgressIndicator @@ -5921,11 +5735,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NSMatrix NSButton NSBox - NSButton NSPopUpButton NSTabView NSPopUpButton - NSButton NSTextField NSButton NSProgressIndicator @@ -5980,11 +5792,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA exportExcelSheetOrFilePerTableMatrix exportFilePerTableCheck exportFilenameDividerBox - exportHTMLIncludeStructureCheck exportInputPopUpButton exportOptionsTabBar exportOutputCompressionFormatPopupButton - exportPDFIncludeStructureCheck exportPathField exportProcessLowMemoryButton exportProgressIndicator @@ -6102,10 +5912,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA exportFilenameDividerBox NSBox - - exportHTMLIncludeStructureCheck - NSButton - exportInputPopUpButton NSPopUpButton @@ -6118,10 +5924,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA exportOutputCompressionFormatPopupButton NSPopUpButton - - exportPDFIncludeStructureCheck - NSButton - exportPathField NSTextField @@ -6233,6 +6035,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Source/SPExportController.h + + SPExportController + + IBProjectSource + Source/SPExportControllerDelegate.h + + SPExportController diff --git a/Resources/English.lproj/DataMigrationDialog.strings b/Resources/English.lproj/DataMigrationDialog.strings index 9d54140c..5203c25c 100644 Binary files a/Resources/English.lproj/DataMigrationDialog.strings and b/Resources/English.lproj/DataMigrationDialog.strings differ diff --git a/Resources/English.lproj/ExportDialog.strings b/Resources/English.lproj/ExportDialog.strings index f8212658..4cf24ec0 100644 Binary files a/Resources/English.lproj/ExportDialog.strings and b/Resources/English.lproj/ExportDialog.strings differ diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index e72f8d9b..60e5d80c 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -28,7 +28,6 @@ #include #import "SPDataAdditions.h" -#import "SPStringAdditions.h" #import "SPEditorTokens.h" /* ----------------------------------------------------------------------------- diff --git a/Source/NSNotificationAdditions.h b/Source/NSNotificationAdditions.h index d11f6185..d1903da5 100644 --- a/Source/NSNotificationAdditions.h +++ b/Source/NSNotificationAdditions.h @@ -25,11 +25,11 @@ @interface NSNotificationCenter (NSNotificationCenterAdditions) -- (void) postNotificationOnMainThread:(NSNotification *) notification; -- (void) postNotificationOnMainThread:(NSNotification *) notification waitUntilDone:(BOOL) wait; +- (void)postNotificationOnMainThread:(NSNotification *)notification; +- (void)postNotificationOnMainThread:(NSNotification *)notification waitUntilDone:(BOOL)wait; -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object; -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo; -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo waitUntilDone:(BOOL) wait; +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object; +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo; +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo waitUntilDone:(BOOL)wait; @end diff --git a/Source/NSNotificationAdditions.m b/Source/NSNotificationAdditions.m index 78233de4..53917dae 100644 --- a/Source/NSNotificationAdditions.m +++ b/Source/NSNotificationAdditions.m @@ -28,48 +28,62 @@ @implementation NSNotificationCenter (NSNotificationCenterAdditions) -- (void) postNotificationOnMainThread:(NSNotification *) notification { - if( pthread_main_np() ) return [self postNotification:notification]; +- (void)postNotificationOnMainThread:(NSNotification *)notification +{ + if (pthread_main_np()) return [self postNotification:notification]; + [self postNotificationOnMainThread:notification waitUntilDone:NO]; } -- (void) postNotificationOnMainThread:(NSNotification *) notification waitUntilDone:(BOOL) wait { - if( pthread_main_np() ) return [self postNotification:notification]; - [[self class] performSelectorOnMainThread:@selector( _postNotification: ) withObject:notification waitUntilDone:wait]; +- (void)postNotificationOnMainThread:(NSNotification *)notification waitUntilDone:(BOOL)wait +{ + if (pthread_main_np()) return [self postNotification:notification]; + + [[self class] performSelectorOnMainThread:@selector(_postNotification:) withObject:notification waitUntilDone:wait]; } -+ (void) _postNotification:(NSNotification *) notification { ++ (void)_postNotification:(NSNotification *)notification +{ [[self defaultCenter] postNotification:notification]; } -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object { - if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:nil]; +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object +{ + if (pthread_main_np()) return [self postNotificationName:name object:object userInfo:nil]; + [self postNotificationOnMainThreadWithName:name object:object userInfo:nil waitUntilDone:NO]; } -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo { - if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:userInfo]; +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo +{ + if(pthread_main_np()) return [self postNotificationName:name object:object userInfo:userInfo]; + [self postNotificationOnMainThreadWithName:name object:object userInfo:userInfo waitUntilDone:NO]; } -- (void) postNotificationOnMainThreadWithName:(NSString *) name object:(id) object userInfo:(NSDictionary *) userInfo waitUntilDone:(BOOL) wait { - if( pthread_main_np() ) return [self postNotificationName:name object:object userInfo:userInfo]; - +- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo waitUntilDone:(BOOL)wait +{ + if (pthread_main_np()) return [self postNotificationName:name object:object userInfo:userInfo]; + NSMutableDictionary *info = [[NSMutableDictionary allocWithZone:nil] initWithCapacity:3]; - if( name ) [info setObject:name forKey:@"name"]; - if( object ) [info setObject:object forKey:@"object"]; - if( userInfo ) [info setObject:userInfo forKey:@"userInfo"]; - - [[self class] performSelectorOnMainThread:@selector( _postNotificationName: ) withObject:info waitUntilDone:wait]; - + + if (name) [info setObject:name forKey:@"name"]; + if (object) [info setObject:object forKey:@"object"]; + if (userInfo) [info setObject:userInfo forKey:@"userInfo"]; + + [[self class] performSelectorOnMainThread:@selector(_postNotificationName:) withObject:info waitUntilDone:wait]; + [info release]; } -+ (void) _postNotificationName:(NSDictionary *) info { ++ (void)_postNotificationName:(NSDictionary *)info +{ NSString *name = [info objectForKey:@"name"]; + id object = [info objectForKey:@"object"]; + NSDictionary *userInfo = [info objectForKey:@"userInfo"]; - + [[self defaultCenter] postNotificationName:name object:object userInfo:userInfo]; } diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m index 5b13cab2..0bb9b25e 100644 --- a/Source/NoodleLineNumberView.m +++ b/Source/NoodleLineNumberView.m @@ -31,7 +31,6 @@ // functionality and adds selection by clicking on the ruler. #import "NoodleLineNumberView.h" -#import "SPArrayAdditions.h" #include diff --git a/Source/SPAlertSheets.m b/Source/SPAlertSheets.m index 8f6a21fd..3299c351 100644 --- a/Source/SPAlertSheets.m +++ b/Source/SPAlertSheets.m @@ -22,8 +22,6 @@ // // More info at -#import "SPMainThreadTrampoline.h" - /** * Provide a simple alias of NSBeginAlertSheet, with a few differences: * - printf-type format strings are no longer supported within the "msg" diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index e7ad01fe..7cc5bb4e 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -23,7 +23,6 @@ // More info at #import "SPArrayAdditions.h" -#import "SPStringAdditions.h" @implementation NSArray (SPArrayAdditions) diff --git a/Source/SPCSVExporter.m b/Source/SPCSVExporter.m index 132d181b..c874e9aa 100644 --- a/Source/SPCSVExporter.m +++ b/Source/SPCSVExporter.m @@ -26,8 +26,6 @@ #import #import "SPCSVExporter.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPFileHandle.h" #import "SPTableData.h" #import "SPExportUtilities.h" diff --git a/Source/SPCSVExporterDelegate.m b/Source/SPCSVExporterDelegate.m index 6a0127c3..226dea8d 100644 --- a/Source/SPCSVExporterDelegate.m +++ b/Source/SPCSVExporterDelegate.m @@ -28,7 +28,6 @@ #import "SPCSVExporter.h" #import "SPCSVExporterDelegate.h" #import "SPDatabaseDocument.h" -#import "SPMainThreadTrampoline.h" #import "SPFileHandle.h" @implementation SPExportController (SPCSVExporterDelegate) diff --git a/Source/SPCSVParser.m b/Source/SPCSVParser.m index e4755a7e..f1e63c72 100644 --- a/Source/SPCSVParser.m +++ b/Source/SPCSVParser.m @@ -24,7 +24,6 @@ // More info at #import "SPCSVParser.h" -#import "SPNotLoaded.h" /** * Please see the header files for a general description of the purpose of this class. diff --git a/Source/SPCategoryAdditions.h b/Source/SPCategoryAdditions.h new file mode 100644 index 00000000..f1d6b6a2 --- /dev/null +++ b/Source/SPCategoryAdditions.h @@ -0,0 +1,43 @@ +// +// $Id$ +// +// SPCategoryAdditions.h +// sequel-pro +// +// Created by Stuart Connolly (stuconnolly.com) on October 23, 2010 +// Copyright (c) 2010 Stuart Connolly. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +/** + * This header is intended to import all of our custom category additions to classes outwith our control. + * It is subsequently included in Sequel Pro's precompiled header making all of the additional methods/functions + * included in header available to all classes within the application. + */ + +#import "SPArrayAdditions.h" +#import "SPStringAdditions.h" +#import "SPTextViewAdditions.h" +#import "SPWindowAdditions.h" +#import "SPDataAdditions.h" +#import "SPNotLoaded.h" +#import "SPMainThreadTrampoline.h" +#import "SPColorAdditions.h" +#import "SPFileManagerAdditions.h" + +#import "NSNotificationAdditions.h" +#import "NSMutableArray-MultipleSort.h" diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 41ca1b65..c8a32f00 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -25,13 +25,10 @@ #import #import "SPCopyTable.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPTableContent.h" #import "SPTableTriggers.h" #import "SPTableRelations.h" #import "SPCustomQuery.h" -#import "SPNotLoaded.h" #import "SPDataStorage.h" #import "SPTextAndLinkCell.h" diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 151e2340..02822f92 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -26,10 +26,6 @@ #import "SPCustomQuery.h" #import "SPSQLParser.h" #import "SPGrowlController.h" -#import "SPStringAdditions.h" -#import "SPTextViewAdditions.h" -#import "SPArrayAdditions.h" -#import "SPDataAdditions.h" #import "SPDataCellFormatter.h" #import "SPDatabaseDocument.h" #import "SPTablesList.h" @@ -42,7 +38,6 @@ #import "SPEncodingPopupAccessory.h" #import "SPDataStorage.h" #import "SPAlertSheets.h" -#import "SPMainThreadTrampoline.h" #import "SPCopyTable.h" #import "SPGeometryDataView.h" diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 61698b46..5fafe4a4 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -33,13 +33,9 @@ #import "SPSQLParser.h" #import "SPCSVParser.h" #import "SPTableData.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" #import "RegexKitLite.h" #import "SPAlertSheets.h" #import "SPFieldMapperController.h" -#import "SPMainThreadTrampoline.h" -#import "SPNotLoaded.h" #import "SPFileHandle.h" #import "SPEncodingPopupAccessory.h" diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m index 73fcfe74..21993d95 100644 --- a/Source/SPDatabaseData.m +++ b/Source/SPDatabaseData.m @@ -24,7 +24,6 @@ // More info at #import "SPDatabaseData.h" -#import "SPStringAdditions.h" #import "SPServerSupport.h" #import "SPDatabaseCharacterSets.h" diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index f8b74a86..914ab259 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -39,9 +39,6 @@ #import "SPSQLParser.h" #import "SPTableData.h" #import "SPDatabaseData.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" -#import "SPDataAdditions.h" #import "SPAppController.h" #import "SPExtendedTableInfo.h" #import "SPConnectionController.h" @@ -53,7 +50,6 @@ #import "SPProcessListController.h" #import "SPServerVariablesController.h" #import "SPAlertSheets.h" -#import "SPMainThreadTrampoline.h" #import "SPLogger.h" #import "SPDatabaseCopy.h" #import "SPTableCopy.h" diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m index c2e81862..9db34a7c 100644 --- a/Source/SPDotExporter.m +++ b/Source/SPDotExporter.m @@ -25,7 +25,6 @@ #import "SPDotExporter.h" #import "SPFileHandle.h" -#import "SPArrayAdditions.h" #import "SPTableData.h" #import "SPExportUtilities.h" diff --git a/Source/SPDotExporterDelegate.m b/Source/SPDotExporterDelegate.m index 6d1b8954..ceb24354 100644 --- a/Source/SPDotExporterDelegate.m +++ b/Source/SPDotExporterDelegate.m @@ -26,7 +26,6 @@ #import "SPDotExporterDelegate.h" #import "SPDotExporter.h" #import "SPDatabaseDocument.h" -#import "SPMainThreadTrampoline.h" @implementation SPExportController (SPDotExporterDelegate) diff --git a/Source/SPExportController.h b/Source/SPExportController.h index 7cedc6d8..32cf189a 100644 --- a/Source/SPExportController.h +++ b/Source/SPExportController.h @@ -106,12 +106,6 @@ // XML IBOutlet NSTextField *exportXMLNULLValuesAsTextField; - // HTML - IBOutlet NSButton *exportHTMLIncludeStructureCheck; - - // PDF - IBOutlet NSButton *exportPDFIncludeStructureCheck; - /** * Cancellation flag */ diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 12ea51dc..3ca2c996 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -30,16 +30,22 @@ #import "SPTablesList.h" #import "SPTableData.h" #import "SPTableContent.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPGrowlController.h" #import "SPExportFile.h" #import "SPAlertSheets.h" +// Constants +static const NSUInteger SPExportUIPadding = 20; + +static const NSString *SPTableViewStructureColumnID = @"structure"; +static const NSString *SPTableViewContentColumnID = @"content"; +static const NSString *SPTableViewDropColumnID = @"drop"; + @interface SPExportController (PrivateAPI) - (void)_switchTab; - (void)_checkForDatabaseChanges; +- (void)_displayExportTypeOptions:(BOOL)display; - (void)_toggleExportButton:(id)uiStateDict; - (void)_toggleExportButtonOnBackgroundThread; @@ -123,6 +129,11 @@ // If found the set the default path to the user's desktop, otherwise use their home directory [exportPathField setStringValue:([paths count] > 0) ? [paths objectAtIndex:0] : NSHomeDirectory()]; + + // Accept Core Animation + [exportOptionsTabBar wantsLayer]; + [exportTablelistScrollView wantsLayer]; + [exportTableListButtonBar wantsLayer]; } #pragma mark - @@ -499,7 +510,7 @@ */ - (IBAction)toggleSQLIncludeStructure:(id)sender { - [[exportTableList tableColumnWithIdentifier:@"structure"] setHidden:(![sender state])]; + [[exportTableList tableColumnWithIdentifier:SPTableViewStructureColumnID] setHidden:(![sender state])]; [self _toggleExportButtonOnBackgroundThread]; } @@ -509,7 +520,7 @@ */ - (IBAction)toggleSQLIncludeContent:(id)sender { - [[exportTableList tableColumnWithIdentifier:@"content"] setHidden:(![sender state])]; + [[exportTableList tableColumnWithIdentifier:SPTableViewContentColumnID] setHidden:(![sender state])]; [self _toggleExportButtonOnBackgroundThread]; } @@ -519,7 +530,7 @@ */ - (IBAction)toggleSQLIncludeDropSyntax:(id)sender { - [[exportTableList tableColumnWithIdentifier:@"drop"] setHidden:(![sender state])]; + [[exportTableList tableColumnWithIdentifier:SPTableViewDropColumnID] setHidden:(![sender state])]; [self _toggleExportButtonOnBackgroundThread]; } @@ -535,64 +546,6 @@ [self switchInput:exportInputPopUpButton]; } -#pragma mark - -#pragma mark Table view datasource methods - -- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; -{ - return [tables count]; -} - -- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex -{ - return NSArrayObjectAtIndex([tables objectAtIndex:rowIndex], [exportTableList columnWithIdentifier:[tableColumn identifier]]); -} - -- (void)tableView:(NSTableView *)tableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex -{ - [[tables objectAtIndex:rowIndex] replaceObjectAtIndex:[exportTableList columnWithIdentifier:[tableColumn identifier]] withObject:anObject]; - - [self _toggleExportButtonOnBackgroundThread]; -} - -#pragma mark - -#pragma mark Table view delegate methods - -- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)rowIndex -{ - return (tableView != exportTableList); -} - -- (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex -{ - return (tableView == exportTableList); -} - -- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex -{ - [aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; -} - -#pragma mark - -#pragma mark Tabview delegate methods - -- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - [tabViewItem setView:exporterView]; - - [self _switchTab]; -} - -#pragma mark - -#pragma mark Combo box delegate methods - -- (void)comboBoxSelectionDidChange:(NSNotification *)notification -{ - if ([notification object] == exportCSVFieldsTerminatedField) { - [self updateDisplayedExportFilename]; - } -} - #pragma mark - #pragma mark Other @@ -728,17 +681,18 @@ [[[exportInputPopUpButton menu] itemAtIndex:SPQueryExport] setEnabled:((enable) && ([[customQueryInstance currentResult] count] > 1))]; } - [[exportTableList tableColumnWithIdentifier:@"structure"] setHidden:(isSQL) ? (![exportSQLIncludeStructureCheck state]) : YES]; - [[exportTableList tableColumnWithIdentifier:@"drop"] setHidden:(isSQL) ? (![exportSQLIncludeDropSyntaxCheck state]) : YES]; + [[exportTableList tableColumnWithIdentifier:SPTableViewStructureColumnID] setHidden:(isSQL) ? (![exportSQLIncludeStructureCheck state]) : YES]; + [[exportTableList tableColumnWithIdentifier:SPTableViewDropColumnID] setHidden:(isSQL) ? (![exportSQLIncludeDropSyntaxCheck state]) : YES]; - [[[exportTableList tableColumnWithIdentifier:@"content"] headerCell] setStringValue:(enable) ? @"" : @"C"]; + [[[exportTableList tableColumnWithIdentifier:SPTableViewContentColumnID] headerCell] setStringValue:(enable) ? @"" : @"C"]; // Set the tooltip - [[exportTableList tableColumnWithIdentifier:@"content"] setHeaderToolTip:(enable) ? @"" : NSLocalizedString(@"Include content", @"include content table column tooltip")]; + [[exportTableList tableColumnWithIdentifier:SPTableViewContentColumnID] setHeaderToolTip:(enable) ? @"" : NSLocalizedString(@"Include content", @"include content table column tooltip")]; [exportCSVNULLValuesAsTextField setStringValue:[prefs stringForKey:SPNullValue]]; [exportXMLNULLValuesAsTextField setStringValue:[prefs stringForKey:SPNullValue]]; + [self _displayExportTypeOptions:(isSQL || isCSV || isXML)]; [self updateAvailableExportFilenameTokens]; if (!showCustomFilenameView) [self updateDisplayedExportFilename]; @@ -774,6 +728,32 @@ } } +/** + * Toggles the display of the export type options view. + * + * @param display A BOOL indicating whether or not the view should be visible + */ +- (void)_displayExportTypeOptions:(BOOL)display +{ + NSRect windowFrame = [[exportTablelistScrollView window] frame]; + NSRect viewFrame = [exportTablelistScrollView frame]; + NSRect barFrame = [exportTableListButtonBar frame]; + + NSUInteger padding = (2 * SPExportUIPadding); + + CGFloat width = (!display) ? (windowFrame.size.width - (padding + 2)) : (windowFrame.size.width - ([exportOptionsTabBar frame].size.width + (padding + 4))); + CGFloat width2 = (!display) ? (windowFrame.size.width - (padding + 2)) : (windowFrame.size.width - ([exportTableListButtonBar frame].size.width + (padding + 4))); + + [NSAnimationContext beginGrouping]; + [[NSAnimationContext currentContext] setDuration:0.3]; + + [[exportOptionsTabBar animator] setHidden:(!display)]; + [[exportTablelistScrollView animator] setFrame:NSMakeRect(viewFrame.origin.x, viewFrame.origin.y, width, viewFrame.size.height)]; + [[exportTableListButtonBar animator] setFrame:NSMakeRect(barFrame.origin.x, barFrame.origin.y, width, barFrame.size.height)]; + + [NSAnimationContext endGrouping]; +} + /** * Enables or disables the export button based on the state of various interface controls. * diff --git a/Source/SPExportControllerDelegate.h b/Source/SPExportControllerDelegate.h new file mode 100644 index 00000000..f9406be4 --- /dev/null +++ b/Source/SPExportControllerDelegate.h @@ -0,0 +1,37 @@ +// +// $Id$ +// +// SPExportControllerDelegate.h +// sequel-pro +// +// Created by Stuart Connolly (stuconnolly.com) on October 23, 2010 +// Copyright (c) 2010 Stuart Connolly. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import "SPExportController.h" + +/** + * @category SPExportControllerDelegate SPExportControllerDelegate.h + * + * @author Stuart Connolly http://stuconnolly.com/ + * + * Export controller delegate category. + */ +@interface SPExportController (SPExportControllerDelegate) + +@end diff --git a/Source/SPExportControllerDelegate.m b/Source/SPExportControllerDelegate.m new file mode 100644 index 00000000..bc9608e7 --- /dev/null +++ b/Source/SPExportControllerDelegate.m @@ -0,0 +1,88 @@ +// +// $Id$ +// +// SPExportControllerDelegate.m +// sequel-pro +// +// Created by Stuart Connolly (stuconnolly.com) on October 23, 2010 +// Copyright (c) 2010 Stuart Connolly. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import "SPExportControllerDelegate.h" + +@implementation SPExportController (SPExportControllerDelegate) + +#pragma mark - +#pragma mark Table view datasource methods + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; +{ + return [tables count]; +} + +- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + return NSArrayObjectAtIndex([tables objectAtIndex:rowIndex], [exportTableList columnWithIdentifier:[tableColumn identifier]]); +} + +- (void)tableView:(NSTableView *)tableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + [[tables objectAtIndex:rowIndex] replaceObjectAtIndex:[exportTableList columnWithIdentifier:[tableColumn identifier]] withObject:anObject]; + + [self _toggleExportButtonOnBackgroundThread]; +} + +#pragma mark - +#pragma mark Table view delegate methods + +- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)rowIndex +{ + return (tableView != exportTableList); +} + +- (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + return (tableView == exportTableList); +} + +- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + [aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; +} + +#pragma mark - +#pragma mark Tabview delegate methods + +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem +{ + [tabViewItem setView:exporterView]; + + [self _switchTab]; +} + +#pragma mark - +#pragma mark Combo box delegate methods + +- (void)comboBoxSelectionDidChange:(NSNotification *)notification +{ + if ([notification object] == exportCSVFieldsTerminatedField) { + [self updateDisplayedExportFilename]; + } +} + +@end diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index ee184701..a23ff1b9 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -26,12 +26,10 @@ #import #import "SPExportInitializer.h" -#import "SPStringAdditions.h" #import "SPTableData.h" #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPGrowlController.h" -#import "SPMainThreadTrampoline.h" #import "SPDatabaseDocument.h" #import "SPCustomQuery.h" #import "SPAlertSheets.h" diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index b46bbea4..bcf726c7 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -27,7 +27,6 @@ #import "SPTableData.h" #import "RegexKitLite.h" #import "SPDatabaseData.h" -#import "SPStringAdditions.h" #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPAlertSheets.h" diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 086811ed..16823fed 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -23,10 +23,6 @@ // More info at #import "SPFieldEditorController.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" -#import "SPTextViewAdditions.h" -#import "SPDataAdditions.h" #import "QLPreviewPanel.h" #import "SPDataCellFormatter.h" #import "RegexKitLite.h" diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 10afade0..ca43d4d0 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -26,9 +26,6 @@ #import "SPTableData.h" #import "SPDataImport.h" #import "SPTablesList.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" -#import "SPNotLoaded.h" #import "SPTextView.h" #import "SPTableView.h" diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m index d61ffd1f..24eccb50 100644 --- a/Source/SPGrowlController.m +++ b/Source/SPGrowlController.m @@ -24,7 +24,6 @@ // More info at #import "SPGrowlController.h" -#import "SPMainThreadTrampoline.h" #include diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m index 6ef82d83..3d7f00d0 100644 --- a/Source/SPHistoryController.m +++ b/Source/SPHistoryController.m @@ -26,8 +26,6 @@ #import "SPTableContent.h" #import "SPTablesList.h" #import "SPHistoryController.h" -#import "SPStringAdditions.h" -#import "SPMainThreadTrampoline.h" @implementation SPHistoryController diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 9f6e7abb..fc2c8728 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -30,8 +30,6 @@ #import #import "SPNarrowDownCompletion.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "ImageAndTextCell.h" #import "SPQueryController.h" #import "RegexKitLite.h" diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 86a31fd5..58141936 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -28,9 +28,9 @@ #import "ImageAndTextCell.h" #import "SPDatabaseDocument.h" #import "SPTablesList.h" -#import "SPArrayAdditions.h" #import "SPLogger.h" #import "SPTooltip.h" + #import static SPNavigatorController *sharedNavigatorController = nil; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index eb429b61..ad6a7061 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -24,14 +24,11 @@ // More info at #import "SPPreferenceController.h" -#import "SPWindowAdditions.h" #import "SPFavoriteTextFieldCell.h" #import "SPKeychain.h" #import "SPDatabaseDocument.h" #import "SPConnectionController.h" -#import "SPColorAdditions.h" #import "SPColorWellCell.h" -#import "SPFileManagerAdditions.h" #import "SPAlertSheets.h" @interface SPPreferenceController (PrivateAPI) diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index 20c1c4c6..82075eac 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -24,7 +24,6 @@ // More info at #import "SPProcessListController.h" -#import "SPArrayAdditions.h" #import "SPDatabaseDocument.h" #import "SPAlertSheets.h" diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 53346a21..480d3e9e 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -25,7 +25,6 @@ #import "SPQueryController.h" #import "SPConsoleMessage.h" -#import "SPArrayAdditions.h" #import "SPCustomQuery.h" #import "pthread.h" diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 78966b36..1374ccda 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -27,8 +27,6 @@ #import "SPSQLExporter.h" #import "SPTablesList.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPFileHandle.h" #import "SPExportUtilities.h" #import "SPTableData.h" diff --git a/Source/SPSQLExporterDelegate.m b/Source/SPSQLExporterDelegate.m index 2aad2f7e..89bc9b89 100644 --- a/Source/SPSQLExporterDelegate.m +++ b/Source/SPSQLExporterDelegate.m @@ -26,7 +26,6 @@ #import "SPSQLExporterDelegate.h" #import "SPSQLExporter.h" #import "SPDatabaseDocument.h" -#import "SPMainThreadTrampoline.h" @implementation SPExportController (SPSQLExporterDelegate) diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 01ce909c..76508304 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -26,7 +26,6 @@ #import "SPSSHTunnel.h" #import "RegexKitLite.h" #import "SPKeychain.h" -#import "SPMainThreadTrampoline.h" #import "SPAlertSheets.h" #import diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index e1383edf..e0796454 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -24,7 +24,6 @@ // More info at #import "SPServerVariablesController.h" -#import "SPArrayAdditions.h" #import "SPDatabaseDocument.h" @interface SPServerVariablesController (PrivateAPI) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index dfb54e69..fe586e8a 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -35,20 +35,14 @@ #import "SPDataCellFormatter.h" #import "SPTableData.h" #import "SPQueryController.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" -#import "SPTextViewAdditions.h" -#import "SPDataAdditions.h" #import "SPTextAndLinkCell.h" #import "QLPreviewPanel.h" #import "SPFieldEditorController.h" #import "SPTooltip.h" #import "RegexKitLite.h" #import "SPContentFilterManager.h" -#import "SPNotLoaded.h" #import "SPDataStorage.h" #import "SPAlertSheets.h" -#import "SPMainThreadTrampoline.h" #import "SPHistoryController.h" #import "SPGeometryDataView.h" diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 8a253854..e39635c7 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -27,8 +27,6 @@ #import "SPSQLParser.h" #import "SPDatabaseDocument.h" #import "SPTablesList.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" #import "SPAlertSheets.h" #import "RegexKitLite.h" #import "SPServerSupport.h" diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 68cc1ae3..0270c097 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -27,7 +27,6 @@ #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPTableData.h" -#import "SPStringAdditions.h" @interface SPTableInfo (PrivateAPI) diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 138ec35c..b7a4bde6 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -27,7 +27,6 @@ #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPTableData.h" -#import "SPStringAdditions.h" #import "SPAlertSheets.h" @interface SPTableRelations (PrivateAPI) diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 61659194..e6afab2d 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -29,10 +29,7 @@ #import "SPTablesList.h" #import "SPTableData.h" #import "SPSQLParser.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" #import "SPAlertSheets.h" -#import "SPMainThreadTrampoline.h" #import "SPIndexesController.h" #import "RegexKitLite.h" diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m index dc67e76a..44a17549 100644 --- a/Source/SPTableTriggers.m +++ b/Source/SPTableTriggers.m @@ -27,7 +27,6 @@ #import "SPDatabaseDocument.h" #import "SPTablesList.h" #import "SPTableData.h" -#import "SPStringAdditions.h" #import "SPAlertSheets.h" #import "SPServerSupport.h" diff --git a/Source/SPTableView.m b/Source/SPTableView.m index 531e3041..d1aa5700 100644 --- a/Source/SPTableView.m +++ b/Source/SPTableView.m @@ -24,7 +24,6 @@ #import "SPTableView.h" #import "SPQueryFavoriteManager.h" -#import "SPArrayAdditions.h" #import "SPDatabaseDocument.h" @implementation SPTableView diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 67e650b1..722c3242 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -31,15 +31,10 @@ #import "SPTableInfo.h" #import "SPDataImport.h" #import "ImageAndTextCell.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" #import "RegexKitLite.h" #import "SPDatabaseData.h" -#import "NSMutableArray-MultipleSort.h" -#import "NSNotificationAdditions.h" #import "SPAlertSheets.h" #import "SPNavigatorController.h" -#import "SPMainThreadTrampoline.h" #import "SPHistoryController.h" #import "SPServerSupport.h" diff --git a/Source/SPTextView.m b/Source/SPTextView.m index c584a407..39e7b5e7 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -25,9 +25,6 @@ #import "SPTextView.h" #import "SPCustomQuery.h" #import "SPDatabaseDocument.h" -#import "SPStringAdditions.h" -#import "SPArrayAdditions.h" -#import "SPTextViewAdditions.h" #import "SPNarrowDownCompletion.h" #import "SPQueryController.h" #import "SPTooltip.h" diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 2789ad87..93eccf5b 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -22,9 +22,6 @@ // // More info at -#import "SPStringAdditions.h" -#import "SPTextViewAdditions.h" - @implementation NSTextView (SPTextViewAdditions) /* diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m index fc7133e2..f35dc155 100644 --- a/Source/SPTooltip.m +++ b/Source/SPTooltip.m @@ -55,7 +55,6 @@ // See more possible syntaxa in SPTooltip to init a tooltip #import "SPTooltip.h" -#import "SPTextViewAdditions.h" #include diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 2014b2d6..f947568e 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -25,8 +25,6 @@ #import "SPUserManager.h" #import "SPUserMO.h" #import "ImageAndTextCell.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPGrowlController.h" #import "SPConnectionController.h" #import "SPServerSupport.h" diff --git a/Source/SPXMLExporter.m b/Source/SPXMLExporter.m index 1e2782b1..c3fee7c2 100644 --- a/Source/SPXMLExporter.m +++ b/Source/SPXMLExporter.m @@ -26,8 +26,6 @@ #import #import "SPXMLExporter.h" -#import "SPArrayAdditions.h" -#import "SPStringAdditions.h" #import "SPFileHandle.h" #import "SPExportUtilities.h" diff --git a/Source/SPXMLExporterDelegate.m b/Source/SPXMLExporterDelegate.m index e5073aed..12274a4b 100644 --- a/Source/SPXMLExporterDelegate.m +++ b/Source/SPXMLExporterDelegate.m @@ -25,10 +25,8 @@ #import "SPXMLExporterDelegate.h" #import "SPXMLExporter.h" -#import "SPMainThreadTrampoline.h" #import "SPDatabaseDocument.h" #import "SPFileHandle.h" -#import "SPStringAdditions.h" @implementation SPExportController (SPXMLExporterDelegate) diff --git a/Source/Sequel-Pro.pch b/Source/Sequel-Pro.pch index a13ad20f..471695d6 100644 --- a/Source/Sequel-Pro.pch +++ b/Source/Sequel-Pro.pch @@ -27,4 +27,7 @@ // Nearly every class uses constants #import "SPConstants.h" + + // Make all our custom additions available + #import "SPCategoryAdditions.h" #endif diff --git a/UnitTests/SPDatabaseCopyTest.m b/UnitTests/SPDatabaseCopyTest.m index 593989de..a1ed99fe 100644 --- a/UnitTests/SPDatabaseCopyTest.m +++ b/UnitTests/SPDatabaseCopyTest.m @@ -24,13 +24,13 @@ // More info at #import + #import "SPAlertSheets.h" #import "SPDatabaseCopyTest.h" #import "SPDatabaseCopy.h" #import "SPTableCopy.h" #import "MCPConnection.h" #import "SPDatabaseInfo.h" -#import "SPStringAdditions.h" #import "SPLogger.h" @implementation SPDatabaseCopyTest diff --git a/UnitTests/SPDatabaseRenameTest.m b/UnitTests/SPDatabaseRenameTest.m index 7e787caa..1d432c73 100644 --- a/UnitTests/SPDatabaseRenameTest.m +++ b/UnitTests/SPDatabaseRenameTest.m @@ -30,7 +30,6 @@ #import "SPTableCopy.h" #import "MCPConnection.h" #import "SPDatabaseInfo.h" -#import "SPStringAdditions.h" #import "SPLogger.h" @implementation SPDatabaseRenameTest @@ -53,7 +52,7 @@ { id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]]; - eturn mockConnection; + return mockConnection; } - (id)getMockDBInfo diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index c9a2a49e..1763f339 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -60,6 +60,7 @@ 1740FABB0FC4372F00CF3699 /* SPDatabaseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 1740FABA0FC4372F00CF3699 /* SPDatabaseData.m */; }; 174CE11E10AB80B5008F892B /* DatabaseProcessList.xib in Resources */ = {isa = PBXBuildFile; fileRef = 174CE11C10AB80B5008F892B /* DatabaseProcessList.xib */; }; 174CE14210AB9281008F892B /* SPProcessListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 174CE14110AB9281008F892B /* SPProcessListController.m */; }; + 175EC63512733B36009A7C0F /* SPExportControllerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 175EC63412733B36009A7C0F /* SPExportControllerDelegate.m */; }; 1761FD480EF03A6F00331368 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1761FD460EF03A6F00331368 /* MainMenu.xib */; }; 177E792E0FCB54EC00E9E122 /* database-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 177E792B0FCB54EC00E9E122 /* database-small.png */; }; 177E792F0FCB54EC00E9E122 /* dummy-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 177E792C0FCB54EC00E9E122 /* dummy-small.png */; }; @@ -573,6 +574,9 @@ 174CE11D10AB80B5008F892B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Interfaces/English.lproj/DatabaseProcessList.xib; sourceTree = ""; }; 174CE14010AB9281008F892B /* SPProcessListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPProcessListController.h; sourceTree = ""; }; 174CE14110AB9281008F892B /* SPProcessListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPProcessListController.m; sourceTree = ""; }; + 175EC63312733B36009A7C0F /* SPExportControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPExportControllerDelegate.h; sourceTree = ""; }; + 175EC63412733B36009A7C0F /* SPExportControllerDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPExportControllerDelegate.m; sourceTree = ""; }; + 175EC64C12733CDF009A7C0F /* SPCategoryAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCategoryAdditions.h; sourceTree = ""; }; 1761FD470EF03A6F00331368 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 1761FD9D0EF0488900331368 /* build-version.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "build-version.pl"; sourceTree = ""; }; 177E792B0FCB54EC00E9E122 /* database-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "database-small.png"; sourceTree = ""; }; @@ -1594,10 +1598,10 @@ 17DC8825126B222D00E9AAEC /* Third Party */ = { isa = PBXGroup; children = ( - 5841929F101E57BB0089807F /* NSMutableArray-MultipleSort.h */, - 584192A0101E57BB0089807F /* NSMutableArray-MultipleSort.m */, 58C34F5110B86CAE00D37E14 /* NSNotificationAdditions.h */, 58C34F5210B86CAE00D37E14 /* NSNotificationAdditions.m */, + 5841929F101E57BB0089807F /* NSMutableArray-MultipleSort.h */, + 584192A0101E57BB0089807F /* NSMutableArray-MultipleSort.m */, 17DC8826126B22F200E9AAEC /* Views */, 58B909A111C3B8EC000826E5 /* Localization */, 296DC8A40F90914B002A3258 /* MGTemplateEngine */, @@ -1978,6 +1982,8 @@ 17F90E4A1210B43A00274C98 /* SPExportFileUtilities.m */, 17AF787911FC41C00073D043 /* SPExportFilenameUtilities.h */, 17AF787A11FC41C00073D043 /* SPExportFilenameUtilities.m */, + 175EC63312733B36009A7C0F /* SPExportControllerDelegate.h */, + 175EC63412733B36009A7C0F /* SPExportControllerDelegate.m */, 17F90E451210B41100274C98 /* Model */, 173C836C11AAD24300B8B084 /* Exporters */, 173C837C11AAD2C500B8B084 /* Delegate Protocols */, @@ -2244,6 +2250,7 @@ B57747D60F7A8990003B34F9 /* Category Additions */ = { isa = PBXGroup; children = ( + 175EC64C12733CDF009A7C0F /* SPCategoryAdditions.h */, B52460D30F8EF92300171639 /* SPArrayAdditions.h */, B52460D40F8EF92300171639 /* SPArrayAdditions.m */, 1789343A0F30C1DD0097539A /* SPStringAdditions.h */, @@ -2910,6 +2917,7 @@ BC2898F3125F4488001B50E1 /* SPGeometryDataView.m in Sources */, 17148565125F5FF500321285 /* SPDatabaseCharacterSets.m in Sources */, 1798AB911267924D000D946A /* SPAppleScriptSupport.m in Sources */, + 175EC63512733B36009A7C0F /* SPExportControllerDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- cgit v1.2.3