From 8d7991d7e6898452902357305c3141c86884ae6b Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 4 Dec 2014 23:10:32 +0100 Subject: Fixes "Could not find image named" errors Switchting the IB files to Xcode 5 introduced some kind of image reference for some of our popup buttons, which was kept when we switched back to 4.6 format. However as this wasn't used in the 4.6 files before switchting to 5 either, I just removed that stuff. --- Interfaces/English.lproj/DBView.xib | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index b6a5e2fa..983482ae 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -4070,14 +4070,6 @@ 1048576 2147483647 - - NSImage - 729BAD60-B632-470B-BA82-856F39114541 - - - NSImage - 73B69558-349D-4439-B164-B5723719CCFA - _popUpItemAction: @@ -4191,14 +4183,6 @@ 1048576 2147483647 - - NSImage - 660263D3-793C-406A-89B8-EC5E0D096CD0 - - - NSImage - F1B8C31D-945B-4266-A204-4DAE195D61AE - _popUpItemAction: @@ -4314,14 +4298,6 @@ 1048576 2147483647 - - NSImage - 8250562F-864D-4E5D-880D-0810E6CC5D58 - - - NSImage - F6692946-0767-44FB-B4D4-572DCEEFE404 - _popUpItemAction: @@ -26754,12 +26730,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 YES 3 - {128, 128} - {128, 128} - {128, 128} - {128, 128} - {128, 128} - {128, 128} {32, 32} {128, 128} {9, 9} -- cgit v1.2.3 From 328b63748a0f0b6cb67aee37efffce86aaf16aa8 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 4 Dec 2014 23:47:03 +0100 Subject: Fix "Invalid color System, labelColor" error At some point Xcode decided to introduce a new variant of black named "labelColor" (which is 10.10 only). This commit changes the DBView xib back to controlTextColor instead. --- Interfaces/English.lproj/DBView.xib | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 983482ae..35efd25d 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -5261,12 +5261,7 @@ Box - - 6 - System - labelColor - - + 3 2 @@ -5288,7 +5283,7 @@ Box - + 3 2 @@ -8113,7 +8108,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 Box - + 3 2 @@ -8256,7 +8251,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 1558 - + 1 @@ -8332,7 +8327,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 1558 - + 1 @@ -8590,7 +8585,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 1558 - + 1 @@ -8798,7 +8793,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 1558 - + 1 @@ -9133,7 +9128,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 1558 - + 1 @@ -10289,7 +10284,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 Box - + 3 2 -- cgit v1.2.3 From fd3ff51dc624be5ce645ce25eb72d03e5a359416 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 5 Dec 2014 00:01:44 +0100 Subject: Add stub for SPTableContentFilterController And with that we are back to a build that should not spam your Console upon launch. (Sorry for the future merge conflict) :) --- Source/SPTableContentFilterController.h | 10 ++++++++++ Source/SPTableContentFilterController.m | 5 +++++ sequel-pro.xcodeproj/project.pbxproj | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 Source/SPTableContentFilterController.h create mode 100644 Source/SPTableContentFilterController.m diff --git a/Source/SPTableContentFilterController.h b/Source/SPTableContentFilterController.h new file mode 100644 index 00000000..15880416 --- /dev/null +++ b/Source/SPTableContentFilterController.h @@ -0,0 +1,10 @@ +// This class is a dummy. +// It is only present because DBView.xib already references it, but the +// code itself is still in another branch. This stub is used to avoid a warning +// from the Nib loader, saying 'this class was not found and replaced with a NSObject'. + +#import + +@interface SPTableContentFilterController : NSObject + +@end diff --git a/Source/SPTableContentFilterController.m b/Source/SPTableContentFilterController.m new file mode 100644 index 00000000..39c0f722 --- /dev/null +++ b/Source/SPTableContentFilterController.m @@ -0,0 +1,5 @@ +#import "SPTableContentFilterController.h" + +@implementation SPTableContentFilterController + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 3ba583de..5a795678 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -179,6 +179,7 @@ 4DECC48F0EC2B436008D359E /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3320EC2A170008D359E /* Sparkle.framework */; }; 4DECC4910EC2B436008D359E /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3340EC2A170008D359E /* Growl.framework */; }; 501B1D181728A3DA0017C92E /* SPCharsetCollationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */; }; + 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; 50A9F8AD19EAD4860053E571 /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50A9F8AC19EAD4860053E571 /* GotoDatabaseDialog.xib */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; @@ -881,6 +882,8 @@ 4DECC3340EC2A170008D359E /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = ""; }; 501B1D161728A3DA0017C92E /* SPCharsetCollationHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCharsetCollationHelper.h; sourceTree = ""; }; 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; + 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableContentFilterController.h; sourceTree = ""; }; + 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = ""; }; 50A9F8AC19EAD4860053E571 /* GotoDatabaseDialog.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = GotoDatabaseDialog.xib; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = ""; }; 50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGotoDatabaseController.h; sourceTree = ""; }; 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGotoDatabaseController.m; sourceTree = ""; }; @@ -1590,6 +1593,8 @@ 1713C73D140D88D400CFD461 /* Query Controller */, 50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */, 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */, + 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */, + 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */, ); name = "Subview Controllers"; sourceTree = ""; @@ -3213,6 +3218,7 @@ 17FDB04C1280778B00DBBBC2 /* SPFontPreviewTextField.m in Sources */, 17D3DC201281816E002A163A /* SPDatabaseViewController.m in Sources */, 17D3C22212859E070047709F /* SPFavoriteNode.m in Sources */, + 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */, 17D3C6041289BF350047709F /* SPConnectionControllerDelegate.m in Sources */, 17D3C66E128AD4710047709F /* SPFavoritesController.m in Sources */, 17D3C671128AD8160047709F /* SPSingleton.m in Sources */, -- cgit v1.2.3 From 00d1e5aee581ff413ded538a470ade2073bb6a43 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 02:38:16 +0100 Subject: Changed a few typedef enums to Apples new method --- Source/SPConstants.h | 41 +++++++++++++++++++---------------------- Source/SPConstants.m | 10 ---------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 6c9f4a68..fd7afe40 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -46,23 +46,21 @@ typedef enum { } SPViewMode; // Query modes -enum { +typedef NS_ENUM(NSUInteger, SPQueryMode) { SPInterfaceQueryMode = 0, SPCustomQueryQueryMode = 1, SPImportExportQueryMode = 2 }; -typedef NSUInteger SPQueryMode; // Connection types -enum { +typedef NS_ENUM(NSUInteger, SPConnectionType) { SPTCPIPConnection = 0, SPSocketConnection = 1, SPSSHTunnelConnection = 2 -}; -typedef NSUInteger SPConnectionType; +}; // Export type constants -enum { +typedef NS_ENUM(NSUInteger, SPExportType) { SPSQLExport = 0, SPCSVExport = 1, SPXMLExport = 2, @@ -71,29 +69,25 @@ enum { SPHTMLExport = 5, SPExcelExport = 6 }; -typedef NSUInteger SPExportType; // Export source constants -enum { +typedef NS_ENUM(NSUInteger, SPExportSource) { SPFilteredExport = 0, SPQueryExport = 1, SPTableExport = 2 }; -typedef NSUInteger SPExportSource; // SQL export INSERT statment divider constants -enum { +typedef NS_ENUM(NSUInteger , SPSQLExportInsertDivider) { SPSQLInsertEveryNDataBytes = 0, SPSQLInsertEveryNRows = 1 }; -typedef NSUInteger SPSQLExportInsertDivider; // XML export formats -enum { +typedef NS_ENUM(NSUInteger, SPXMLExportFormat) { SPXMLExportMySQLFormat = 0, SPXMLExportPlainFormat = 1 }; -typedef NSUInteger SPXMLExportFormat; // Table row count query usage levels typedef enum { @@ -214,6 +208,7 @@ typedef enum // Export file handle creation typedef enum { + SPExportFileHandleInvalid = -1, SPExportFileHandleCreated = 0, SPExportFileHandleFailed = 1, SPExportFileHandleExists = 2 @@ -595,15 +590,17 @@ extern NSString *SPBundleShellVariableAllFunctions; extern NSString *SPBundleShellVariableAllViews; extern NSString *SPBundleShellVariableAllTables; -extern const NSInteger SPBundleRedirectActionNone; -extern const NSInteger SPBundleRedirectActionReplaceSection; -extern const NSInteger SPBundleRedirectActionReplaceContent; -extern const NSInteger SPBundleRedirectActionInsertAsText; -extern const NSInteger SPBundleRedirectActionInsertAsSnippet; -extern const NSInteger SPBundleRedirectActionShowAsHTML; -extern const NSInteger SPBundleRedirectActionShowAsTextTooltip; -extern const NSInteger SPBundleRedirectActionShowAsHTMLTooltip; -extern const NSInteger SPBundleRedirectActionLastCode; +typedef NS_ENUM(NSInteger, SPBundleRedirectAction) { + SPBundleRedirectActionNone = 200, + SPBundleRedirectActionReplaceSection = 201, + SPBundleRedirectActionReplaceContent = 202, + SPBundleRedirectActionInsertAsText = 203, + SPBundleRedirectActionInsertAsSnippet = 204, + SPBundleRedirectActionShowAsHTML = 205, + SPBundleRedirectActionShowAsTextTooltip = 207, + SPBundleRedirectActionShowAsHTMLTooltip = 208, + SPBundleRedirectActionLastCode = 208 +}; // URL scheme extern NSString *SPURLSchemeQueryInputPathHeader; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index eb11ac11..e7b92884 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -412,16 +412,6 @@ NSString *SPBundleShellVariableSelectedText = @"SP_SELECTED_TEXT NSString *SPBundleShellVariableSelectedTextRange = @"SP_SELECTED_TEXT_RANGE"; NSString *SPBundleShellVariableUsedQueryForTable = @"SP_USED_QUERY_FOR_TABLE"; -const NSInteger SPBundleRedirectActionNone = 200; -const NSInteger SPBundleRedirectActionReplaceSection = 201; -const NSInteger SPBundleRedirectActionReplaceContent = 202; -const NSInteger SPBundleRedirectActionInsertAsText = 203; -const NSInteger SPBundleRedirectActionInsertAsSnippet = 204; -const NSInteger SPBundleRedirectActionShowAsHTML = 205; -const NSInteger SPBundleRedirectActionShowAsTextTooltip = 207; -const NSInteger SPBundleRedirectActionShowAsHTMLTooltip = 208; -const NSInteger SPBundleRedirectActionLastCode = 208; - // URL scheme NSString *SPURLSchemeQueryInputPathHeader = @"/tmp/SP_QUERY_"; NSString *SPURLSchemeQueryResultPathHeader = @"/tmp/SP_QUERY_RESULT_"; -- cgit v1.2.3 From 33fd38501be11213968536a0c540cee7061e42a9 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 02:45:23 +0100 Subject: Mark issue for s.o. to look at --- Source/SPTableContentDelegate.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index f6b933f7..2f78a120 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -367,10 +367,11 @@ else { tmp = [tableContentView draggedRowsAsTabString]; } - + +#warning code inside "if" is unreachable if (!tmp && [tmp length]) { - [pboard declareTypes:[NSArray arrayWithObjects: NSTabularTextPboardType, NSStringPboardType, nil] owner:nil]; + [pboard declareTypes:@[NSTabularTextPboardType, NSStringPboardType] owner:nil]; [pboard setString:tmp forType:NSStringPboardType]; [pboard setString:tmp forType:NSTabularTextPboardType]; -- cgit v1.2.3 From 4ad26db45b46d8267fcb5203571b81bc8949b853 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 03:01:19 +0100 Subject: Reformatting code for modern ObjC Replaced all [NSNumber numberWithBool:YES/NO] with the @YES/@NO literals. Also replaced some TRUE/FALSE with their YES/NO counterparts. --- Frameworks/PSMTabBar/PSMTabBarController.m | 2 +- .../Delegate & Proxy.m | 2 +- Source/MGTemplateEngine.m | 12 ++--- Source/MGTemplateStandardMarkers.m | 4 +- Source/SPBundleEditorController.m | 6 +-- Source/SPContentFilterManager.m | 6 +-- Source/SPCustomQuery.m | 2 +- Source/SPDataImport.m | 12 ++--- Source/SPDataStorage.m | 2 +- Source/SPDatabaseDocument.m | 52 +++++++++++----------- Source/SPExportController.m | 30 ++++++------- Source/SPExportInitializer.m | 6 +-- Source/SPFieldMapperController.m | 8 ++-- Source/SPNavigatorController.m | 2 +- Source/SPPreferencesUpgrade.m | 2 +- Source/SPQueryController.m | 8 ++-- Source/SPQueryFavoriteManager.m | 4 +- Source/SPSSHTunnel.m | 2 +- Source/SPTableContent.m | 2 +- Source/SPTableData.m | 49 ++++++++++---------- Source/SPTableStructure.m | 4 +- Source/SPTableStructureLoading.m | 2 +- Source/SPTablesList.m | 28 ++++++------ Source/SPUserManager.m | 8 ++-- Source/SPWindowManagement.m | 12 ++--- 25 files changed, 132 insertions(+), 135 deletions(-) diff --git a/Frameworks/PSMTabBar/PSMTabBarController.m b/Frameworks/PSMTabBar/PSMTabBarController.m index 4ab2c1ef..eddf4174 100644 --- a/Frameworks/PSMTabBar/PSMTabBarController.m +++ b/Frameworks/PSMTabBar/PSMTabBarController.m @@ -633,7 +633,7 @@ static NSInteger potentialMinimumForArray(NSArray *array, NSInteger minimum) } } - return TRUE; + return YES; } - (NSInteger)numberOfItemsInMenu:(NSMenu *)menu diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m index 85b2db9b..be6d054b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m @@ -111,7 +111,7 @@ // Trigger a reconnect depending on connection usage recently. If the connection has // actively been used in the last couple of minutes, trigger a full reconnection attempt. if (_elapsedSecondsSinceAbsoluteTime(lastConnectionUsedTime) < 60 * 2) { - reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:[NSNumber numberWithBool:YES]] autorelease]; + reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:@YES] autorelease]; [reconnectionThread setName:@"SPMySQL reconnection thread (full)"]; [reconnectionThread start]; diff --git a/Source/MGTemplateEngine.m b/Source/MGTemplateEngine.m index a6e15c2a..941a7e1b 100644 --- a/Source/MGTemplateEngine.m +++ b/Source/MGTemplateEngine.m @@ -408,12 +408,12 @@ nil], GLOBAL_ENGINE_DELIMITERS, nil] forKey:GLOBAL_ENGINE_GROUP]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"true"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"false"]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"YES"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"NO"]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"yes"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"no"]; + [_globals setObject:@YES forKey:@"true"]; + [_globals setObject:@NO forKey:@"false"]; + [_globals setObject:@YES forKey:@"YES"]; + [_globals setObject:@NO forKey:@"NO"]; + [_globals setObject:@YES forKey:@"yes"]; + [_globals setObject:@NO forKey:@"no"]; _outputDisabledCount = 0; [templateContents release]; templateContents = [templateString retain]; diff --git a/Source/MGTemplateStandardMarkers.m b/Source/MGTemplateStandardMarkers.m index 3421abe3..db765aef 100644 --- a/Source/MGTemplateStandardMarkers.m +++ b/Source/MGTemplateStandardMarkers.m @@ -231,7 +231,7 @@ // Disable output for this block. *blockStarted = YES; NSMutableDictionary *stackFrame = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], FOR_STACK_DISABLED_OUTPUT, + @YES, FOR_STACK_DISABLED_OUTPUT, [NSValue valueWithRange:markerRange], STACK_START_MARKER_RANGE, [NSValue valueWithRange:*nextRange], STACK_START_REMAINING_RANGE, nil]; @@ -426,7 +426,7 @@ } // Note that we've now seen the else marker. - [frame setObject:[NSNumber numberWithBool:YES] forKey:IF_ELSE_SEEN]; + [frame setObject:@YES forKey:IF_ELSE_SEEN]; } } diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 8ae9ceac..4aaa7cad 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -951,7 +951,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; if([[saveDict description] isEqualToString:[cmdData description]]) return YES; if([cmdData objectForKey:SPBundleFileIsDefaultBundleKey]) - [saveDict setObject:[NSNumber numberWithBool:YES] forKey:SPBundleFileDefaultBundleWasModifiedKey]; + [saveDict setObject:@YES forKey:SPBundleFileDefaultBundleWasModifiedKey]; } if (cmdData) [cmdData release]; } @@ -1357,9 +1357,9 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; //abort editing [control abortEditing]; [[NSApp mainWindow] makeFirstResponder:commandsOutlineView]; - return TRUE; + return YES; } else{ - return FALSE; + return NO; } } diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 1322aa4a..9fe255ef 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -679,10 +679,10 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [contentFilterNameTextField setStringValue: [[contentFilters objectAtIndex:[contentFilterTableView selectedRow]] objectForKey:@"MenuLabel"]]; - return TRUE; + return YES; } - return FALSE; + return NO; } /** @@ -931,7 +931,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; [spfdata setObject:@"content filters" forKey:@"format"]; - [spfdata setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfdata setObject:@NO forKey:@"encrypted"]; NSIndexSet *indexes = [contentFilterTableView selectedRowIndexes]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 083de5c3..acfe7eac 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3918,7 +3918,7 @@ // Preserve the focus [[tableDocumentInstance parentWindow] makeFirstResponder:customQueryView]; - return TRUE; + return YES; } } diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 26c56348..ed17a506 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -662,7 +662,7 @@ [tablesListInstance updateTables:self]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; // Import finished Growl notification [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished" @@ -1178,7 +1178,7 @@ [tablesListInstance performSelectorOnMainThread:@selector(updateTables:) withObject:self waitUntilDone:YES]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; // Select the new table [tablesListInstance selectItemWithName:selectedTableTarget]; @@ -1215,7 +1215,7 @@ nil, nil, NSLocalizedString(@"Could not parse file as CSV", @"Error when we can't parse/split file as CSV") ); - return FALSE; + return YES; } // Sanity check the first row of the CSV to prevent hang loops caused by wrong line ending entry @@ -1228,7 +1228,7 @@ nil, nil, NSLocalizedString(@"The CSV was read as containing more than 512 columns, more than the maximum columns permitted for speed reasons by Sequel Pro.\n\nThis usually happens due to errors reading the CSV; please double-check the CSV to be imported and the line endings and escape characters at the bottom of the CSV selection dialog.", @"Error when CSV appears to have too many columns to import, probably due to line ending mismatch") ); - return FALSE; + return NO; } fieldMappingImportArrayIsPreview = dataIsPreviewData; @@ -1262,7 +1262,7 @@ // If the mapping was cancelled, abort the import if (fieldMapperSheetStatus == SPFieldMapperCancelled) { if (fieldMapperController) [fieldMapperController release]; - return FALSE; + return NO; } // Get mapping settings and preset some global variables @@ -1290,7 +1290,7 @@ { if(fieldMapperController) [fieldMapperController release]; NSBeep(); - return FALSE; + return NO; } // Store target table definitions diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m index ed50c7fc..30be0644 100644 --- a/Source/SPDataStorage.m +++ b/Source/SPDataStorage.m @@ -391,7 +391,7 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore if (columnIndex >= numberOfColumns) { [NSException raise:NSRangeException format:@"Invalid column set as unloaded; requested column index (%llu) beyond bounds (%llu)", (unsigned long long)columnIndex, (unsigned long long)numberOfColumns]; } - unloadedColumns[columnIndex] = true; + unloadedColumns[columnIndex] = YES; } #pragma mark - Basic information diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 654f06cd..4f09b3a8 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -552,10 +552,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; notificationName:@"Connected"]; // Init Custom Query editor with the stored queries in a spf file if given. - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; + [spfDocData setObject:@NO forKey:@"save_editor_content"]; if (spfSession != nil && [spfSession objectForKey:@"queries"]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"save_editor_content"]; + [spfDocData setObject:@YES forKey:@"save_editor_content"]; if ([[spfSession objectForKey:@"queries"] isKindOfClass:[NSData class]]) { NSString *q = [[NSString alloc] initWithData:[[spfSession objectForKey:@"queries"] decompress] encoding:NSUTF8StringEncoding]; [self initQueryEditorWithString:q]; @@ -1012,7 +1012,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [self _addDatabase]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } else { // Reset chooseDatabaseButton @@ -3072,7 +3072,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } } - [fileManager createDirectoryAtPath:fileName withIntermediateDirectories:TRUE attributes:nil error:&error]; + [fileManager createDirectoryAtPath:fileName withIntermediateDirectories:YES attributes:nil error:&error]; if(error != nil) { NSAlert *errorAlert = [NSAlert alertWithError:error]; @@ -3080,7 +3080,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return; } - [fileManager createDirectoryAtPath:[NSString stringWithFormat:@"%@/Contents", fileName] withIntermediateDirectories:TRUE attributes:nil error:&error]; + [fileManager createDirectoryAtPath:[NSString stringWithFormat:@"%@/Contents", fileName] withIntermediateDirectories:YES attributes:nil error:&error]; if(error != nil) { NSAlert *errorAlert = [NSAlert alertWithError:error]; @@ -3142,12 +3142,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // save it as temporary spf file inside the bundle with save panel options spfDocData_temp [doc saveDocumentWithFilePath:filePath inBackground:NO onlyPreferences:NO contextInfo:[NSDictionary dictionaryWithDictionary:spfDocData_temp]]; [doc setIsSavedInBundle:YES]; - [tabData setObject:[NSNumber numberWithBool:NO] forKey:@"isAbsolutePath"]; + [tabData setObject:@NO forKey:@"isAbsolutePath"]; [tabData setObject:newName forKey:@"path"]; } else { // save it to the original location and take the file's spfDocData [doc saveDocumentWithFilePath:[[doc fileURL] path] inBackground:YES onlyPreferences:NO contextInfo:nil]; - [tabData setObject:[NSNumber numberWithBool:YES] forKey:@"isAbsolutePath"]; + [tabData setObject:@YES forKey:@"isAbsolutePath"]; [tabData setObject:[[doc fileURL] path] forKey:@"path"]; } [tabs addObject:tabData]; @@ -3219,7 +3219,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionAutoConnect state]==NSOnState) ? YES : NO ] forKey:@"auto_connect"]; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionSavePassword state]==NSOnState) ? YES : NO ] forKey:@"save_password"]; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionIncludeData state]==NSOnState) ? YES : NO ] forKey:@"include_session"]; - [spfDocData_temp setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; + [spfDocData_temp setObject:@NO forKey:@"save_editor_content"]; if([[[[customQueryInstance valueForKeyPath:@"textView"] textStorage] string] length]) [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionIncludeQuery state]==NSOnState) ? YES : NO ] forKey:@"save_editor_content"]; @@ -3334,23 +3334,23 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Set up the document details to store NSMutableDictionary *stateDetailsToSave = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", + @YES, @"connection", + @YES, @"history", nil]; // Include session data like selected table, view etc. ? if ([[spfDocData_temp objectForKey:@"include_session"] boolValue]) - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"session"]; + [stateDetailsToSave setObject:@YES forKey:@"session"]; // Include the query editor contents if asked to if ([[spfDocData_temp objectForKey:@"save_editor_content"] boolValue]) { - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"query"]; - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"enablecompression"]; + [stateDetailsToSave setObject:@YES forKey:@"query"]; + [stateDetailsToSave setObject:@YES forKey:@"enablecompression"]; } // Add passwords if asked to if ([[spfDocData_temp objectForKey:@"save_password"] boolValue]) - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"password"]; + [stateDetailsToSave setObject:@YES forKey:@"password"]; // Retrieve details and add to the appropriate dictionaries NSMutableDictionary *stateDetails = [NSMutableDictionary dictionaryWithDictionary:[self stateIncludingDetails:stateDetailsToSave]]; @@ -3444,16 +3444,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Get the current state NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *currentState = [NSMutableDictionary dictionaryWithDictionary:[self stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect, and clear the table - [currentState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [currentState setObject:@YES forKey:@"auto_connect"]; NSMutableDictionary *sessionDict = [NSMutableDictionary dictionaryWithDictionary:[currentState objectForKey:@"session"]]; [sessionDict removeObjectForKey:@"table"]; [currentState setObject:sessionDict forKey:@"session"]; @@ -4917,16 +4917,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [data setObject:[spf objectForKey:SPContentFilters] forKey:SPContentFilters]; // Ensure the encryption status is stored in the spfDocData store for future saves - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfDocData setObject:@NO forKey:@"encrypted"]; if (encryptpw != nil) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"encrypted"]; + [spfDocData setObject:@YES forKey:@"encrypted"]; [spfDocData setObject:encryptpw forKey:@"e_string"]; } encryptpw = nil; // If session data is available, ensure it is marked for save if ([data objectForKey:@"session"]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"include_session"]; + [spfDocData setObject:@YES forKey:@"include_session"]; } if (![self isSaveInBundle]) { @@ -4935,11 +4935,11 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfDocData setObject:[NSNumber numberWithBool:([[data objectForKey:@"connection"] objectForKey:@"password"]) ? YES : NO] forKey:@"save_password"]; - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"auto_connect"]; + [spfDocData setObject:@NO forKey:@"auto_connect"]; if([spf objectForKey:@"auto_connect"] && [[spf valueForKey:@"auto_connect"] boolValue]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; - [data setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [spfDocData setObject:@YES forKey:@"auto_connect"]; + [data setObject:@YES forKey:@"auto_connect"]; } // Set the state dictionary, triggering an autoconnect if appropriate diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 3fb07267..4a97ae00 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -191,9 +191,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; // Disable all tables for (NSMutableArray *table in tables) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:NO]]; - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:NO]]; - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:1 withObject:@NO]; + [table replaceObjectAtIndex:2 withObject:@NO]; + [table replaceObjectAtIndex:3 withObject:@NO]; } // Select the supplied tables @@ -202,9 +202,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; for (NSString *exportTable in exportTables) { if ([exportTable isEqualToString:[table objectAtIndex:0]]) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]]; - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]]; - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]]; + [table replaceObjectAtIndex:1 withObject:@YES]; + [table replaceObjectAtIndex:2 withObject:@YES]; + [table replaceObjectAtIndex:3 withObject:@YES]; } } } @@ -436,9 +436,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; for (id itemName in tablesAndViews) { [tables addObject:[NSMutableArray arrayWithObjects: itemName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeTable], nil]]; } @@ -451,9 +451,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; { [tables addObject:[NSMutableArray arrayWithObjects: procName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeProc], nil]]; } @@ -464,9 +464,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; { [tables addObject:[NSMutableArray arrayWithObjects: funcName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeFunc], nil]]; } diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index bb59dd60..9c626a53 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -126,15 +126,15 @@ // Check the overall export settings if ([[table objectAtIndex:1] boolValue] && (![exportSQLIncludeStructureCheck state])) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:1 withObject:@NO]; } if ([[table objectAtIndex:2] boolValue] && (![exportSQLIncludeContentCheck state])) { - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:2 withObject:@NO]; } if ([[table objectAtIndex:3] boolValue] && (![exportSQLIncludeDropSyntaxCheck state])) { - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:3 withObject:@NO]; } [exportTables addObject:table]; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 397c017f..aaa6c0bc 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -1120,7 +1120,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; - (IBAction)addGlobalValue:(id)sender { [fieldMappingGlobalValues addObject:@""]; - [fieldMappingGlobalValuesSQLMarked addObject:[NSNumber numberWithBool:NO]]; + [fieldMappingGlobalValuesSQLMarked addObject:@NO]; [globalValuesTableView reloadData]; [globalValuesTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[fieldMappingGlobalValues count]-1-numberOfImportColumns] byExtendingSelection:NO]; [globalValuesTableView editColumn:1 row:[fieldMappingGlobalValues count]-1-numberOfImportColumns withEvent:nil select:YES]; @@ -1432,7 +1432,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; } // Sort the matrix according distance - NSSortDescriptor *sortByDistance = [[[NSSortDescriptor alloc] initWithKey:@"dist" ascending:TRUE] autorelease]; + NSSortDescriptor *sortByDistance = [[[NSSortDescriptor alloc] initWithKey:@"dist" ascending:YES] autorelease]; [distMatrix sortUsingDescriptors:[NSArray arrayWithObjects:sortByDistance, nil]]; NSMutableArray *matchedFile = [NSMutableArray array]; @@ -2091,10 +2091,10 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Preserve the focus [[fieldMapperTableView window] makeFirstResponder:fieldMapperTableView]; - return TRUE; + return YES; } - return FALSE; + return NO; } diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 1a7e52fd..67070472 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -611,7 +611,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if (![[doc getConnection] isConnected]) return; - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } - (IBAction)outlineViewAction:(id)sender diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index d4a9ca84..6151f675 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -76,7 +76,7 @@ void SPApplyRevisionChanges(void) } // Inform SPAppController to check installed default Bundles for available updates - [prefs setObject:[NSNumber numberWithBool:YES] forKey:@"doBundleUpdate"]; + [prefs setObject:@YES forKey:@"doBundleUpdate"]; // For versions prior to r336 (0.9.4), where column widths have been saved, walk through them and remove // any table widths set to 15 or less (fix for mangled columns caused by Issue #140) diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 718a5ff3..3e33b533 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -458,7 +458,7 @@ static SPQueryController *sharedQueryController = nil; [progressIndicator startAnimation:self]; // Don't allow clearing the console while filtering its content - [self _allowFilterClearOrSave:[NSNumber numberWithBool:NO]]; + [self _allowFilterClearOrSave:@NO]; [messagesFilteredSet removeAllObjects]; @@ -470,7 +470,7 @@ static SPQueryController *sharedQueryController = nil; [consoleTableView reloadData]; [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; - [self _allowFilterClearOrSave:[NSNumber numberWithBool:YES]]; + [self _allowFilterClearOrSave:@YES]; [saveConsoleButton setTitle:NSLocalizedString(@"Save As...", @"save as button title")]; @@ -502,7 +502,7 @@ static SPQueryController *sharedQueryController = nil; [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; if ([messagesVisibleSet count] > 0) { - [self _allowFilterClearOrSave:[NSNumber numberWithBool:YES]]; + [self _allowFilterClearOrSave:@YES]; } [saveConsoleButton setTitle:NSLocalizedString(@"Save View As...", @"save view as button title")]; @@ -623,7 +623,7 @@ static SPQueryController *sharedQueryController = nil; && [self _messageMatchesCurrentFilters:[consoleMessage message]]) { [messagesFilteredSet addObject:[messagesFullSet lastObject]]; - [self performSelectorOnMainThread:@selector(_allowFilterClearOrSave:) withObject:[NSNumber numberWithBool:YES] waitUntilDone:NO]; + [self performSelectorOnMainThread:@selector(_allowFilterClearOrSave:) withObject:@YES waitUntilDone:NO]; } // Reload the table and scroll to the new message if it's visible (for speed) diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 97f7790b..a7147646 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -422,7 +422,7 @@ // Identify the tab completion index NSRange snippetNumberRange = [queryString rangeOfRegex:snipRegex options:RKLNoOptions inRange:matchedRange capture:1L error:NULL]; NSInteger snippetNumber = [[queryString substringWithRange:snippetNumberRange] integerValue]; - [snippetNumbers setObject:[NSNumber numberWithBool:YES] forKey:[NSNumber numberWithInteger:snippetNumber]]; + [snippetNumbers setObject:@YES forKey:[NSNumber numberWithInteger:snippetNumber]]; rangeStart = matchedRange.location + matchedRange.length; } @@ -919,7 +919,7 @@ [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; [spfdata setObject:@"query favorites" forKey:@"format"]; - [spfdata setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfdata setObject:@NO forKey:@"encrypted"]; NSIndexSet *indexes = [favoritesTableView selectedRowIndexes]; diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index ff220318..20f1aa43 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -116,7 +116,7 @@ delegate = theDelegate; stateChangeSelector = theStateChangeSelector; - return true; + return YES; } /* diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 892fe30f..9e190cb2 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3851,7 +3851,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper NSUInteger indexCount = [selectedRowIndexes getIndexes:indexBuffer maxCount:[selectedRowIndexes count] inIndexRange:NULL]; NSMutableDictionary *selectedRowLookupTable = [NSMutableDictionary dictionaryWithCapacity:indexCount]; - NSNumber *trueNumber = [NSNumber numberWithBool:YES]; + NSNumber *trueNumber = @YES; for (NSUInteger i = 0; i < indexCount; i++) { // For single-column primary keys, use the cell value as a dictionary key for fast lookups diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 5158d4be..00de39da 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -390,7 +390,7 @@ // The table information fetch may have already unlocked the data lock. pthread_mutex_trylock(&dataProcessingLock); pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } [columns addObjectsFromArray:[tableData objectForKey:@"columns"]]; @@ -408,7 +408,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -431,7 +431,7 @@ [columnNames removeAllObjects]; [constraints removeAllObjects]; pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } [columns addObjectsFromArray:[viewData objectForKey:@"columns"]]; @@ -448,7 +448,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -915,9 +915,9 @@ // If there's a null column, use the details from it if ([resultRow objectForKey:@"Null"]) { if ([[[resultRow objectForKey:@"Null"] uppercaseString] isEqualToString:@"NO"]) { - [tableColumn setValue:[NSNumber numberWithBool:NO] forKey:@"null"]; + [tableColumn setValue:@NO forKey:@"null"]; } else { - [tableColumn setValue:[NSNumber numberWithBool:YES] forKey:@"null"]; + [tableColumn setValue:@YES forKey:@"null"]; } } @@ -957,7 +957,7 @@ // Catch unselected tables and return false if (![tableListInstance tableName]) { pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Ensure queries are run as UTF8 @@ -1004,7 +1004,7 @@ if (changeEncoding) [mySQLConnection restoreStoredEncoding]; } pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Retrieve the status as a dictionary and set as the cache @@ -1022,7 +1022,7 @@ [status setDictionary:[NSDictionary dictionaryWithObjectsAndKeys:@"Error", @"Engine", [NSString stringWithFormat:NSLocalizedString(@"An error occurred retrieving table information. MySQL said: %@", @"MySQL table info retrieval error message"), [status objectForKey:@"Comment"]], @"Comment", [tableListInstance tableName], @"Name", nil]]; if (changeEncoding) [mySQLConnection restoreStoredEncoding]; pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Add a note for whether the row count is accurate or not - only for MyISAM @@ -1058,7 +1058,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -1267,16 +1267,13 @@ [detailString release]; - NSNumber *boolYES = [NSNumber numberWithBool:YES]; - NSNumber *boolNO = [NSNumber numberWithBool:NO]; - // Set up some column defaults for all columns - [fieldDetails setValue:boolYES forKey:@"null"]; - [fieldDetails setValue:boolNO forKey:@"unsigned"]; - [fieldDetails setValue:boolNO forKey:@"binary"]; - [fieldDetails setValue:boolNO forKey:@"zerofill"]; - [fieldDetails setValue:boolNO forKey:@"autoincrement"]; - [fieldDetails setValue:boolNO forKey:@"onupdatetimestamp"]; + [fieldDetails setValue:@YES forKey:@"null"]; + [fieldDetails setValue:@NO forKey:@"unsigned"]; + [fieldDetails setValue:@NO forKey:@"binary"]; + [fieldDetails setValue:@NO forKey:@"zerofill"]; + [fieldDetails setValue:@NO forKey:@"autoincrement"]; + [fieldDetails setValue:@NO forKey:@"onupdatetimestamp"]; [fieldDetails setValue:@"" forKey:@"comment"]; [fieldDetails setValue:[NSMutableString string] forKey:@"unparsed"]; @@ -1288,15 +1285,15 @@ // Whether numeric fields are unsigned if ([detailString isEqualToString:@"UNSIGNED"]) { - [fieldDetails setValue:boolYES forKey:@"unsigned"]; + [fieldDetails setValue:@YES forKey:@"unsigned"]; // Whether numeric fields are zerofill } else if ([detailString isEqualToString:@"ZEROFILL"]) { - [fieldDetails setValue:boolYES forKey:@"zerofill"]; + [fieldDetails setValue:@YES forKey:@"zerofill"]; // Whether text types are binary } else if ([detailString isEqualToString:@"BINARY"]) { - [fieldDetails setValue:boolYES forKey:@"binary"]; + [fieldDetails setValue:@YES forKey:@"binary"]; // Whether text types have a different encoding to the table } else if ([detailString isEqualToString:@"CHARSET"] && (definitionPartsIndex + 1 < partsArrayLength)) { @@ -1321,16 +1318,16 @@ // Whether fields are NOT NULL } else if ([detailString isEqualToString:@"NOT"] && (definitionPartsIndex + 1 < partsArrayLength) && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+1) uppercaseString] isEqualToString:@"NULL"]) { - [fieldDetails setValue:boolNO forKey:@"null"]; + [fieldDetails setValue:@NO forKey:@"null"]; definitionPartsIndex++; // Whether fields are NULL } else if ([detailString isEqualToString:@"NULL"]) { - [fieldDetails setValue:boolYES forKey:@"null"]; + [fieldDetails setValue:@YES forKey:@"null"]; // Whether fields should auto-increment } else if ([detailString isEqualToString:@"AUTO_INCREMENT"]) { - [fieldDetails setValue:boolYES forKey:@"autoincrement"]; + [fieldDetails setValue:@YES forKey:@"autoincrement"]; tableHasAutoIncrementField = YES; // Field defaults @@ -1347,7 +1344,7 @@ } else if ([detailString isEqualToString:@"ON"] && (definitionPartsIndex + 2 < partsArrayLength) && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+1) uppercaseString] isEqualToString:@"UPDATE"] && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+2) uppercaseString] isEqualToString:@"CURRENT_TIMESTAMP"]) { - [fieldDetails setValue:boolYES forKey:@"onupdatetimestamp"]; + [fieldDetails setValue:@YES forKey:@"onupdatetimestamp"]; definitionPartsIndex += 2; // Column comments diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 05bf1186..310af941 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -964,7 +964,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [tableDocumentInstance setContentRequiresReload:YES]; // Query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", selectedTable, @"affectedItem", [NSNumber numberWithInteger:[tablesListInstance tableType]], @"affectedItemType", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", selectedTable, @"affectedItem", [NSNumber numberWithInteger:[tablesListInstance tableType]], @"affectedItemType", nil]]; return YES; } @@ -1059,7 +1059,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; // on the main thread ensures the timer fires on the main thread. if (![errorDictionary objectForKey:@"delayed"]) { NSMutableDictionary *delayedErrorDictionary = [NSMutableDictionary dictionaryWithDictionary:errorDictionary]; - [delayedErrorDictionary setObject:[NSNumber numberWithBool:YES] forKey:@"delayed"]; + [delayedErrorDictionary setObject:@YES forKey:@"delayed"]; [self performSelector:@selector(showErrorSheetWith:) withObject:delayedErrorDictionary afterDelay:0.3]; return; } diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index 9e9edd5c..a2a90f40 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -290,7 +290,7 @@ [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; [self loadTable:selectedTable]; } diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index fdabd3af..458389c2 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -360,7 +360,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:nil]; else // User press refresh button ergo force update - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", [NSNumber numberWithBool:YES], @"cancelQuerying", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", @YES, @"cancelQuerying", nil]]; } /** @@ -705,16 +705,16 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; { // Get the state of the document NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *documentState = [NSMutableDictionary dictionaryWithDictionary:[tableDocumentInstance stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect - [documentState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [documentState setObject:@YES forKey:@"auto_connect"]; // Set the connection on the new tab [[[NSApp delegate] frontDocument] setState:documentState]; @@ -1621,7 +1621,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } #ifndef SP_CODA @@ -1637,7 +1637,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // When enter/return is used, save the row. if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(insertNewline:)] ) { [[control window] makeFirstResponder:control]; - return TRUE; + return YES; // When the escape key is used, abort the rename. } else if ( [[control window] methodForSelector:command] == [[control window] methodForSelector:@selector(cancelOperation:)] || @@ -1646,9 +1646,9 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [control abortEditing]; [[NSApp mainWindow] makeFirstResponder:tablesListView]; - return TRUE; + return YES; } else{ - return FALSE; + return NO; } } #endif @@ -2279,7 +2279,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } #ifndef SP_CODA /* operations performed on whole tables */ @@ -2430,7 +2430,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } else { // Error while creating new table @@ -2637,7 +2637,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [tableDocumentInstance loadTable:selectedTableName ofType:selectedTableType]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } } } diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 3ac9e5de..917c73ae 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -183,7 +183,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; [privKey replaceOccurrencesOfString:@" " withString:@"_" options:NSLiteralSearch range:NSMakeRange(0, [privKey length])]; [privKey appendString:@"_priv"]; - [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:privKey]; + [[self privsSupportedByServer] setValue:@YES forKey:privKey]; } } // If that fails, base privilege support on the mysql.users columns @@ -200,7 +200,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; if ([privColumnToGrantMap objectForKey:privKey]) privKey = [privColumnToGrantMap objectForKey:privKey]; - [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:[privKey lowercaseString]]; + [[self privsSupportedByServer] setValue:@YES forKey:[privKey lowercaseString]]; } } @@ -580,7 +580,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; // Perform the change in a try/catch check to avoid exceptions for unhandled privs NS_DURING - [selectedUser setValue:[NSNumber numberWithBool:YES] forKey:key]; + [selectedUser setValue:@YES forKey:key]; NS_HANDLER NS_ENDHANDLER } @@ -600,7 +600,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; // Perform the change in a try/catch check to avoid exceptions for unhandled privs NS_DURING - [selectedUser setValue:[NSNumber numberWithBool:NO] forKey:key]; + [selectedUser setValue:@NO forKey:key]; NS_HANDLER NS_ENDHANDLER } diff --git a/Source/SPWindowManagement.m b/Source/SPWindowManagement.m index 000bbe3f..022ad7fa 100644 --- a/Source/SPWindowManagement.m +++ b/Source/SPWindowManagement.m @@ -117,17 +117,17 @@ // Get the state of the previously-frontmost document NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *frontState = [NSMutableDictionary dictionaryWithDictionary:[theFrontDocument stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect - [frontState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [frontState setObject:@YES forKey:@"auto_connect"]; // Set the connection on the new tab [[self frontDocument] setState:frontState]; -- cgit v1.2.3 From 3cf0254e55d558565775e6cb20d36ea7e54beca1 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 03:12:41 +0100 Subject: Replace boxed integers in code with @ literals --- Source/GeneratePreviewForURL.m | 2 +- Source/MGTemplateStandardMarkers.m | 2 +- Source/SPAppController.m | 12 ++++++------ Source/SPConnectionController.m | 4 ++-- Source/SPContentFilterManager.m | 2 +- Source/SPCustomQuery.m | 14 +++++++------- Source/SPDatabaseDocument.m | 18 +++++++++--------- Source/SPFieldMapperController.m | 10 +++++----- Source/SPNavigatorController.m | 20 ++++++++++---------- Source/SPPreferencesUpgrade.m | 8 ++++---- Source/SPPrintController.m | 2 +- Source/SPQueryFavoriteManager.m | 2 +- Source/SPTableContent.m | 14 +++++++------- Source/SPTableData.m | 4 ++-- Source/SPTableInfo.m | 4 ++-- Source/SPTableStructure.m | 4 ++-- Source/SPTableStructureDelegate.m | 6 +++--- Source/SPTableStructureLoading.m | 2 +- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index 2e0fc0cb..034d7bd1 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -488,7 +488,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, imgProps = [[NSMutableDictionary alloc] initWithCapacity:2]; [props setObject:[NSNumber numberWithInteger:previewHeight] forKey:(NSString *)kQLPreviewPropertyHeightKey]; - [props setObject:[NSNumber numberWithInt:600] forKey:(NSString *)kQLPreviewPropertyWidthKey]; + [props setObject:@600 forKey:(NSString *) kQLPreviewPropertyWidthKey]; if(image) { [imgProps setObject:@"image/tiff" forKey:(NSString *)kQLPreviewPropertyMIMETypeKey]; diff --git a/Source/MGTemplateStandardMarkers.m b/Source/MGTemplateStandardMarkers.m index db765aef..543d16a7 100644 --- a/Source/MGTemplateStandardMarkers.m +++ b/Source/MGTemplateStandardMarkers.m @@ -522,7 +522,7 @@ } else { // New cycle. Create and output appropriately. cycle = [NSMutableDictionary dictionaryWithCapacity:2]; - [cycle setObject:[NSNumber numberWithInteger:0] forKey:CYCLE_INDEX]; + [cycle setObject:@0 forKey:CYCLE_INDEX]; [cycle setObject:args forKey:CYCLE_VALUES]; [cycles setObject:cycle forKey:rangeKey]; return [args objectAtIndex:0]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 44f3513d..ba9c6cab 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1243,12 +1243,12 @@ SPDatabaseDocument* frontMostDoc = [self frontDocument]; if(frontMostDoc) { if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) - [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [frontMostDoc setActivityPaneHidden:@1]; } } @@ -1268,12 +1268,12 @@ SPDatabaseDocument* frontMostDoc = [self frontDocument]; if(frontMostDoc) { if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) - [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [frontMostDoc setActivityPaneHidden:@1]; } } } diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index a91f6929..905975dc 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -781,11 +781,11 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, NSArray *objects = [NSArray arrayWithObjects: NSLocalizedString(@"New Favorite", @"new favorite name"), - [NSNumber numberWithInteger:0], + @0, @"", @"", @"", - [NSNumber numberWithInteger:-1], + @(-1), @"", [NSNumber numberWithInt:NSOffState], [NSNumber numberWithInt:NSOffState], diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 9fe255ef..c08e84b9 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -929,7 +929,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; NSMutableArray *filterData = [NSMutableArray array]; - [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfdata setObject:@1 forKey:@"version"]; [spfdata setObject:@"content filters" forKey:@"format"]; [spfdata setObject:@NO forKey:@"encrypted"]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index acfe7eac..ba053dbf 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1808,7 +1808,7 @@ NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[customQueryView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil]; + return [NSArray arrayWithObjects:@(-2), @"", nil]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -1819,13 +1819,13 @@ // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -1837,7 +1837,7 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -1847,7 +1847,7 @@ fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -1857,14 +1857,14 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } } diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 4f09b3a8..a377a8ec 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -330,7 +330,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [tableTabView setTabViewType:NSNoTabsNoBorder]; // Hide the activity list - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + [self setActivityPaneHidden:@1]; // Load additional nibs, keeping track of the top-level objects to allow correct release NSArray *connectionDialogTopLevelObjects = nil; @@ -3114,7 +3114,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"save_password"] boolValue]] forKey:@"save_password"]; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"include_session"] boolValue]] forKey:@"include_session"]; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"save_editor_content"] boolValue]] forKey:@"save_editor_content"]; - [info setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [info setObject:@1 forKey:@"version"]; [info setObject:@"connection bundle" forKey:@"format"]; // Loop through all windows @@ -3323,7 +3323,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSMutableDictionary *spfData = [NSMutableDictionary dictionary]; // Add basic details - [spfStructure setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfStructure setObject:@1 forKey:@"version"]; [spfStructure setObject:@"connection" forKey:@"format"]; [spfStructure setObject:@"mysql" forKey:@"rdbms_type"]; if([self mySQLVersion]) @@ -5592,12 +5592,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self]; if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) - [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [self setActivityPaneHidden:@1]; } } @@ -5613,12 +5613,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) - [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [self setActivityPaneHidden:@1]; } [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self]; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index aaa6c0bc..52b799d0 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -83,11 +83,11 @@ static NSUInteger SPSourceColumnTypeInteger = 1; fieldMappingGlobalValuesSQLMarked = [[NSMutableArray alloc] init]; fieldMappingArray = nil; - lastDisabledCSVFieldcolumn = [NSNumber numberWithInteger:0]; + lastDisabledCSVFieldcolumn = @0; - doImport = [NSNumber numberWithInteger:0]; - doNotImport = [NSNumber numberWithInteger:1]; - isEqual = [NSNumber numberWithInteger:2]; + doImport = @0; + doNotImport = @1; + isEqual = @2; doImportString = @"―"; doNotImportString = @" "; isEqualString = @"="; @@ -1936,7 +1936,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // If anObject contains $1 etc. enable SQL checkbox if([anObject isMatchedByRegex:@"(? 3) { NSString *field_id = [NSString stringWithFormat:@"%@%@%@", table_id,SPUniqueSchemaDelimiter,[a objectAtIndex:3]]; diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index 6151f675..a412088c 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -214,17 +214,17 @@ void SPApplyRevisionChanges(void) if ([[favorite objectForKey:@"host"] isEqualToString:@"localhost"] || ([favorite objectForKey:@"socket"] && [(NSString *)[favorite objectForKey:@"socket"] length])) { - [favorite setObject:[NSNumber numberWithInteger:1] forKey:@"type"]; + [favorite setObject:@1 forKey:@"type"]; // If SSH details are set, set to tunnel connection } else if ([favorite objectForKey:@"useSSH"] && [[favorite objectForKey:@"useSSH"] integerValue]) { - [favorite setObject:[NSNumber numberWithInteger:2] forKey:@"type"]; + [favorite setObject:@2 forKey:@"type"]; // Default to TCP/IP } else { - [favorite setObject:[NSNumber numberWithInteger:0] forKey:@"type"]; + [favorite setObject:@0 forKey:@"type"]; } // Remove SSH tunnel flag - no longer required @@ -311,7 +311,7 @@ void SPApplyRevisionChanges(void) NSNumber *newMappedValue = [encodingMap valueForKey:[prefs objectForKey:SPOldDefaultEncodingKey]]; - if (newMappedValue == nil) newMappedValue = [NSNumber numberWithInt:0]; + if (newMappedValue == nil) newMappedValue = @0; [prefs setObject:newMappedValue forKey:@"DefaultEncodingTag"]; } diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index 0b8d78c9..70f5662b 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -251,7 +251,7 @@ [printData setObject:indexes forKey:@"indexes"]; [printData setObject:indexColumns forKey:@"indexColumns"]; - if ([indexes count]) [printData setObject:[NSNumber numberWithInteger:1] forKey:@"hasIndexes"]; + if ([indexes count]) [printData setObject:@1 forKey:@"hasIndexes"]; [rows release]; [indexes release]; diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index a7147646..9f96d98a 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -917,7 +917,7 @@ NSMutableArray *favoriteData = [NSMutableArray array]; - [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfdata setObject:@1 forKey:@"version"]; [spfdata setObject:@"query favorites" forKey:@"format"]; [spfdata setObject:@NO forKey:@"encrypted"]; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 9e190cb2..ae49c772 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3333,7 +3333,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[tableContentView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil]; + return [NSArray arrayWithObjects:@(-2), @"", nil]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -3344,13 +3344,13 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -3362,7 +3362,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -3372,7 +3372,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -3382,14 +3382,14 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 00de39da..9d875555 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -743,7 +743,7 @@ [primaryKeyFields addObject:primaryFieldName]; for (NSMutableDictionary *theTableColumn in tableColumns) { if ([[theTableColumn objectForKey:@"name"] isEqualToString:primaryFieldName]) { - [theTableColumn setObject:[NSNumber numberWithInteger:1] forKey:@"isprimarykey"]; + [theTableColumn setObject:@1 forKey:@"isprimarykey"]; break; } } @@ -761,7 +761,7 @@ NSString *uniqueFieldName = [[SPSQLParser stringWithString:quotedUniqueKey] unquotedString]; for (NSMutableDictionary *theTableColumn in tableColumns) { if ([[theTableColumn objectForKey:@"name"] isEqualToString:uniqueFieldName]) { - [theTableColumn setObject:[NSNumber numberWithInteger:1] forKey:@"unique"]; + [theTableColumn setObject:@1 forKey:@"unique"]; break; } } diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 38d06b3e..4bed0226 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -388,11 +388,11 @@ if (rowIndex > 0) return NO; if (![tableInfoScrollView isHidden]) { - [tableDocumentInstance setActivityPaneHidden:[NSNumber numberWithInteger:0]]; + [tableDocumentInstance setActivityPaneHidden:@0]; [[NSApp mainWindow] makeFirstResponder:activitiesTable]; } else { - [tableDocumentInstance setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + [tableDocumentInstance setActivityPaneHidden:@1]; [[NSApp mainWindow] makeFirstResponder:infoTable]; } diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 310af941..1b922683 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -253,12 +253,12 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; BOOL allowNull = [[[tableDataInstance statusValueForKey:@"Engine"] uppercaseString] isEqualToString:@"CSV"] ? NO : [prefs boolForKey:SPNewFieldsAllowNulls]; [tableFields insertObject:[NSMutableDictionary - dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", allowNull ? @"1" : @"0", @"", [prefs stringForKey:SPNullValue], @"None", @"", [NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil] + dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", allowNull ? @"1" : @"0", @"", [prefs stringForKey:SPNullValue], @"None", @"", @0, @0, nil] forKeys:[NSArray arrayWithObjects:@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation", nil]] atIndex:insertIndex]; #else [tableFields insertObject:[NSMutableDictionary - dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", @"1", @"", @"NULL", @"None", @"", [NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil] + dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", @"1", @"", @"NULL", @"None", @"", @0, @0, nil] forKeys:[NSArray arrayWithObjects:@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation", nil]] atIndex:insertIndex]; #endif diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index aebb0f18..4d2f580c 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -145,14 +145,14 @@ // Reset collation if encoding was changed if ([[aTableColumn identifier] isEqualToString:@"encoding"]) { if ([[currentRow objectForKey:@"encoding"] integerValue] != [anObject integerValue]) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"]; + [currentRow setObject:@0 forKey:@"collation"]; [tableSourceView reloadData]; } } // Reset collation if BINARY was set changed, as enabling BINARY sets collation to *_bin else if ([[aTableColumn identifier] isEqualToString:@"binary"]) { if ([[currentRow objectForKey:@"binary"] integerValue] != [anObject integerValue]) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"]; + [currentRow setObject:@0 forKey:@"collation"]; [tableSourceView reloadData]; } @@ -164,7 +164,7 @@ isCurrentExtraAutoIncrement = [[[anObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString] isEqualToString:@"AUTO_INCREMENT"]; if (isCurrentExtraAutoIncrement) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"null"]; + [currentRow setObject:@0 forKey:@"null"]; // Asks the user to add an index to query if AUTO_INCREMENT is set and field isn't indexed if ((![currentRow objectForKey:@"Key"] || [[currentRow objectForKey:@"Key"] isEqualToString:@""])) { diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index a2a90f40..4c4e8c37 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -212,7 +212,7 @@ // Set BINARY if collation ends with _bin for convenience if ([[col objectForKey:@"COLLATION_NAME"] hasSuffix:@"_bin"]) { - [theField setObject:[NSNumber numberWithInt:1] forKey:@"binary"]; + [theField setObject:@1 forKey:@"binary"]; } break; -- cgit v1.2.3 From 994057ae2a82dc110a385ced4239ce49cc0601f8 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 17:20:18 +0100 Subject: Add cast for [NSApp delegate] * (Also changed some outdated URLs) * Replaced [NSApplication sharedApplication] with NSApp --- Frameworks/PSMTabBar/PSMTabBarControl.m | 2 +- Frameworks/SPMySQLFramework/build-mysql-client.sh | 2 +- Source/SPAppController.m | 12 +++--- Source/SPBundleCommandRunner.m | 7 ++-- Source/SPBundleEditorController.m | 5 ++- Source/SPBundleHTMLOutputController.m | 14 +++---- Source/SPChooseMenuItemDialog.m | 2 +- Source/SPConnectionController.m | 8 ++-- Source/SPConnectionControllerDelegate.m | 2 +- Source/SPConstants.h | 2 + Source/SPConstants.m | 2 +- Source/SPContentFilterManager.m | 3 +- Source/SPCopyTable.m | 12 +++--- Source/SPCustomQuery.m | 6 +-- Source/SPDatabaseDocument.m | 46 +++++++++++------------ Source/SPDatabaseViewController.m | 4 +- Source/SPDocumentController.m | 2 +- Source/SPExportFilenameUtilities.m | 2 +- Source/SPNavigatorController.m | 12 +++--- Source/SPProcessListController.m | 4 +- Source/SPQueryDocumentsController.m | 5 ++- Source/SPQueryFavoriteManager.m | 3 +- Source/SPServerVariablesController.m | 2 +- Source/SPTableContentDelegate.m | 4 +- Source/SPTableInfo.m | 3 +- Source/SPTablesList.m | 6 +-- Source/SPTextView.m | 6 +-- Source/SPTextViewAdditions.m | 14 +++---- Source/SPUserManager.m | 8 ++-- Source/SPWindowControllerDelegate.m | 6 +-- Source/Sequel-Pro.pch | 2 +- 31 files changed, 108 insertions(+), 100 deletions(-) diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 7e8eae87..55f9dfcd 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -1497,7 +1497,7 @@ } // NSDraggingSource -- (NSUInteger)draggingSourceOperationMaskForLocal:(BOOL)isLocal +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return (isLocal ? NSDragOperationMove : NSDragOperationNone); } diff --git a/Frameworks/SPMySQLFramework/build-mysql-client.sh b/Frameworks/SPMySQLFramework/build-mysql-client.sh index 5fd1accb..2e7c4fc9 100755 --- a/Frameworks/SPMySQLFramework/build-mysql-client.sh +++ b/Frameworks/SPMySQLFramework/build-mysql-client.sh @@ -30,7 +30,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -# More info at +# More info at # Builds the MySQL client libraries for distrubution in Sequel Pro's MySQL framework. # diff --git a/Source/SPAppController.m b/Source/SPAppController.m index ba9c6cab..8aabce60 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -440,8 +440,8 @@ [spfsDocData setObject:[NSNumber numberWithBool:[[spfs objectForKey:@"save_editor_content"] boolValue]] forKey:@"save_editor_content"]; // Set global session properties - [[NSApp delegate] setSpfSessionDocData:spfsDocData]; - [[NSApp delegate] setSessionURL:[NSURL fileURLWithPath:filePath]]; + [SPAppDelegate setSpfSessionDocData:spfsDocData]; + [SPAppDelegate setSessionURL:[NSURL fileURLWithPath:filePath]]; // Loop through each defined window in reversed order to reconstruct the last active window for (NSDictionary *window in [[[spfs objectForKey:@"windows"] reverseObjectEnumerator] allObjects]) @@ -993,7 +993,7 @@ { NSInteger idx = [sender tag] - 1000000; NSString *infoPath = nil; - NSArray *scopeBundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeGeneral]; + NSArray *scopeBundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeGeneral]; if(idx >=0 && idx < (NSInteger)[scopeBundleItems count]) { infoPath = [[scopeBundleItems objectAtIndex:idx] objectForKey:SPBundleInternPathToFileKey]; } else { @@ -1137,7 +1137,7 @@ [c setWindowUUID:[cmdData objectForKey:SPBundleFileUUIDKey]]; [c setDocUUID:uuid]; [c displayHTMLContent:output withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; } } } @@ -1830,8 +1830,8 @@ BOOL bundleOtherThanGeneralFound = NO; for(NSString* scope in scopes) { - NSArray *scopeBundleCategories = [[NSApp delegate] bundleCategoriesForScope:scope]; - NSArray *scopeBundleItems = [[NSApp delegate] bundleItemsForScope:scope]; + NSArray *scopeBundleCategories = [SPAppDelegate bundleCategoriesForScope:scope]; + NSArray *scopeBundleItems = [SPAppDelegate bundleItemsForScope:scope]; if(![scopeBundleItems count]) { k++; diff --git a/Source/SPBundleCommandRunner.m b/Source/SPBundleCommandRunner.m index 2842ce4e..b8e22b93 100644 --- a/Source/SPBundleCommandRunner.m +++ b/Source/SPBundleCommandRunner.m @@ -30,6 +30,7 @@ #import "SPBundleCommandRunner.h" #import "SPDatabaseDocument.h" +#import "SPAppController.h" // Defined to suppress warnings @interface NSObject (SPBundleMethods) @@ -91,11 +92,11 @@ [fm removeItemAtPath:scriptFilePath error:nil]; [fm removeItemAtPath:stdoutFilePath error:nil]; - if([[NSApp delegate] lastBundleBlobFilesDirectory] != nil) - [fm removeItemAtPath:[[NSApp delegate] lastBundleBlobFilesDirectory] error:nil]; + if([SPAppDelegate lastBundleBlobFilesDirectory] != nil) + [fm removeItemAtPath:[SPAppDelegate lastBundleBlobFilesDirectory] error:nil]; if([shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory]) - [[NSApp delegate] setLastBundleBlobFilesDirectory:[shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory]]; + [SPAppDelegate setLastBundleBlobFilesDirectory:[shellEnvironment objectForKey:SPBundleShellVariableBlobFileDirectory]]; // Parse first line for magic header #! ; if found save the script content and run the command after #! with that file. // This allows to write perl, ruby, osascript scripts natively. diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 4aaa7cad..aa400b05 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -34,6 +34,7 @@ #import "SPOutlineView.h" #import "SPBundleCommandTextView.h" #import "SPSplitView.h" +#import "SPAppController.h" static NSString *SPSaveBundleAction = @"SPSaveBundle"; @@ -880,7 +881,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [[self window] performClose:self]; } - [[NSApp delegate] reloadBundles:self]; + [SPAppDelegate reloadBundles:self]; } @@ -1083,7 +1084,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [undeleteTableView reloadData]; [[NSUserDefaults standardUserDefaults] setObject:stillUndeletedBundles forKey:SPBundleDeletedDefaultBundlesKey]; [[NSUserDefaults standardUserDefaults] synchronize]; - [[NSApp delegate] reloadBundles:nil]; + [SPAppDelegate reloadBundles:nil]; [self reloadBundles:self]; } diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index da82d768..ed1142a2 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -260,7 +260,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; [c displayHTMLContent:[NSString stringWithFormat:@"
%@
", [sourceCode HTMLEscapeString]] withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; } - (void)saveDocument @@ -294,7 +294,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; windowUUID = @""; docUUID = @""; - [[NSApp delegate] removeHTMLOutputController:self]; + [SPAppDelegate removeHTMLOutputController:self]; [self release]; } @@ -332,7 +332,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; if(request != nil) { SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init]; [c displayURLString:[[request URL] absoluteString] withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; return [c webView]; } return nil; @@ -351,7 +351,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; // sequelpro:// handler if([[[request URL] scheme] isEqualToString:@"sequelpro"] && navigationType == WebNavigationTypeLinkClicked) { - [[NSApp delegate] handleEventWithURL:[request URL]]; + [SPAppDelegate handleEventWithURL:[request URL]]; [listener ignore]; } // sp-reveal-file://a_file_path reveals the file in Finder @@ -571,7 +571,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; */ - (NSString *)getShellEnvironmentForName:(NSString*)keyName { - return [[[NSApp delegate] shellEnvironmentForDocument:nil] objectForKey:keyName]; + return [[SPAppDelegate shellEnvironmentForDocument:nil] objectForKey:keyName]; } /** @@ -691,7 +691,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; output = [SPBundleCommandRunner runBashCommand:command withEnvironment:nil atCurrentDirectoryPath:nil error:&err]; else { NSMutableDictionary *theEnv = [NSMutableDictionary dictionary]; - [theEnv addEntriesFromDictionary:[[NSApp delegate] shellEnvironmentForDocument:nil]]; + [theEnv addEntriesFromDictionary:[SPAppDelegate shellEnvironmentForDocument:nil]]; [theEnv setObject:uuid forKey:SPBundleShellVariableProcessID]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryInputPathHeader, uuid] forKey:SPBundleShellVariableQueryFile]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultPathHeader, uuid] forKey:SPBundleShellVariableQueryResultFile]; @@ -701,7 +701,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; output = [SPBundleCommandRunner runBashCommand:command withEnvironment:theEnv atCurrentDirectoryPath:nil - callerInstance:[NSApp delegate] + callerInstance:SPAppDelegate contextInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JavaScript", @"name", NSLocalizedString(@"General", @"general menu item label"), @"scope", diff --git a/Source/SPChooseMenuItemDialog.m b/Source/SPChooseMenuItemDialog.m index 4b1dafb5..60b9ced3 100644 --- a/Source/SPChooseMenuItemDialog.m +++ b/Source/SPChooseMenuItemDialog.m @@ -148,7 +148,7 @@ clickCount:1 pressure:0.0f]; - [[NSApplication sharedApplication] sendEvent:theEvent]; + [NSApp sendEvent:theEvent]; while ([dialog waitForChoice] && [[[NSApp keyWindow] firstResponder] isKindOfClass:[SPChooseMenuItemDialogTextView class]]) { diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 905975dc..e98cc426 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -836,7 +836,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self _sortFavorites]; [self _selectNode:node]; - [[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; + [[[SPAppDelegate preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; favoriteNameFieldWasAutogenerated = YES; @@ -979,7 +979,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self _reloadFavoritesViewData]; [self _selectNode:node]; - [[(SPPreferenceController *)[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; + [[(SPPreferenceController *)[SPAppDelegate preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; } } @@ -1354,7 +1354,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self _selectNode:newNode]; // Update the favorites popup button in the preferences - [[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; + [[[SPAppDelegate preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; // Otherwise, if editing the favourite, update it } else { @@ -1677,7 +1677,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [connectionResizeContainer setHidden:NO]; [connectionInstructionsTextField setStringValue:NSLocalizedString(@"Enter connection details below, or choose a favorite", @"enter connection details label")]; - [[(SPPreferenceController *)[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; + [[(SPPreferenceController *)[SPAppDelegate preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; } /** diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index acd9f1d7..4384ae32 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -424,7 +424,7 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; - [[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; + [[[SPAppDelegate preferenceController] generalPreferencePane] updateDefaultFavoritePopup]; // Update the selection to account for rearranged faourites NSMutableIndexSet *restoredSelection = [NSMutableIndexSet indexSet]; diff --git a/Source/SPConstants.h b/Source/SPConstants.h index fd7afe40..322219ae 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -607,3 +607,5 @@ extern NSString *SPURLSchemeQueryInputPathHeader; extern NSString *SPURLSchemeQueryResultPathHeader; extern NSString *SPURLSchemeQueryResultStatusPathHeader; extern NSString *SPURLSchemeQueryResultMetaPathHeader; + +#define SPAppDelegate ((SPAppController *)[NSApp delegate]) diff --git a/Source/SPConstants.m b/Source/SPConstants.m index e7b92884..23d8c378 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -233,7 +233,7 @@ NSString *SPSSHEnableMuxingPreference = @"SSHMultiplexingEnabled"; // URLs NSString *SPDonationsURL = @"http://www.sequelpro.com/donate/"; NSString *SPMySQLSearchURL = @"http://dev.mysql.com/doc/refman/%@/%@/%@.html"; -NSString *SPDevURL = @"http://code.google.com/p/sequel-pro/"; +NSString *SPDevURL = @"https://github.com/sequelpro/sequelpro"; // Toolbar constants diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index c08e84b9..ea7c49b1 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -37,6 +37,7 @@ #import "SPTableContent.h" #import "SPConnectionController.h" #import "SPSplitView.h" +#import "SPAppController.h" static NSString *SPExportFilterAction = @"SPExportFilter"; @@ -404,7 +405,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [cf release]; // Inform all opened documents to update the query favorites list - for(id doc in [[NSApp delegate] orderedDocuments]) + for(id doc in [SPAppDelegate orderedDocuments]) if([[doc valueForKeyPath:@"tableContentInstance"] respondsToSelector:@selector(setCompareTypes:)]) [[doc valueForKeyPath:@"tableContentInstance"] setCompareTypes:nil]; #endif diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 8eb33525..7796ca11 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -885,7 +885,7 @@ static const NSInteger kBlobAsImageFile = 4; if(![[self delegate] isKindOfClass:[SPCustomQuery class]] && ![[self delegate] isKindOfClass:[SPTableContent class]]) return menu; - [[NSApp delegate] reloadBundles:self]; + [SPAppDelegate reloadBundles:self]; // Remove 'Bundles' sub menu and separator NSMenuItem *bItem = [menu itemWithTag:10000000]; @@ -895,8 +895,8 @@ static const NSInteger kBlobAsImageFile = 4; [menu removeItem:bItem]; } - NSArray *bundleCategories = [[NSApp delegate] bundleCategoriesForScope:SPBundleScopeDataTable]; - NSArray *bundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeDataTable]; + NSArray *bundleCategories = [SPAppDelegate bundleCategoriesForScope:SPBundleScopeDataTable]; + NSArray *bundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeDataTable]; // Add 'Bundles' sub menu if(bundleItems && [bundleItems count]) { @@ -1246,7 +1246,7 @@ static const NSInteger kBlobAsImageFile = 4; #ifndef SP_CODA /* executeBundleItemForDataTable: */ NSInteger idx = [sender tag] - 1000000; NSString *infoPath = nil; - NSArray *bundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeDataTable]; + NSArray *bundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeDataTable]; if(idx >=0 && idx < (NSInteger)[bundleItems count]) { infoPath = [[bundleItems objectAtIndex:idx] objectForKey:SPBundleInternPathToFileKey]; } else { @@ -1432,7 +1432,7 @@ static const NSInteger kBlobAsImageFile = 4; NSString *output = [SPBundleCommandRunner runBashCommand:cmd withEnvironment:env atCurrentDirectoryPath:nil - callerInstance:[[NSApp delegate] frontDocument] + callerInstance:[SPAppDelegate frontDocument] contextInfo:[NSDictionary dictionaryWithObjectsAndKeys: ([cmdData objectForKey:SPBundleFileNameKey])?:@"-", @"name", NSLocalizedString(@"Data Table", @"data table menu item label"), @"scope", @@ -1509,7 +1509,7 @@ static const NSInteger kBlobAsImageFile = 4; SPBundleHTMLOutputController *bundleController = [[SPBundleHTMLOutputController alloc] init]; [bundleController setWindowUUID:[cmdData objectForKey:SPBundleFileUUIDKey]]; [bundleController displayHTMLContent:output withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:bundleController]; + [SPAppDelegate addHTMLOutputController:bundleController]; } } } diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index ba053dbf..9de7391d 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2541,7 +2541,7 @@ if ([aNotification object] != customQueryView) return; #ifndef SP_CODA /* triggered commands */ - NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionTableRowChanged]; + NSArray *triggeredCommands = [SPAppDelegate bundleCommandsForTrigger:SPBundleTriggerActionTableRowChanged]; for(NSString* cmdPath in triggeredCommands) { NSArray *data = [cmdPath componentsSeparatedByString:@"|"]; NSMenuItem *aMenuItem = [[[NSMenuItem alloc] init] autorelease]; @@ -2565,7 +2565,7 @@ } if(!stopTrigger) { if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { - [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem]; + [[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem]; } else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { if([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"]) @@ -3894,7 +3894,7 @@ arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7D]; else arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7E]; - [[NSApplication sharedApplication] postEvent:arrowEvent atStart:NO]; + [NSApp postEvent:arrowEvent atStart:NO]; return YES; } diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index a377a8ec..7ab802da 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2526,8 +2526,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; - (IBAction)openCurrentConnectionInNewWindow:(id)sender { - [[NSApp delegate] newWindow:self]; - SPDatabaseDocument *newTableDocument = [[NSApp delegate] frontDocument]; + [SPAppDelegate newWindow:self]; + SPDatabaseDocument *newTableDocument = [SPAppDelegate frontDocument]; [newTableDocument setStateFromConnectionFile:[[self fileURL] path]]; } @@ -2921,7 +2921,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; else if (sender == nil || [sender tag] == 1020 || [sender tag] == 1021) { // Save As Session - if ([sender tag] == 1020 && [[NSApp delegate] sessionURL]) { + if ([sender tag] == 1020 && [SPAppDelegate sessionURL]) { [self saveConnectionPanelDidEnd:panel returnCode:1 contextInfo:@"saveAsSession"]; return; } @@ -2935,7 +2935,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [panel setAllowedFileTypes:[NSArray arrayWithObjects:SPBundleFileExtension, nil]]; - NSDictionary *spfSessionData = [[NSApp delegate] spfSessionDocData]; + NSDictionary *spfSessionData = [SPAppDelegate spfSessionDocData]; // Restore accessory view settings if possible if ([spfSessionData objectForKey:@"save_password"]) { @@ -2967,8 +2967,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [panel setAccessoryView:saveConnectionAccessory]; // Set file name - if ([[NSApp delegate] sessionURL]) - filename = [[[[NSApp delegate] sessionURL] absoluteString] lastPathComponent]; + if ([SPAppDelegate sessionURL]) + filename = [[[SPAppDelegate sessionURL] absoluteString] lastPathComponent]; else filename = [NSString stringWithFormat:NSLocalizedString(@"Session",@"Initial filename for 'Save session' file")]; @@ -3055,8 +3055,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // info.plist will contain the opened structure (windows and tabs for each window). Each connection // is linked to a saved spf file either in 'Contents' for unTitled ones or already saved spf files. - if(contextInfo == @"saveAsSession" && [[NSApp delegate] sessionURL]) - fileName = [[[NSApp delegate] sessionURL] path]; + if(contextInfo == @"saveAsSession" && [SPAppDelegate sessionURL]) + fileName = [[SPAppDelegate sessionURL] path]; if(!fileName || ![fileName length]) return; @@ -3094,7 +3094,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // retrieve save panel data for passing them to each doc NSMutableDictionary *spfDocData_temp = [NSMutableDictionary dictionary]; if(contextInfo == @"saveAsSession") { - [spfDocData_temp addEntriesFromDictionary:[[NSApp delegate] spfSessionDocData]]; + [spfDocData_temp addEntriesFromDictionary:[SPAppDelegate spfSessionDocData]]; } else { [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionEncrypt state]==NSOnState) ? YES : NO ] forKey:@"encrypted"]; if([[spfDocData_temp objectForKey:@"encrypted"] boolValue]) @@ -3105,7 +3105,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionIncludeQuery state]==NSOnState) ? YES : NO ] forKey:@"save_editor_content"]; // Save the session's accessory view settings - [[NSApp delegate] setSpfSessionDocData:spfDocData_temp]; + [SPAppDelegate setSpfSessionDocData:spfDocData_temp]; } @@ -3118,7 +3118,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [info setObject:@"connection bundle" forKey:@"format"]; // Loop through all windows - for(NSWindow *window in [[NSApp delegate] orderedDatabaseConnectionWindows]) { + for(NSWindow *window in [SPAppDelegate orderedDatabaseConnectionWindows]) { // First window is always the currently key window @@ -3192,7 +3192,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return; } - [[NSApp delegate] setSessionURL:fileName]; + [SPAppDelegate setSessionURL:fileName]; // Register spfs bundle in Recent Files [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:fileName]]; @@ -3459,7 +3459,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [currentState setObject:sessionDict forKey:@"session"]; // Set the connection on the new tab - [[[NSApp delegate] frontDocument] setState:currentState]; + [[SPAppDelegate frontDocument] setState:currentState]; } /** @@ -4807,11 +4807,11 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Ask for a password if SPF file passwords were encrypted, via a sheet if ([spf objectForKey:@"encrypted"] && [[spf valueForKey:@"encrypted"] boolValue]) { - if([self isSaveInBundle] && [[[NSApp delegate] spfSessionDocData] objectForKey:@"e_string"]) { - encryptpw = [[[NSApp delegate] spfSessionDocData] objectForKey:@"e_string"]; + if([self isSaveInBundle] && [[SPAppDelegate spfSessionDocData] objectForKey:@"e_string"]) { + encryptpw = [[SPAppDelegate spfSessionDocData] objectForKey:@"e_string"]; } else { [inputTextWindowHeader setStringValue:NSLocalizedString(@"Connection file is encrypted", @"Connection file is encrypted")]; - [inputTextWindowMessage setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Please enter the password for ‘%@’:", @"Please enter the password"), ([self isSaveInBundle]) ? [[[[NSApp delegate] sessionURL] absoluteString] lastPathComponent] : [path lastPathComponent]]]; + [inputTextWindowMessage setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Please enter the password for ‘%@’:", @"Please enter the password"), ([self isSaveInBundle]) ? [[[SPAppDelegate sessionURL] absoluteString] lastPathComponent] : [path lastPathComponent]]]; [inputTextWindowSecureTextField setStringValue:@""]; [inputTextWindowSecureTextField selectText:nil]; @@ -4843,9 +4843,9 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; encryptpw = [inputTextWindowSecureTextField stringValue]; if ([self isSaveInBundle]) { NSMutableDictionary *spfSessionData = [NSMutableDictionary dictionary]; - [spfSessionData addEntriesFromDictionary:[[NSApp delegate] spfSessionDocData]]; + [spfSessionData addEntriesFromDictionary:[SPAppDelegate spfSessionDocData]]; [spfSessionData setObject:encryptpw forKey:@"e_string"]; - [[NSApp delegate] setSpfSessionDocData:spfSessionData]; + [SPAppDelegate setSpfSessionDocData:spfSessionData]; } } else { [self closeAndDisconnect]; @@ -5379,7 +5379,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return; } if(doSyntaxHighlighting) { - [result appendFormat:@"%@
", [[NSApp delegate] doSQLSyntaxHighlightForString:[syntaxString createViewSyntaxPrettifier] cssLike:doSyntaxHighlightingViaCSS]]; + [result appendFormat:@"%@
", [SPAppDelegate doSQLSyntaxHighlightForString:[syntaxString createViewSyntaxPrettifier] cssLike:doSyntaxHighlightingViaCSS]]; } else { [result appendFormat:@"%@\n", [syntaxString createViewSyntaxPrettifier]]; } @@ -5591,7 +5591,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [runningActivitiesArray addObject:commandDict]; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self]; - if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) + if([runningActivitiesArray count] || [[SPAppDelegate runningActivities] count]) [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self @@ -5612,7 +5612,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } } - if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) + if([runningActivitiesArray count] || [[SPAppDelegate runningActivities] count]) [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self @@ -6198,7 +6198,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA - (void)_processDatabaseChangedBundleTriggerActions { - NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionDatabaseChanged]; + NSArray *triggeredCommands = [SPAppDelegate bundleCommandsForTrigger:SPBundleTriggerActionDatabaseChanged]; for (NSString* cmdPath in triggeredCommands) { @@ -6229,7 +6229,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } if(!stopTrigger) { if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { - [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem]; + [[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem]; } else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { if ([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"]) { diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index c1823661..9b0ded39 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -589,7 +589,7 @@ [self endTask]; #ifndef SP_CODA /* triggered commands */ - NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionTableChanged]; + NSArray *triggeredCommands = [SPAppDelegate bundleCommandsForTrigger:SPBundleTriggerActionTableChanged]; for(NSString* cmdPath in triggeredCommands) { @@ -615,7 +615,7 @@ } if(!stopTrigger) { if([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { - [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem]; + [[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem]; } else if([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { if([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"]) diff --git a/Source/SPDocumentController.m b/Source/SPDocumentController.m index 391d41a6..a5d81554 100644 --- a/Source/SPDocumentController.m +++ b/Source/SPDocumentController.m @@ -40,7 +40,7 @@ /** * Add a dummy implementation of readFromData:ofType:error:, which appears to * be called by the OS in certain situations despite non-document use. - * (See http://code.google.com/p/sequel-pro/issues/detail?id=1411 ) + * (See issue #1411 ) */ - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m index 71422b28..b0070f31 100644 --- a/Source/SPExportFilenameUtilities.m +++ b/Source/SPExportFilenameUtilities.m @@ -242,7 +242,7 @@ isARepeat:NO keyCode:0x24]; - [[NSApplication sharedApplication] postEvent:tokenizingEvent atStart:NO]; + [NSApp postEvent:tokenizingEvent atStart:NO]; // Update the filename preview [self updateDisplayedExportFilename]; diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 379cdc18..e2319141 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -312,8 +312,8 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte // Detect if more than one connection windows with the connectionID are open. // If so, don't remove it. - if ([[NSApp delegate] frontDocument]) { - for(id doc in [[NSApp delegate] orderedDocuments]) { + if ([SPAppDelegate frontDocument]) { + for(id doc in [SPAppDelegate orderedDocuments]) { if([[doc connectionID] isEqualToString:connectionID]) docCounter++; if(docCounter > 1) break; @@ -322,7 +322,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if(docCounter > 1) return; - if(schemaData && [schemaData objectForKey:connectionID] && [[NSApp delegate] frontDocument] && [[[NSApp delegate] orderedDocuments] count]) + if(schemaData && [schemaData objectForKey:connectionID] && [SPAppDelegate frontDocument] && [[SPAppDelegate orderedDocuments] count]) [self saveSelectedItems]; if(schemaDataFiltered) @@ -374,7 +374,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte NSArray *pathArray = [[[parentKeys objectAtIndex:0] description] componentsSeparatedByString:SPUniqueSchemaDelimiter]; if([pathArray count] > 1) { - SPDatabaseDocument *doc = [[NSApp delegate] frontDocument]; + SPDatabaseDocument *doc = [SPAppDelegate frontDocument]; if([doc isWorking]) { [SPTooltip showWithObject:NSLocalizedString(@"Active connection window is busy. Please wait and try again.", @"active connection window is busy. please wait and try again. tooltip") atLocation:pos @@ -590,7 +590,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte { // Reset everything for current active doc connection - SPDatabaseDocument *doc = [[NSApp delegate] frontDocument]; + SPDatabaseDocument *doc = [SPAppDelegate frontDocument]; if(!doc) return; NSString *connectionID = [doc connectionID]; if(!connectionID || [connectionID length] < 2) return; @@ -750,7 +750,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte [searchField setStringValue:@""]; } - SPDatabaseDocument *doc = [[NSApp delegate] frontDocument]; + SPDatabaseDocument *doc = [SPAppDelegate frontDocument]; if (doc) { NSMutableString *key = [NSMutableString string]; [key setString:[doc connectionID]]; diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index 956b0d9b..c77e82d2 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -85,7 +85,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; - (void)awakeFromNib { - [[self window] setTitle:[NSString stringWithFormat:NSLocalizedString(@"Server Processes on %@", @"server processes window title (var = hostname)"),[[(SPAppController*)[NSApp delegate] frontDocument] name]]]; + [[self window] setTitle:[NSString stringWithFormat:NSLocalizedString(@"Server Processes on %@", @"server processes window title (var = hostname)"),[[SPAppDelegate frontDocument] name]]]; [self setWindowFrameAutosaveName:@"ProcessList"]; @@ -238,7 +238,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) { if (returnCode == NSOKButton) { if ([processesFiltered count] > 0) { - NSMutableString *processesString = [NSMutableString stringWithFormat:@"# MySQL server proceese for %@\n\n", [[[NSApp delegate] frontDocument] host]]; + NSMutableString *processesString = [NSMutableString stringWithFormat:@"# MySQL server proceese for %@\n\n", [[SPAppDelegate frontDocument] host]]; for (NSDictionary *process in processesFiltered) { diff --git a/Source/SPQueryDocumentsController.m b/Source/SPQueryDocumentsController.m index ba1bc2b1..e42a734b 100644 --- a/Source/SPQueryDocumentsController.m +++ b/Source/SPQueryDocumentsController.m @@ -30,6 +30,7 @@ #import "SPQueryDocumentsController.h" #import "SPCustomQuery.h" +#import "SPAppController.h" @implementation SPQueryController (SPQueryDocumentsController) @@ -122,7 +123,7 @@ #ifndef SP_CODA // Check for multiple instance of the same document. // Remove it if only one instance was registerd. - NSArray *allDocs = [[NSApp delegate] orderedDocuments]; + NSArray *allDocs = [SPAppDelegate orderedDocuments]; NSMutableArray *allURLs = [NSMutableArray array]; for (id doc in allDocs) @@ -202,7 +203,7 @@ } // Inform all opened documents to update the history list - for (id doc in [[NSApp delegate] orderedDocuments]) + for (id doc in [SPAppDelegate orderedDocuments]) { if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(historyItemsHaveBeenUpdated:)]) { [[doc valueForKeyPath:@"customQueryInstance"] performSelectorOnMainThread:@selector(historyItemsHaveBeenUpdated:) withObject:self waitUntilDone:NO]; diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 9f96d98a..c73501b8 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -38,6 +38,7 @@ #import "RegexKitLite.h" #import "SPTextView.h" #import "SPSplitView.h" +#import "SPAppController.h" #define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]") #define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]") @@ -477,7 +478,7 @@ [prefs setObject:[self queryFavoritesForFileURL:nil] forKey:SPQueryFavorites]; // Inform all opened documents to update the query favorites list - for(id doc in [[NSApp delegate] orderedDocuments]) + for(id doc in [SPAppDelegate orderedDocuments]) if([[doc valueForKeyPath:@"customQueryInstance"] respondsToSelector:@selector(queryFavoritesHaveBeenUpdated:)]) [[doc valueForKeyPath:@"customQueryInstance"] queryFavoritesHaveBeenUpdated:self]; } diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index a2e1e059..80c9f558 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -136,7 +136,7 @@ [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) { if (returnCode == NSOKButton) { if ([variablesFiltered count] > 0) { - NSMutableString *variablesString = [NSMutableString stringWithFormat:@"# MySQL server variables for %@\n\n", [[(SPAppController*)[NSApp delegate] frontDocument] host]]; + NSMutableString *variablesString = [NSMutableString stringWithFormat:@"# MySQL server variables for %@\n\n", [[SPAppDelegate frontDocument] host]]; for (NSDictionary *variable in variablesFiltered) { diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index 2f78a120..0a624efc 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -118,7 +118,7 @@ [self updateCountText]; #ifndef SP_CODA /* triggered commands */ - NSArray *triggeredCommands = [[NSApp delegate] bundleCommandsForTrigger:SPBundleTriggerActionTableRowChanged]; + NSArray *triggeredCommands = [SPAppDelegate bundleCommandsForTrigger:SPBundleTriggerActionTableRowChanged]; for (NSString *cmdPath in triggeredCommands) { @@ -150,7 +150,7 @@ if (!stopTrigger) { if ([[data objectAtIndex:1] isEqualToString:SPBundleScopeGeneral]) { - [[[NSApp delegate] onMainThread] executeBundleItemForApp:aMenuItem]; + [[SPAppDelegate onMainThread] executeBundleItemForApp:aMenuItem]; } else if ([[data objectAtIndex:1] isEqualToString:SPBundleScopeDataTable]) { if ([[[[[NSApp mainWindow] firstResponder] class] description] isEqualToString:@"SPCopyTable"]) { diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 4bed0226..76a11a5c 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -35,6 +35,7 @@ #import "SPTableData.h" #import "SPActivityTextFieldCell.h" #import "SPTableTextFieldCell.h" +#import "SPAppController.h" @interface SPTableInfo (PrivateAPI) @@ -111,7 +112,7 @@ [acts removeAllObjects]; [acts addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"ACTIVITIES", @"header for activities pane"), @"name", nil]]; [acts addObjectsFromArray:[tableDocumentInstance runningActivities]]; - [acts addObjectsFromArray:[[NSApp delegate] runningActivities]]; + [acts addObjectsFromArray:[SPAppDelegate runningActivities]]; _activitiesWillBeUpdated = YES; diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 458389c2..8d455b58 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -717,13 +717,13 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [documentState setObject:@YES forKey:@"auto_connect"]; // Set the connection on the new tab - [[[NSApp delegate] frontDocument] setState:documentState]; + [[SPAppDelegate frontDocument] setState:documentState]; } - (IBAction)openTableInNewWindow:(id)sender { //create new window - [(SPAppController *)[NSApp delegate] newWindow:self]; + [SPAppDelegate newWindow:self]; [self _duplicateConnectionToFrontTab]; } @@ -2653,7 +2653,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // check if the name really changed if ([oldTableName isEqualToString:newTableName]) return; - // check if only the case changed - then we have to do two renames, see http://code.google.com/p/sequel-pro/issues/detail?id=484 + // check if only the case changed - then we have to do two renames, see issue #484 if ([[oldTableName lowercaseString] isEqualToString:[newTableName lowercaseString]]) { // first try finding an unused temporary name diff --git a/Source/SPTextView.m b/Source/SPTextView.m index abe89c5b..523a7ade 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -3125,7 +3125,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } #ifndef SP_CODA - [[NSApp delegate] reloadBundles:self]; + [SPAppDelegate reloadBundles:self]; // Remove 'Bundles' sub menu and separator NSMenuItem *bItem = [menu itemWithTag:10000000]; @@ -3135,8 +3135,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [menu removeItem:bItem]; } - NSArray *bundleCategories = [[NSApp delegate] bundleCategoriesForScope:SPBundleScopeInputField]; - NSArray *bundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeInputField]; + NSArray *bundleCategories = [SPAppDelegate bundleCategoriesForScope:SPBundleScopeInputField]; + NSArray *bundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeInputField]; // Add 'Bundles' sub menu for custom query editor only so far if bundles with scope 'editor' were found if(customQueryInstance && bundleItems && [bundleItems count]) { diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 17998fa6..7272de1d 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -511,7 +511,7 @@ NSInteger idx = [sender tag] - 1000000; NSString *infoPath = nil; - NSArray *bundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeInputField]; + NSArray *bundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeInputField]; if(idx >=0 && idx < (NSInteger)[bundleItems count]) { infoPath = [[bundleItems objectAtIndex:idx] objectForKey:SPBundleInternPathToFileKey]; } else { @@ -661,7 +661,7 @@ NSString *output = [SPBundleCommandRunner runBashCommand:cmd withEnvironment:env atCurrentDirectoryPath:nil - callerInstance:[(SPAppController*)[NSApp delegate] frontDocument] + callerInstance:[SPAppDelegate frontDocument] contextInfo:[NSDictionary dictionaryWithObjectsAndKeys: ([cmdData objectForKey:SPBundleFileNameKey])?:@"-", @"name", NSLocalizedString(@"Input Field", @"input field menu item label"), @"scope", @@ -736,7 +736,7 @@ SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init]; [c setWindowUUID:[cmdData objectForKey:SPBundleFileUUIDKey]]; [c displayHTMLContent:output withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; } } @@ -800,12 +800,12 @@ [menu removeItem:bItem]; } - if ([[[(SPWindowController *)[[[NSApp delegate] frontDocumentWindow] delegate] selectedTableDocument] connectionID] isEqualToString:@"_"]) return menu; + if ([[[(SPWindowController *)[[SPAppDelegate frontDocumentWindow] delegate] selectedTableDocument] connectionID] isEqualToString:@"_"]) return menu; - [[NSApp delegate] reloadBundles:self]; + [SPAppDelegate reloadBundles:self]; - NSArray *bundleCategories = [[NSApp delegate] bundleCategoriesForScope:SPBundleScopeInputField]; - NSArray *bundleItems = [[NSApp delegate] bundleItemsForScope:SPBundleScopeInputField]; + NSArray *bundleCategories = [SPAppDelegate bundleCategoriesForScope:SPBundleScopeInputField]; + NSArray *bundleItems = [SPAppDelegate bundleItemsForScope:SPBundleScopeInputField]; // Add 'Bundles' sub menu if(bundleItems && [bundleItems count]) { diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 917c73ae..3fdcaa63 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -281,7 +281,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; [[self managedObjectContext] save:&error]; if (error != nil) { - [[NSApplication sharedApplication] presentError:error]; + [NSApp presentError:error]; } [parentResults release]; @@ -443,7 +443,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]]; if (![persistentStoreCoordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:&error]) { - [[NSApplication sharedApplication] presentError:error]; + [NSApp presentError:error]; } return persistentStoreCoordinator; @@ -1261,7 +1261,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; NSArray *array = [moc executeFetchRequest:request error:&error]; if (error != nil) { - [[NSApplication sharedApplication] presentError:error]; + [NSApp presentError:error]; } return array; @@ -1297,7 +1297,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; NSArray *array = [moc executeFetchRequest:request error:&error]; if (error != nil) { - [[NSApplication sharedApplication] presentError:error]; + [NSApp presentError:error]; } return array; diff --git a/Source/SPWindowControllerDelegate.m b/Source/SPWindowControllerDelegate.m index d8637ac4..47959f1b 100644 --- a/Source/SPWindowControllerDelegate.m +++ b/Source/SPWindowControllerDelegate.m @@ -68,9 +68,9 @@ } // Remove global session data if the last window of a session will be closed - if ([[NSApp delegate] sessionURL] && [[[NSApp delegate] orderedDatabaseConnectionWindows] count] == 1) { - [[NSApp delegate] setSessionURL:nil]; - [[NSApp delegate] setSpfSessionDocData:nil]; + if ([SPAppDelegate sessionURL] && [[SPAppDelegate orderedDatabaseConnectionWindows] count] == 1) { + [SPAppDelegate setSessionURL:nil]; + [SPAppDelegate setSpfSessionDocData:nil]; } return YES; diff --git a/Source/Sequel-Pro.pch b/Source/Sequel-Pro.pch index 080e20ec..f3b2fd16 100644 --- a/Source/Sequel-Pro.pch +++ b/Source/Sequel-Pro.pch @@ -25,7 +25,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -// More info at +// More info at #ifdef __OBJC__ #import -- cgit v1.2.3 From 876dde21d97897ad4ee98aa0d6b11898282982ce Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 18:02:01 +0100 Subject: Change [NSArray arrayWithObject:] to @[] literal Note: [NSArray arrayWithObjects:...,nil] is left unchanged as that could possibly cause a NPE if converted to @[] --- Source/GeneratePreviewForURL.m | 2 +- Source/MGTemplateEngine.m | 2 +- Source/SPAppController.m | 8 ++++---- Source/SPBundleEditorController.m | 6 +++--- Source/SPConnectionControllerDelegate.m | 2 +- Source/SPConnectionControllerInitializer.m | 2 +- Source/SPContentFilterManager.m | 6 +++--- Source/SPCustomQuery.m | 14 +++++++------- Source/SPDatabaseData.m | 2 +- Source/SPDatabaseDocument.m | 8 ++++---- Source/SPEditorPreferencePane.m | 6 +++--- Source/SPExportControllerDelegate.m | 2 +- Source/SPFavoritesController.m | 2 +- Source/SPFieldEditorController.m | 3 +-- Source/SPNavigatorController.m | 2 +- Source/SPPrintAccessory.m | 2 +- Source/SPQueryController.m | 2 +- Source/SPQueryDocumentsController.m | 8 ++++---- Source/SPQueryFavoriteManager.m | 8 ++++---- Source/SPServerVariablesController.m | 2 +- Source/SPTableData.m | 2 +- Source/SPTableStructureDelegate.m | 4 ++-- Source/SPTableStructureLoading.m | 4 ++-- Source/SPTextView.m | 20 ++++++++++---------- Source/SPUserManager.m | 2 +- 25 files changed, 60 insertions(+), 61 deletions(-) diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index 034d7bd1..ebbadd5a 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -474,7 +474,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, // just in case if(!iconImages || [iconImages count] < 1) - iconImages = [NSArray arrayWithObject:[NSImage imageNamed:NSImageNameStopProgressTemplate]]; + iconImages = @[[NSImage imageNamed:NSImageNameStopProgressTemplate]]; #warning Shouldn't that be "> 1"? if([iconImages count] > 0) diff --git a/Source/MGTemplateEngine.m b/Source/MGTemplateEngine.m index 941a7e1b..4a5d3192 100644 --- a/Source/MGTemplateEngine.m +++ b/Source/MGTemplateEngine.m @@ -542,7 +542,7 @@ [frame setObject:endMarkers forKey:BLOCK_END_NAMES_KEY]; NSArray *arguments = [matchInfo objectForKey:MARKER_ARGUMENTS_KEY]; if (!arguments) { - arguments = [NSArray array]; + arguments = @[]; } [frame setObject:arguments forKey:BLOCK_ARGUMENTS_KEY]; [frame setObject:[matchInfo objectForKey:MARKER_RANGE_KEY] forKey:BLOCK_START_MARKER_RANGE_KEY]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 8aabce60..56da49cf 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -738,7 +738,7 @@ if([pathComponents count] > 2) parameter = [pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count]-2)]; else - parameter = [NSArray array]; + parameter = @[]; NSFileManager *fm = [NSFileManager defaultManager]; @@ -1533,7 +1533,7 @@ if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey]) deletedDefaultBundles = [[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey] retain]; else - deletedDefaultBundles = [[NSArray array] retain]; + deletedDefaultBundles = [@[] retain]; NSMutableString *infoAboutUpdatedDefaultBundles = [NSMutableString string]; BOOL doBundleUpdate = ([[NSUserDefaults standardUserDefaults] objectForKey:@"doBundleUpdate"]) ? YES : NO; @@ -1775,7 +1775,7 @@ // Sort items for menus NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:SPBundleInternLabelKey ascending:YES] autorelease]; for(NSString* scope in [bundleItems allKeys]) { - [[bundleItems objectForKey:scope] sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; + [[bundleItems objectForKey:scope] sortUsingDescriptors:@[sortDescriptor]]; [[bundleCategories objectForKey:scope] sortUsingSelector:@selector(compare:)]; } } @@ -1949,7 +1949,7 @@ // Sort if more than one found if([assignedKeyEquivalents count] > 1) { NSSortDescriptor *aSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES selector:@selector(caseInsensitiveCompare:)] autorelease]; - NSArray *sorted = [assignedKeyEquivalents sortedArrayUsingDescriptors:[NSArray arrayWithObject:aSortDescriptor]]; + NSArray *sorted = [assignedKeyEquivalents sortedArrayUsingDescriptors:@[aSortDescriptor]]; [assignedKeyEquivalents setArray:sorted]; } } diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index aa400b05..4de339de 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -741,8 +741,8 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; - (IBAction)saveBundle:(id)sender { NSSavePanel *panel = [NSSavePanel savePanel]; - - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPUserBundleFileExtension]]; + + [panel setAllowedFileTypes:@[SPUserBundleFileExtension]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -1536,7 +1536,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; // Write data to the pasteboard NSArray *fileList = [NSArray arrayWithObjects:draggedFilePath, nil]; // NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; + [pboard declareTypes:@[NSFilenamesPboardType] owner:nil]; [pboard setPropertyList:fileList forType:NSFilenamesPboardType]; // Start the drag operation diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 4384ae32..a28a27b7 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -312,7 +312,7 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; return NO; } - [pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:self]; + [pboard declareTypes:@[SPFavoritesPasteboardDragType] owner:self]; BOOL result = [pboard setData:[NSData data] forType:SPFavoritesPasteboardDragType]; diff --git a/Source/SPConnectionControllerInitializer.m b/Source/SPConnectionControllerInitializer.m index 5ef4f3a4..5254e36d 100644 --- a/Source/SPConnectionControllerInitializer.m +++ b/Source/SPConnectionControllerInitializer.m @@ -320,7 +320,7 @@ static NSString *SPConnectionViewNibName = @"ConnectionView"; [favoritesOutlineView setDoubleAction:@selector(nodeDoubleClicked:)]; // Register drag types for the favorites outline view - [favoritesOutlineView registerForDraggedTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType]]; + [favoritesOutlineView registerForDraggedTypes:@[SPFavoritesPasteboardDragType]]; [favoritesOutlineView setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES]; } diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index ea7c49b1..d6fed676 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -143,7 +143,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [contentFilterTextView setString:@""]; // Register drag types - [contentFilterTableView registerForDraggedTypes:[NSArray arrayWithObject:SPContentFilterPasteboardDragType]]; + [contentFilterTableView registerForDraggedTypes:@[SPContentFilterPasteboardDragType]]; [contentFilterArrayController setContent:contentFilters]; [contentFilterTableView reloadData]; @@ -333,7 +333,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; #ifndef SP_CODA NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionDefault]]; + [panel setAllowedFileTypes:@[SPFileExtensionDefault]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -556,7 +556,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard*)pboard { - NSArray *pboardTypes = [NSArray arrayWithObject:SPContentFilterPasteboardDragType]; + NSArray *pboardTypes = @[SPContentFilterPasteboardDragType]; NSUInteger originalRow = [rows firstIndex]; if(originalRow < 1) return NO; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 9de7391d..21ce6970 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -197,7 +197,7 @@ NSBeep(); return; } - queries = [NSArray arrayWithObject:[SPSQLParser normaliseQueryForExecution:query]]; + queries = @[[SPSQLParser normaliseQueryForExecution:query]]; // Otherwise, run the selected text. } else { @@ -470,7 +470,7 @@ #ifndef SP_CODA NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; + [panel setAllowedFileTypes:@[SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -504,7 +504,7 @@ { NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + [pb declareTypes:@[NSStringPboardType] owner:nil]; [pb setString:[self buildHistoryString] forType:NSStringPboardType]; } @@ -2038,7 +2038,7 @@ if ([prefs boolForKey:SPReloadAfterEditingRow]) { reloadingExistingResult = YES; [self storeCurrentResultViewForRestoration]; - [self performQueries:[NSArray arrayWithObject:lastExecutedQuery] withCallback:NULL]; + [self performQueries:@[lastExecutedQuery] withCallback:NULL]; } else { #endif // otherwise, just update the data in the data storage @@ -2264,7 +2264,7 @@ sortColumn = tableColumn; else sortColumn = nil; - [self performQueries:[NSArray arrayWithObject:queryString] withCallback:@selector(tableSortCallback)]; + [self performQueries:@[queryString] withCallback:@selector(tableSortCallback)]; } - (void)tableSortCallback @@ -3392,7 +3392,7 @@ for (NSDictionary *favorite in [[SPQueryController sharedQueryController] favoritesForFileURL:[tableDocumentInstance fileURL]]) { if (![favorite isKindOfClass:[NSDictionary class]] || ![favorite objectForKey:@"name"]) continue; NSMutableParagraphStyle *paraStyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; - [paraStyle setTabStops:[NSArray array]]; + [paraStyle setTabStops:@[]]; [paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]]; NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]]; NSAttributedString *titleString = [[[NSAttributedString alloc] @@ -3418,7 +3418,7 @@ for (NSDictionary *favorite in [prefs objectForKey:SPQueryFavorites]) { if (![favorite isKindOfClass:[NSDictionary class]] || ![favorite objectForKey:@"name"]) continue; NSMutableParagraphStyle *paraStyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; - [paraStyle setTabStops:[NSArray array]]; + [paraStyle setTabStops:@[]]; [paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]]; NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]]; NSAttributedString *titleString = [[[NSAttributedString alloc] diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m index 9d5b47e7..1bd9a8f9 100644 --- a/Source/SPDatabaseData.m +++ b/Source/SPDatabaseData.m @@ -428,7 +428,7 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, { SPMySQLResult *result = [connection queryString:query]; - if ([connection queryErrored]) return [NSArray array]; + if ([connection queryErrored]) return @[]; [result setReturnDataAsStrings:YES]; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 7ab802da..88ab58ed 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1841,7 +1841,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // show syntax(es) in sheet if (sender == self) { NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [pb declareTypes:@[NSStringPboardType] owner:self]; [pb setString:createSyntax forType:NSStringPboardType]; // Table syntax copied Growl notification @@ -2330,7 +2330,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; + [panel setAllowedFileTypes:@[SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -2361,7 +2361,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Copy to the clipboard NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [pb declareTypes:@[NSStringPboardType] owner:self]; [pb setString:createSyntax forType:NSStringPboardType]; // Table syntax copied Growl notification @@ -5264,7 +5264,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSString *query = [NSString stringWithContentsOfFile:queryFileName encoding:NSUTF8StringEncoding error:&inError]; [fm removeItemAtPath:queryFileName error:nil]; if(inError == nil && query && [query length]) { - [customQueryInstance performQueries:[NSArray arrayWithObject:query] withCallback:NULL]; + [customQueryInstance performQueries:@[query] withCallback:NULL]; } } return; diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index 93e5c42b..e5250e1d 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -131,7 +131,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPColorThemeFileExtension]]; + [panel setAllowedFileTypes:@[SPColorThemeFileExtension]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -770,7 +770,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; if ([fm fileExistsAtPath:themePath isDirectory:nil]) { NSArray *allItemsRaw = [fm contentsOfDirectoryAtPath:themePath error:NULL]; - if(!allItemsRaw) return [NSArray array]; + if(!allItemsRaw) return @[]; // Filter out all themes NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF ENDSWITH %@", [NSString stringWithFormat:@".%@", SPColorThemeFileExtension]]; @@ -791,7 +791,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; return (NSArray *)allItems; } - return [NSArray array]; + return @[]; } - (void)_saveColorThemeAtPath:(NSString *)path diff --git a/Source/SPExportControllerDelegate.m b/Source/SPExportControllerDelegate.m index aca7791f..43b1804f 100644 --- a/Source/SPExportControllerDelegate.m +++ b/Source/SPExportControllerDelegate.m @@ -155,7 +155,7 @@ // Check whether the group of items make up a token groupToken = [self tokenObjectForString:[[processedTokens subarrayWithRange:NSMakeRange(k, 1 + i - k)] componentsJoinedByString:@""]]; if ([groupToken isKindOfClass:[SPExportFileNameTokenObject class]]) { - [processedTokens replaceObjectsInRange:NSMakeRange(k, 1 + i - k) withObjectsFromArray:[NSArray arrayWithObject:groupToken]]; + [processedTokens replaceObjectsInRange:NSMakeRange(k, 1 + i - k) withObjectsFromArray:@[groupToken]]; i = k + 1; break; } diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index d5564428..07d74ee0 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -237,7 +237,7 @@ static SPFavoritesController *sharedFavoritesController = nil; favoritesData = [[NSMutableDictionary alloc] initWithContentsOfFile:favoritesFile]; } else { - NSMutableDictionary *newFavorites = [NSMutableDictionary dictionaryWithObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, [NSArray array], SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey]; + NSMutableDictionary *newFavorites = [NSMutableDictionary dictionaryWithObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, @[], SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey]; error = nil; NSString *errorString = nil; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 9c2de5fc..2d8e9529 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -895,8 +895,7 @@ id ql = [NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel]; [[ql delegate] setDelegate:self]; - [ql setURLs:[NSArray arrayWithObject: - [NSURL fileURLWithPath:tmpFileName]] currentIndex:0 preservingDisplayState:YES]; + [ql setURLs:@[[NSURL fileURLWithPath:tmpFileName]] currentIndex:0 preservingDisplayState:YES]; // TODO: No interaction with iChat and iPhoto due to .scriptSuite warning: // unknown image format diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index e2319141..5db53418 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -467,7 +467,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte [allSchemaKeys setObject:a forKey:connectionName]; } else { [schemaData setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@&DEL&no data loaded yet", connectionName]]; - [allSchemaKeys setObject:[NSArray array] forKey:connectionName]; + [allSchemaKeys setObject:@[] forKey:connectionName]; } [updatingConnections removeObject:connectionName]; diff --git a/Source/SPPrintAccessory.m b/Source/SPPrintAccessory.m index aab04630..043d04a1 100644 --- a/Source/SPPrintAccessory.m +++ b/Source/SPPrintAccessory.m @@ -49,7 +49,7 @@ - (NSArray *)localizedSummaryItems { - return [NSArray arrayWithObject:[NSDictionary dictionary]]; + return @[@{}]; } - (NSSet *)keyPathsForValuesAffectingPreview diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 3e33b533..0b1e59b6 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -226,7 +226,7 @@ static SPQueryController *sharedQueryController = nil; #ifndef SP_CODA NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; + [panel setAllowedFileTypes:@[SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; diff --git a/Source/SPQueryDocumentsController.m b/Source/SPQueryDocumentsController.m index e42a734b..e4689c41 100644 --- a/Source/SPQueryDocumentsController.m +++ b/Source/SPQueryDocumentsController.m @@ -312,7 +312,7 @@ } #endif - return [NSArray array]; + return @[]; } /** @@ -355,7 +355,7 @@ - (NSArray *)queryFavoritesForFileURL:(NSURL *)fileURL andTabTrigger:(NSString *)tabTrigger includeGlobals:(BOOL)includeGlobals { - if (![tabTrigger length]) return [NSArray array]; + if (![tabTrigger length]) return @[]; NSMutableArray *result = [[NSMutableArray alloc] init]; @@ -390,7 +390,7 @@ */ - (NSArray*)functionList { - return (completionFunctionList != nil && [completionFunctionList count]) ? completionFunctionList : [NSArray array]; + return (completionFunctionList != nil && [completionFunctionList count]) ? completionFunctionList : @[]; } /** @@ -398,7 +398,7 @@ */ - (NSArray*)keywordList { - return (completionKeywordList != nil && [completionKeywordList count]) ? completionKeywordList : [NSArray array]; + return (completionKeywordList != nil && [completionKeywordList count]) ? completionKeywordList : @[]; } /** diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index c73501b8..38758a45 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -124,7 +124,7 @@ [self _initWithNoSelection]; // Register drag types - [favoritesTableView registerForDraggedTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType]]; + [favoritesTableView registerForDraggedTypes:@[SPFavoritesPasteboardDragType]]; [favoritesArrayController setContent:favorites]; [favoritesTableView reloadData]; @@ -310,7 +310,7 @@ #ifndef SP_CODA NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; + [panel setAllowedFileTypes:@[SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -335,7 +335,7 @@ #ifndef SP_CODA NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionDefault]]; + [panel setAllowedFileTypes:@[SPFileExtensionDefault]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -677,7 +677,7 @@ - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard*)pboard { - NSArray *pboardTypes = [NSArray arrayWithObject:SPFavoritesPasteboardDragType]; + NSArray *pboardTypes = @[SPFavoritesPasteboardDragType]; NSInteger originalRow = [rows firstIndex]; if(originalRow < 1) return NO; diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index 80c9f558..43da2068 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -126,7 +126,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setAllowedFileTypes:[NSArray arrayWithObject:@"cnf"]]; + [panel setAllowedFileTypes:@[@"cnf"]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 9d875555..4ee09fd9 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -165,7 +165,7 @@ [self updateTriggersForCurrentTable]; } else { - return [NSArray array]; + return @[]; } } diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index 4d2f580c..c027d339 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -74,7 +74,7 @@ else { // If the structure has loaded (not still loading!) and the table encoding // is set, use the appropriate collations. - collations = ([tableDocumentInstance structureLoaded] && [tableDataInstance tableEncoding] != nil) ? [databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]] : [NSArray array]; + collations = ([tableDocumentInstance structureLoaded] && [tableDataInstance tableEncoding] != nil) ? [databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]] : @[]; } [[tableColumn dataCell] removeAllItems]; @@ -254,7 +254,7 @@ if (![self saveRowOnDeselect]) return NO; if ([rows count] == 1) { - [pboard declareTypes:[NSArray arrayWithObject:SPDefaultPasteboardDragType] owner:nil]; + [pboard declareTypes:@[SPDefaultPasteboardDragType] owner:nil]; [pboard setString:[[NSNumber numberWithInteger:[rows firstIndex]] stringValue] forType:SPDefaultPasteboardDragType]; return YES; diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index 4c4e8c37..5366d49e 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -335,8 +335,8 @@ if (!selectedTable) { [tableSourceView reloadData]; // Empty indexesController's fields and indices explicitly before reloading - [indexesController setFields:[NSArray array]]; - [indexesController setIndexes:[NSArray array]]; + [indexesController setFields:@[]]; + [indexesController setIndexes:@[]]; [indexesTableView reloadData]; return; diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 523a7ade..17c61faf 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -381,7 +381,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; NSMutableArray *sortedDbs = [NSMutableArray array]; - [sortedDbs addObjectsFromArray:[allDbs sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]]]; + [sortedDbs addObjectsFromArray:[allDbs sortedArrayUsingDescriptors:@[desc]]]; NSString *currentDb = nil; NSString *currentTable = nil; @@ -478,7 +478,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [sortedTables addObject:aTableName_id]; } else { [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[db componentsSeparatedByString:SPUniqueSchemaDelimiter] lastObject], @"display", @"database-small", @"image", @"", @"isRef", nil]]; - [sortedTables addObjectsFromArray:[allTables sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]]]; + [sortedTables addObjectsFromArray:[allTables sortedArrayUsingDescriptors:@[desc]]]; if([sortedTables count] > 1 && [sortedTables containsObject:[NSString stringWithFormat:@"%@%@%@", db, SPUniqueSchemaDelimiter, currentTable]]) { [sortedTables removeObject:[NSString stringWithFormat:@"%@%@%@", db, SPUniqueSchemaDelimiter, currentTable]]; [sortedTables insertObject:[NSString stringWithFormat:@"%@%@%@", db, SPUniqueSchemaDelimiter, currentTable] atIndex:0]; @@ -508,7 +508,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS break; } if(!breakFlag) { - NSArray *sortedFields = [allFields sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]]; + NSArray *sortedFields = [allFields sortedArrayUsingDescriptors:@[desc]]; for(id field in sortedFields) { if(![field hasPrefix:@" "]) { NSString *fieldpath = [field substringFromIndex:[field rangeOfString:SPUniqueSchemaDelimiter].location]; @@ -1127,7 +1127,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS if (rtf) { - [pb declareTypes:[NSArray arrayWithObject:NSRTFPboardType] owner:self]; + [pb declareTypes:@[NSRTFPboardType] owner:self]; [pb setData:rtf forType:NSRTFPboardType]; } } @@ -1414,7 +1414,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS // if(currentDb != nil && dbs != nil && [dbs count] && [dbs objectForKey:currentDb]) { // NSArray *allTables = [[dbs objectForKey:currentDb] allKeys]; // NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; - // NSArray *sortedTables = [allTables sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]]; + // NSArray *sortedTables = [allTables sortedArrayUsingDescriptors:@[desc]]; // [desc release]; // for(id table in sortedTables) { // NSDictionary * theTable = [[dbs objectForKey:currentDb] objectForKey:table]; @@ -1431,7 +1431,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS // } else { arr = [NSArray arrayWithArray:[[(NSObject*)[self delegate] valueForKeyPath:@"tablesListInstance"] allTableAndViewNames]]; if(arr == nil) { - arr = [NSArray array]; + arr = @[]; } for(id w in arr) [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:w, @"display", @"table-small-square", @"image", @"", @"isRef", nil]]; @@ -1440,13 +1440,13 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS else if([kind isEqualToString:@"$SP_ASLIST_ALL_DATABASES"]) { arr = [NSArray arrayWithArray:[[(NSObject*)[self delegate] valueForKeyPath:@"tablesListInstance"] allDatabaseNames]]; if(arr == nil) { - arr = [NSArray array]; + arr = @[]; } for(id w in arr) [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:w, @"display", @"database-small", @"image", @"", @"isRef", nil]]; arr = [NSArray arrayWithArray:[[(NSObject*)[self delegate] valueForKeyPath:@"tablesListInstance"] allSystemDatabaseNames]]; if(arr == nil) { - arr = [NSArray array]; + arr = @[]; } for(id w in arr) [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:w, @"display", @"database-small", @"image", @"", @"isRef", nil]]; @@ -1466,7 +1466,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS NSDictionary * theTable = [[dbs objectForKey:currentDb] objectForKey:currentTable]; NSArray *allFields = [theTable allKeys]; NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; - NSArray *sortedFields = [allFields sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]]; + NSArray *sortedFields = [allFields sortedArrayUsingDescriptors:@[desc]]; [desc release]; for(id field in sortedFields) { if(![field hasPrefix:@" "]) { @@ -1499,7 +1499,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } else { arr = [NSArray arrayWithArray:[[tableDocumentInstance valueForKeyPath:@"tableDataInstance"] valueForKey:@"columnNames"]]; if(arr == nil) { - arr = [NSArray array]; + arr = @[]; } for(id w in arr) [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:w, @"display", @"field-small-square", @"image", @"", @"isRef", nil]]; diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 3fdcaa63..abfac606 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -135,7 +135,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; treeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"displayName" ascending:YES]; - [self setTreeSortDescriptors:[NSArray arrayWithObject:treeSortDescriptor]]; + [self setTreeSortDescriptors:@[treeSortDescriptor]]; [super windowDidLoad]; } -- cgit v1.2.3 From 3b251b8e3d4dc9a694ef76562b388ab07da54785 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 19:48:41 +0100 Subject: Replace some NSDictionaries with literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist). --- Frameworks/PSMTabBar/PSMTabBarControl.m | 4 +- Frameworks/PSMTabBar/PSMTabDragAssistant.m | 4 +- .../SPMySQLFramework/Source/SPMySQLConnection.m | 28 +-- Source/GeneratePreviewForURL.m | 2 +- Source/MGTemplateEngine.m | 7 +- Source/MGTemplateStandardFilters.m | 5 +- Source/MGTemplateStandardMarkers.m | 22 +- Source/SPActivityTextFieldCell.m | 2 +- Source/SPAppController.m | 35 +-- Source/SPBundleCommandRunner.m | 2 +- Source/SPBundleCommandTextView.m | 2 +- Source/SPBundleEditorController.m | 241 ++++++++++----------- Source/SPConnectionController.m | 22 +- Source/SPContentFilterManager.m | 16 +- Source/SPCopyTable.m | 8 +- Source/SPCustomQuery.m | 34 ++- Source/SPDataImport.m | 4 +- Source/SPDatabaseData.m | 18 +- Source/SPDatabaseDocument.m | 94 ++++---- Source/SPEditorPreferencePane.m | 12 +- Source/SPExtendedTableInfo.m | 2 +- Source/SPFavoritesController.m | 2 +- Source/SPFavoritesExporter.m | 2 +- Source/SPFavoritesImporter.m | 6 +- Source/SPFieldEditorController.m | 2 +- Source/SPFieldMapperController.m | 7 +- Source/SPGrowlController.m | 2 +- Source/SPNarrowDownCompletion.m | 6 +- Source/SPNavigatorController.m | 18 +- Source/SPPreferenceControllerDelegate.m | 54 ++--- Source/SPPreferencesUpgrade.m | 80 +++---- Source/SPProcessListController.m | 2 +- Source/SPQueryController.m | 2 +- Source/SPQueryControllerInitializer.m | 2 +- Source/SPQueryFavoriteManager.m | 50 ++--- Source/SPSQLExporter.m | 2 +- Source/SPServerVariablesController.m | 2 +- Source/SPTableContent.m | 18 +- Source/SPTableData.m | 2 +- Source/SPTableInfo.m | 4 +- Source/SPTableRelations.m | 2 +- Source/SPTableStructure.m | 15 +- Source/SPTableStructureLoading.m | 4 +- Source/SPTablesList.m | 34 +-- Source/SPTextAndLinkCell.m | 2 +- Source/SPTextView.m | 2 +- Source/SPTooltip.m | 2 +- Source/SPWindowManagement.m | 14 +- 48 files changed, 437 insertions(+), 465 deletions(-) diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m index 55f9dfcd..7c1b059c 100644 --- a/Frameworks/PSMTabBar/PSMTabBarControl.m +++ b/Frameworks/PSMTabBar/PSMTabBarControl.m @@ -193,7 +193,7 @@ if (self) { // Initialization [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil]]; + [self registerForDraggedTypes:@[@"PSMTabBarControlItemPBType"]]; // resize [self setPostsFrameChangedNotifications:YES]; @@ -1990,7 +1990,7 @@ // Initialization [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil]]; + [self registerForDraggedTypes:@[@"PSMTabBarControlItemPBType"]]; if ([aDecoder allowsKeyedCoding]) { _cells = [[aDecoder decodeObjectForKey:@"PSMcells"] retain]; diff --git a/Frameworks/PSMTabBar/PSMTabDragAssistant.m b/Frameworks/PSMTabBar/PSMTabDragAssistant.m index bb2d255a..f10eadd4 100644 --- a/Frameworks/PSMTabBar/PSMTabDragAssistant.m +++ b/Frameworks/PSMTabBar/PSMTabDragAssistant.m @@ -192,7 +192,7 @@ static PSMTabDragAssistant *sharedDragAssistant = nil; } [cell setHighlighted:NO]; NSSize offset = NSZeroSize; - [pboard declareTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil] owner: nil]; + [pboard declareTypes:@[@"PSMTabBarControlItemPBType"] owner:nil]; [pboard setString:[[NSNumber numberWithInteger:[[control cells] indexOfObject:cell]] stringValue] forType:@"PSMTabBarControlItemPBType"]; _animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/30.0) target:self selector:@selector(animateDrag:) userInfo:nil repeats:YES]; @@ -768,7 +768,7 @@ static PSMTabDragAssistant *sharedDragAssistant = nil; PSMTabBarControl *tabBar; while ( (tabBar = [e nextObject]) ) { [self calculateDragAnimationForTabBar:tabBar]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; + [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:@[@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode"]]; } } diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index 79d5060a..0d9d16ff 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -377,20 +377,20 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS { NSFileManager *fileManager = [NSFileManager defaultManager]; - NSArray *possibleSocketLocations = [NSArray arrayWithObjects: - @"/tmp/mysql.sock", // Default - @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location - @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location - @"/var/mysql/mysql.sock", // Mac OS X Server default - @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL - @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 - @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 - @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) - @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo - @"/var/tmp/mysql.sock", // As used on FreeBSD - @"/var/lib/mysql/mysql.sock", // As used by Fedora - @"/opt/local/lib/mysql/mysql.sock", // Alternate fedora - nil]; + NSArray *possibleSocketLocations = @[ + @"/tmp/mysql.sock", // Default + @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location + @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location + @"/var/mysql/mysql.sock", // Mac OS X Server default + @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL + @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 + @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 + @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) + @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo + @"/var/tmp/mysql.sock", // As used on FreeBSD + @"/var/lib/mysql/mysql.sock", // As used by Fedora + @"/opt/local/lib/mysql/mysql.sock" + ]; for (NSUInteger i = 0; i < [possibleSocketLocations count]; i++) { if ([fileManager fileExistsAtPath:[possibleSocketLocations objectAtIndex:i]]) diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index ebbadd5a..1062f11d 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -495,7 +495,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, [imgProps setObject:image forKey:(NSString *)kQLPreviewPropertyAttachmentDataKey]; } - [props setObject:[NSDictionary dictionaryWithObject:imgProps forKey:@"icon.tiff"] forKey:(NSString *)kQLPreviewPropertyAttachmentsKey]; + [props setObject:@{@"icon.tiff" : imgProps} forKey:(NSString *) kQLPreviewPropertyAttachmentsKey]; [props setObject:@"UTF-8" forKey:(NSString *)kQLPreviewPropertyTextEncodingNameKey]; [props setObject:[NSNumber numberWithInt:NSUTF8StringEncoding] forKey:(NSString *)kQLPreviewPropertyStringEncodingKey]; [props setObject:@"text/html" forKey:(NSString *)kQLPreviewPropertyMIMETypeKey]; diff --git a/Source/MGTemplateEngine.m b/Source/MGTemplateEngine.m index 4a5d3192..4fe7620b 100644 --- a/Source/MGTemplateEngine.m +++ b/Source/MGTemplateEngine.m @@ -189,10 +189,9 @@ SEL selector = @selector(templateEngine:encounteredError:isContinuing:); if ([(NSObject *)delegate respondsToSelector:selector]) { - NSError *error = [NSError errorWithDomain:TEMPLATE_ENGINE_ERROR_DOMAIN - code:code - userInfo:[NSDictionary dictionaryWithObject:errStr - forKey:NSLocalizedDescriptionKey]]; + NSError *error = [NSError errorWithDomain:TEMPLATE_ENGINE_ERROR_DOMAIN + code:code + userInfo:@{NSLocalizedDescriptionKey : errStr}]; [(NSObject *)delegate templateEngine:self encounteredError:error isContinuing:continuing]; diff --git a/Source/MGTemplateStandardFilters.m b/Source/MGTemplateStandardFilters.m index 3acc155e..f06ae752 100644 --- a/Source/MGTemplateStandardFilters.m +++ b/Source/MGTemplateStandardFilters.m @@ -16,10 +16,7 @@ - (NSArray *)filters { - return [NSArray arrayWithObjects: - UPPERCASE, LOWERCASE, CAPITALIZED, - DATE_FORMAT, COLOR_FORMAT, - nil]; + return @[UPPERCASE, LOWERCASE, CAPITALIZED, DATE_FORMAT, COLOR_FORMAT]; } - (NSObject *)filterInvoked:(NSString *)filter withArguments:(NSArray *)args onValue:(NSObject *)value diff --git a/Source/MGTemplateStandardMarkers.m b/Source/MGTemplateStandardMarkers.m index 543d16a7..5edcb00c 100644 --- a/Source/MGTemplateStandardMarkers.m +++ b/Source/MGTemplateStandardMarkers.m @@ -107,29 +107,20 @@ - (NSArray *)markers { - return [NSArray arrayWithObjects: - FOR_START, FOR_END, - SECTION_START, SECTION_END, - IF_START, ELSE, IF_END, - NOW, - COMMENT_START, COMMENT_END, - LOAD, - CYCLE, - SET, - nil]; + return @[FOR_START, FOR_END, SECTION_START, SECTION_END, IF_START, ELSE, IF_END, NOW, COMMENT_START, COMMENT_END, LOAD, CYCLE, SET]; } - (NSArray *)endMarkersForMarker:(NSString *)marker { if ([marker isEqualToString:FOR_START]) { - return [NSArray arrayWithObjects:FOR_END, nil]; + return @[FOR_END]; } else if ([marker isEqualToString:SECTION_START]) { - return [NSArray arrayWithObjects:SECTION_END, nil]; + return @[SECTION_END]; } else if ([marker isEqualToString:IF_START]) { - return [NSArray arrayWithObjects:IF_END, ELSE, nil]; + return @[IF_END, ELSE]; } else if ([marker isEqualToString:COMMENT_START]) { - return [NSArray arrayWithObjects:COMMENT_END, nil]; + return @[COMMENT_END]; } return nil; } @@ -531,8 +522,7 @@ } else if ([marker isEqualToString:SET]) { if (args && [args count] == 2 && *outputEnabled) { // Set variable arg1 to value arg2. - NSDictionary *newVar = [NSDictionary dictionaryWithObject:[args objectAtIndex:1] - forKey:[args objectAtIndex:0]]; + NSDictionary *newVar = @{[args objectAtIndex:0] : [args objectAtIndex:1]}; if (newVar) { *newVariables = newVar; } diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index 52b85bdd..5eb2deda 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -206,7 +206,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) /** * Allow hit tracking for cancel functionality */ -- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView +- (NSCellHitResult)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView { return NSCellHitContentArea | NSCellHitTrackableArea; } diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 56da49cf..3f9db630 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1821,10 +1821,12 @@ // For each scope add a submenu but not for the last one (should be General always) [menu addItem:[NSMenuItem separatorItem]]; [menu setAutoenablesItems:YES]; - NSArray *scopes = [NSArray arrayWithObjects:SPBundleScopeInputField, SPBundleScopeDataTable, SPBundleScopeGeneral, nil]; - NSArray *scopeTitles = [NSArray arrayWithObjects:NSLocalizedString(@"Input Field", @"input field menu item label"), - NSLocalizedString(@"Data Table", @"data table menu item label"), - NSLocalizedString(@"General", @"general menu item label"),nil]; + NSArray *scopes = @[SPBundleScopeInputField, SPBundleScopeDataTable, SPBundleScopeGeneral]; + NSArray *scopeTitles = @[ + NSLocalizedString(@"Input Field", @"input field menu item label"), + NSLocalizedString(@"Data Table", @"data table menu item label"), + NSLocalizedString(@"General", @"general menu item label") + ]; NSUInteger k = 0; BOOL bundleOtherThanGeneralFound = NO; @@ -2023,19 +2025,18 @@ */ - (NSMutableDictionary*)anonymizePreferencesForFeedbackReport:(NSMutableDictionary *)preferences { - [preferences removeObjectsForKeys: - [NSArray arrayWithObjects: - @"ContentFilters", - @"favorites", - @"lastSqlFileName", - @"NSNavLastRootDirectory", - @"openPath", - @"queryFavorites", - @"queryHistory", - @"tableColumnWidths", - @"savePath", - @"NSRecentDocumentRecords", - nil]]; + [preferences removeObjectsForKeys:@[ + @"ContentFilters", + @"favorites", + @"lastSqlFileName", + @"NSNavLastRootDirectory", + @"openPath", + @"queryFavorites", + @"queryHistory", + @"tableColumnWidths", + @"savePath", + @"NSRecentDocumentRecords" + ]]; return preferences; } diff --git a/Source/SPBundleCommandRunner.m b/Source/SPBundleCommandRunner.m index b8e22b93..45184618 100644 --- a/Source/SPBundleCommandRunner.m +++ b/Source/SPBundleCommandRunner.m @@ -219,7 +219,7 @@ // register command pid = [bashTask processIdentifier]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:pid], @"pid", - (contextInfo)?:[NSDictionary dictionary], @"contextInfo", + (contextInfo)?: @{}, @"contextInfo", @"bashcommand", @"type", [[NSDate date] descriptionWithCalendarFormat:@"%H:%M:%S" timeZone:nil locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]], @"starttime", nil]; diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index 4ca63451..9a2d2ba8 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -377,7 +377,7 @@ NSInteger tabStopWidth = [prefs integerForKey:SPCustomQueryEditorTabStopWidth]; if(tabStopWidth < 1) tabStopWidth = 1; - float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width; + float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:@{NSFontAttributeName : tvFont}]).width; tabWidth = (float)tabStopWidth * tabWidth; NSInteger numberOfTabs = 256/tabStopWidth; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 4de339de..cb4ccf88 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -130,17 +130,17 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; triggerGeneralPopUpMenu = [[NSMenu alloc] initWithTitle:@""]; withBlobDataTablePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; - inputGeneralScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, nil] retain]; - inputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent, nil] retain]; - inputDataTableScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedTableRowsAsTab, SPBundleInputSourceSelectedTableRowsAsCsv, SPBundleInputSourceSelectedTableRowsAsSqlInsert, SPBundleInputSourceTableRowsAsTab, SPBundleInputSourceTableRowsAsCsv, SPBundleInputSourceTableRowsAsSqlInsert, nil] retain]; - outputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionInsertAsSnippet, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain]; - outputGeneralScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain]; - outputDataTableScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain]; - inputFallbackInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceCurrentWord, SPBundleInputSourceCurrentLine, SPBundleInputSourceCurrentQuery, SPBundleInputSourceEntireContent, nil] retain]; - triggerInputFieldArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, nil] retain]; - triggerDataTableArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, SPBundleTriggerActionTableRowChanged, nil] retain]; - triggerGeneralArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, nil] retain]; - withBlobDataTableArray = [[NSArray arrayWithObjects:SPBundleInputSourceBlobHandlingExclude, SPBundleInputSourceBlobHandlingInclude, SPBundleInputSourceBlobHandlingImageFileReference, SPBundleInputSourceBlobHandlingFileReference, nil] retain]; + inputGeneralScopeArray = [@[SPBundleInputSourceNone] retain]; + inputInputFieldScopeArray = [@[SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent] retain]; + inputDataTableScopeArray = [@[SPBundleInputSourceNone, SPBundleInputSourceSelectedTableRowsAsTab, SPBundleInputSourceSelectedTableRowsAsCsv, SPBundleInputSourceSelectedTableRowsAsSqlInsert, SPBundleInputSourceTableRowsAsTab, SPBundleInputSourceTableRowsAsCsv, SPBundleInputSourceTableRowsAsSqlInsert] retain]; + outputInputFieldScopeArray = [@[SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionInsertAsSnippet, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML] retain]; + outputGeneralScopeArray = [@[SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML] retain]; + outputDataTableScopeArray = [@[SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML] retain]; + inputFallbackInputFieldScopeArray = [@[SPBundleInputSourceNone, SPBundleInputSourceCurrentWord, SPBundleInputSourceCurrentLine, SPBundleInputSourceCurrentQuery, SPBundleInputSourceEntireContent] retain]; + triggerInputFieldArray = [@[SPBundleTriggerActionNone] retain]; + triggerDataTableArray = [@[SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, SPBundleTriggerActionTableRowChanged] retain]; + triggerGeneralArray = [@[SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged] retain]; + withBlobDataTableArray = [@[SPBundleInputSourceBlobHandlingExclude, SPBundleInputSourceBlobHandlingInclude, SPBundleInputSourceBlobHandlingImageFileReference, SPBundleInputSourceBlobHandlingFileReference] retain]; NSMutableArray *allPopupScopeItems = [NSMutableArray array]; [allPopupScopeItems addObjectsFromArray:inputGeneralScopeArray]; @@ -155,65 +155,65 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [allPopupScopeItems addObjectsFromArray:triggerGeneralArray]; [allPopupScopeItems addObjectsFromArray:withBlobDataTableArray]; - NSDictionary *menuItemTitles = [NSDictionary dictionaryWithObjects: - [NSArray arrayWithObjects: - NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Input source dropdown: 'None' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Input source dropdown: 'None' item"), - NSLocalizedString(@"Selected Text", @"Bundle Editor : Scope=Field : Input source dropdown: 'selected text' item"), - NSLocalizedString(@"Entire Content", @"Bundle Editor : Scope=Field : Input source dropdown: 'entire content' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'none' item"), - NSLocalizedString(@"Selected Rows (TSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as tab-separated' item"), - NSLocalizedString(@"Selected Rows (CSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as comma-separated' item"), - NSLocalizedString(@"Selected Rows (SQL)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as SQL' item"), - NSLocalizedString(@"Table Content (TSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as tab-separated' item"), - NSLocalizedString(@"Table Content (CSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as comma-separated' item"), - NSLocalizedString(@"Table Content (SQL)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as SQL' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Output dropdown : 'none' item"), - NSLocalizedString(@"Insert as Text", @"Bundle Editor : Scope=Field : Output dropdown : 'insert as text' item"), - NSLocalizedString(@"Insert as Snippet", @"Bundle Editor : Scope=Field : Output dropdown : 'insert as snippet' item"), - NSLocalizedString(@"Replace Selection", @"Bundle Editor : Scope=Field : Output dropdown : 'replace selection' item"), - NSLocalizedString(@"Replace Entire Content", @"Bundle Editor : Scope=Field : Output dropdown : 'replace entire content' item"), - NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=Field : Output dropdown : 'show as text tooltip' item"), - NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=Field : Output dropdown : 'show as html tooltip' item"), - NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=Field : Output dropdown : 'show as html' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Output dropdown : 'none' item"), - NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=General : Output dropdown : 'show as text tooltip' item"), - NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=General : Output dropdown : 'show as html tooltip' item"), - NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=General : Output dropdown : 'show as html' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'none' item"), - NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as text tooltip' item"), - NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as html tooltip' item"), - NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as html' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Fallback Input source dropdown : 'none' item"), - NSLocalizedString(@"Current Word", @"Bundle Editor : Fallback Input source dropdown : 'current word' item"), - NSLocalizedString(@"Current Line", @"Bundle Editor : Fallback Input source dropdown : 'current line' item"), - NSLocalizedString(@"Current Query", @"Bundle Editor : Fallback Input source dropdown : 'current query' item"), - NSLocalizedString(@"Entire Content", @"Bundle Editor : Fallback Input source dropdown : 'entire content' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Trigger dropdown : 'none' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'none' item"), - NSLocalizedString(@"Database changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'database changed' item"), - NSLocalizedString(@"Table changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'table changed' item"), - NSLocalizedString(@"Table Row changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'table row changed' item"), - - NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Trigger dropdown : 'none' item"), - NSLocalizedString(@"Database changed", @"Bundle Editor : Scope=General : Trigger dropdown : 'database changed' item"), - NSLocalizedString(@"Table changed", @"Bundle Editor : Scope=General : Trigger dropdown : 'table changed' item"), - - NSLocalizedString(@"exclude BLOB", @"Bundle Editor : BLOB dropdown : 'exclude BLOB' item"), - NSLocalizedString(@"include BLOB", @"Bundle Editor : BLOB dropdown : 'include BLOB' item"), - NSLocalizedString(@"save BLOB as image file", @"Bundle Editor : BLOB dropdown : 'save BLOB as image file' item"), - NSLocalizedString(@"save BLOB as dat file", @"Bundle Editor : BLOB dropdown : 'save BLOB as dat file' item"), - - nil] - forKeys:allPopupScopeItems]; + NSDictionary *menuItemTitles = @{ + allPopupScopeItems : @[ + NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Input source dropdown: 'None' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Input source dropdown: 'None' item"), + NSLocalizedString(@"Selected Text", @"Bundle Editor : Scope=Field : Input source dropdown: 'selected text' item"), + NSLocalizedString(@"Entire Content", @"Bundle Editor : Scope=Field : Input source dropdown: 'entire content' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'none' item"), + NSLocalizedString(@"Selected Rows (TSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as tab-separated' item"), + NSLocalizedString(@"Selected Rows (CSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as comma-separated' item"), + NSLocalizedString(@"Selected Rows (SQL)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'selected rows as SQL' item"), + NSLocalizedString(@"Table Content (TSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as tab-separated' item"), + NSLocalizedString(@"Table Content (CSV)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as comma-separated' item"), + NSLocalizedString(@"Table Content (SQL)", @"Bundle Editor : Scope=Data-Table : Input source dropdown: 'table content as SQL' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Output dropdown : 'none' item"), + NSLocalizedString(@"Insert as Text", @"Bundle Editor : Scope=Field : Output dropdown : 'insert as text' item"), + NSLocalizedString(@"Insert as Snippet", @"Bundle Editor : Scope=Field : Output dropdown : 'insert as snippet' item"), + NSLocalizedString(@"Replace Selection", @"Bundle Editor : Scope=Field : Output dropdown : 'replace selection' item"), + NSLocalizedString(@"Replace Entire Content", @"Bundle Editor : Scope=Field : Output dropdown : 'replace entire content' item"), + NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=Field : Output dropdown : 'show as text tooltip' item"), + NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=Field : Output dropdown : 'show as html tooltip' item"), + NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=Field : Output dropdown : 'show as html' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Output dropdown : 'none' item"), + NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=General : Output dropdown : 'show as text tooltip' item"), + NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=General : Output dropdown : 'show as html tooltip' item"), + NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=General : Output dropdown : 'show as html' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'none' item"), + NSLocalizedString(@"Show as Text Tooltip", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as text tooltip' item"), + NSLocalizedString(@"Show as HTML Tooltip", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as html tooltip' item"), + NSLocalizedString(@"Show as HTML", @"Bundle Editor : Scope=Data-Table : Output dropdown : 'show as html' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Fallback Input source dropdown : 'none' item"), + NSLocalizedString(@"Current Word", @"Bundle Editor : Fallback Input source dropdown : 'current word' item"), + NSLocalizedString(@"Current Line", @"Bundle Editor : Fallback Input source dropdown : 'current line' item"), + NSLocalizedString(@"Current Query", @"Bundle Editor : Fallback Input source dropdown : 'current query' item"), + NSLocalizedString(@"Entire Content", @"Bundle Editor : Fallback Input source dropdown : 'entire content' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Trigger dropdown : 'none' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'none' item"), + NSLocalizedString(@"Database changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'database changed' item"), + NSLocalizedString(@"Table changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'table changed' item"), + NSLocalizedString(@"Table Row changed", @"Bundle Editor : Scope=Data-Table : Trigger dropdown : 'table row changed' item"), + + NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Trigger dropdown : 'none' item"), + NSLocalizedString(@"Database changed", @"Bundle Editor : Scope=General : Trigger dropdown : 'database changed' item"), + NSLocalizedString(@"Table changed", @"Bundle Editor : Scope=General : Trigger dropdown : 'table changed' item"), + + NSLocalizedString(@"exclude BLOB", @"Bundle Editor : BLOB dropdown : 'exclude BLOB' item"), + NSLocalizedString(@"include BLOB", @"Bundle Editor : BLOB dropdown : 'include BLOB' item"), + NSLocalizedString(@"save BLOB as image file", @"Bundle Editor : BLOB dropdown : 'save BLOB as image file' item"), + NSLocalizedString(@"save BLOB as dat file", @"Bundle Editor : BLOB dropdown : 'save BLOB as dat file' item"), + + ] + }; NSMenuItem *anItem; for(NSString* title in inputGeneralScopeArray) { @@ -294,52 +294,51 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [commandBundleTreeController setSortDescriptors:[NSArray arrayWithObjects:sortDescriptor, nil]]; - shellVariableSuggestions = [[NSArray arrayWithObjects: - SPBundleShellVariableAllDatabases, - SPBundleShellVariableAllFunctions, - SPBundleShellVariableAllProcedures, - SPBundleShellVariableAllTables, - SPBundleShellVariableAllViews, - SPBundleShellVariableAppResourcesDirectory, - SPBundleShellVariableBlobFileDirectory, - SPBundleShellVariableExitInsertAsSnippet, - SPBundleShellVariableExitInsertAsText, - SPBundleShellVariableExitNone, - SPBundleShellVariableExitReplaceContent, - SPBundleShellVariableExitReplaceSelection, - SPBundleShellVariableExitShowAsHTML, - SPBundleShellVariableExitShowAsHTMLTooltip, - SPBundleShellVariableExitShowAsTextTooltip, - SPBundleShellVariableInputFilePath, - SPBundleShellVariableInputTableMetaData, - SPBundleShellVariableBundlePath, - SPBundleShellVariableBundleScope, - SPBundleShellVariableCurrentEditedColumnName, - SPBundleShellVariableCurrentEditedTable, - SPBundleShellVariableCurrentHost, - SPBundleShellVariableCurrentLine, - SPBundleShellVariableCurrentPort, - SPBundleShellVariableCurrentQuery, - SPBundleShellVariableCurrentUser, - SPBundleShellVariableCurrentWord, - SPBundleShellVariableDataTableSource, - SPBundleShellVariableDatabaseEncoding, - SPBundleShellVariableIconFile, - SPBundleShellVariableProcessID, - SPBundleShellVariableQueryFile, - SPBundleShellVariableQueryResultFile, - SPBundleShellVariableQueryResultMetaFile, - SPBundleShellVariableQueryResultStatusFile, - SPBundleShellVariableRDBMSType, - SPBundleShellVariableRDBMSVersion, - SPBundleShellVariableSelectedDatabase, - SPBundleShellVariableSelectedRowIndices, - SPBundleShellVariableSelectedTable, - SPBundleShellVariableSelectedTables, - SPBundleShellVariableSelectedText, - SPBundleShellVariableSelectedTextRange, - SPBundleShellVariableUsedQueryForTable, - nil + shellVariableSuggestions = [@[ + SPBundleShellVariableAllDatabases, + SPBundleShellVariableAllFunctions, + SPBundleShellVariableAllProcedures, + SPBundleShellVariableAllTables, + SPBundleShellVariableAllViews, + SPBundleShellVariableAppResourcesDirectory, + SPBundleShellVariableBlobFileDirectory, + SPBundleShellVariableExitInsertAsSnippet, + SPBundleShellVariableExitInsertAsText, + SPBundleShellVariableExitNone, + SPBundleShellVariableExitReplaceContent, + SPBundleShellVariableExitReplaceSelection, + SPBundleShellVariableExitShowAsHTML, + SPBundleShellVariableExitShowAsHTMLTooltip, + SPBundleShellVariableExitShowAsTextTooltip, + SPBundleShellVariableInputFilePath, + SPBundleShellVariableInputTableMetaData, + SPBundleShellVariableBundlePath, + SPBundleShellVariableBundleScope, + SPBundleShellVariableCurrentEditedColumnName, + SPBundleShellVariableCurrentEditedTable, + SPBundleShellVariableCurrentHost, + SPBundleShellVariableCurrentLine, + SPBundleShellVariableCurrentPort, + SPBundleShellVariableCurrentQuery, + SPBundleShellVariableCurrentUser, + SPBundleShellVariableCurrentWord, + SPBundleShellVariableDataTableSource, + SPBundleShellVariableDatabaseEncoding, + SPBundleShellVariableIconFile, + SPBundleShellVariableProcessID, + SPBundleShellVariableQueryFile, + SPBundleShellVariableQueryResultFile, + SPBundleShellVariableQueryResultMetaFile, + SPBundleShellVariableQueryResultStatusFile, + SPBundleShellVariableRDBMSType, + SPBundleShellVariableRDBMSVersion, + SPBundleShellVariableSelectedDatabase, + SPBundleShellVariableSelectedRowIndices, + SPBundleShellVariableSelectedTable, + SPBundleShellVariableSelectedTables, + SPBundleShellVariableSelectedText, + SPBundleShellVariableSelectedTextRange, + SPBundleShellVariableUsedQueryForTable ] retain]; if([[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey]) { @@ -348,7 +347,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [self _initTree]; -} +}; #pragma mark - @@ -675,7 +674,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; if(category == nil) category = @""; bundle = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:NSLocalizedString(@"New Bundle",@"Bundle Editor : Default name for new bundle in the list on the left"), NSLocalizedString(@"New Name",@"Bundle Editor : Default name for a new bundle in the menu"), @"", scope, category, newUUID, nil] - forKeys:[NSArray arrayWithObjects:kBundleNameKey, SPBundleFileNameKey, SPBundleFileCommandKey, SPBundleFileScopeKey, SPBundleFileCategoryKey, SPBundleFileUUIDKey, nil]]; + forKeys:@[kBundleNameKey, SPBundleFileNameKey, SPBundleFileCommandKey, SPBundleFileScopeKey, SPBundleFileCategoryKey, SPBundleFileUUIDKey]]; } if(![touchedBundleArray containsObject:[bundle objectForKey:kBundleNameKey]]) @@ -929,9 +928,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [saveDict setObject:[[saveDict objectForKey:SPBundleFileContactKey] rot13] forKey:SPBundleFileContactKey]; // Remove unnecessary keys - [saveDict removeObjectsForKeys:[NSArray arrayWithObjects: - kBundleNameKey, - nil]]; + [saveDict removeObjectsForKeys:@[kBundleNameKey]]; if(!isNewBundle) { @@ -1493,7 +1490,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; /** * Allow for drag-n-drop out of the application as a copy */ -- (NSUInteger)draggingSourceOperationMaskForLocal:(BOOL)isLocal +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NSDragOperationMove; } diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index e98cc426..e9d9272c 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -779,7 +779,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, { NSNumber *favoriteID = [self _createNewFavoriteID]; - NSArray *objects = [NSArray arrayWithObjects: + NSArray *objects = @[ NSLocalizedString(@"New Favorite", @"new favorite name"), @0, @"", @@ -787,20 +787,20 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, @"", @(-1), @"", - [NSNumber numberWithInt:NSOffState], - [NSNumber numberWithInt:NSOffState], - [NSNumber numberWithInt:NSOffState], - [NSNumber numberWithInt:NSOffState], + @(NSOffState), + @(NSOffState), + @(NSOffState), + @(NSOffState), @"", @"", @"", - [NSNumber numberWithInt:NSOffState], + @(NSOffState), @"", @"", - favoriteID, - nil]; + favoriteID + ]; - NSArray *keys = [NSArray arrayWithObjects: + NSArray *keys = @[ SPFavoriteNameKey, SPFavoriteTypeKey, SPFavoriteHostKey, @@ -818,8 +818,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, SPFavoriteSSHKeyLocationEnabledKey, SPFavoriteSSHKeyLocationKey, SPFavoriteSSHPortKey, - SPFavoriteIDKey, - nil]; + SPFavoriteIDKey + ]; // Create default favorite NSMutableDictionary *favorite = [NSMutableDictionary dictionaryWithObjects:objects forKeys:keys]; diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index d6fed676..e35fd672 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -89,12 +89,12 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [contentFilterSplitView setMaxSize:245.f ofSubviewAtIndex:0]; // Add global group row to contentFilters - [contentFilters addObject:[NSDictionary dictionaryWithObjectsAndKeys: - NSLocalizedString(@"Global",@"Content Filter Manager : Filter Entry List: 'Global' Header"), @"MenuLabel", - @"", @"headerOfFileURL", - @"", @"Clause", - @"", @"ConjunctionLabel", - nil]]; + [contentFilters addObject:@{ + @"MenuLabel" : NSLocalizedString(@"Global", @"Content Filter Manager : Filter Entry List: 'Global' Header"), + @"headerOfFileURL" : @"", + @"Clause" : @"", + @"ConjunctionLabel" : @"" + }]; #ifndef SP_CODA /* prefs access */ // Build data source for global content filter (as mutable copy! otherwise each @@ -240,10 +240,10 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; // Duplicate a selected filter if sender == self if(sender == self) - filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithFormat:NSLocalizedString(@"%@ Copy",@"Content Filter Manager : Initial name of copied filter"),[contentFilterNameTextField stringValue]], [contentFilterTextView string], nil] forKeys:[NSArray arrayWithObjects:@"MenuLabel", @"Clause", nil]]; + filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithFormat:NSLocalizedString(@"%@ Copy",@"Content Filter Manager : Initial name of copied filter"),[contentFilterNameTextField stringValue]], [contentFilterTextView string], nil] forKeys:@[@"MenuLabel", @"Clause"]]; // Add a new filter else - filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:NSLocalizedString(@"New Filter",@"Content Filter Manager : Initial name for new filter"), @"", @"", nil] forKeys:[NSArray arrayWithObjects:@"MenuLabel", @"Clause", @"ConjunctionLabel", nil]]; + filter = [NSMutableDictionary dictionaryWithObjects:@[NSLocalizedString(@"New Filter",@"Content Filter Manager : Initial name for new filter"), @"", @""] forKeys:@[@"MenuLabel", @"Clause", @"ConjunctionLabel"]]; // If a favourite is currently selected, add the new favourite next to it if([contentFilterTableView numberOfSelectedRows] > 0) { diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 7796ca11..3efc132a 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -108,7 +108,7 @@ static const NSInteger kBlobAsImageFile = 4; if (tmp != nil){ NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObjects: NSStringPboardType, nil] owner:nil]; + [pb declareTypes:@[NSStringPboardType] owner:nil]; [pb setString:tmp forType:NSStringPboardType]; } @@ -119,7 +119,7 @@ static const NSInteger kBlobAsImageFile = 4; if (tmp != nil) { NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObjects:NSTabularTextPboardType, NSStringPboardType, nil] owner:nil]; + [pb declareTypes:@[NSTabularTextPboardType, NSStringPboardType] owner:nil]; [pb setString:tmp forType:NSStringPboardType]; [pb setString:tmp forType:NSTabularTextPboardType]; @@ -781,7 +781,7 @@ static const NSInteger kBlobAsImageFile = 4; NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; #endif NSUInteger columnIndex = (NSUInteger)[[columnDefinition objectForKey:@"datacolumnindex"] integerValue]; - NSDictionary *stringAttributes = [NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]; + NSDictionary *stringAttributes = @{NSFontAttributeName : tableFont}; Class spmysqlGeometryData = [SPMySQLGeometryData class]; // Check the number of rows available to check, sampling every n rows @@ -870,7 +870,7 @@ static const NSInteger kBlobAsImageFile = 4; maxCellWidth += columnBaseWidth; // If the header width is wider than this expanded width, use it instead - cellWidth = [[columnDefinition objectForKey:@"name"] sizeWithAttributes:[NSDictionary dictionaryWithObject:[NSFont labelFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName]].width; + cellWidth = [[columnDefinition objectForKey:@"name"] sizeWithAttributes:@{NSFontAttributeName : [NSFont labelFontOfSize:[NSFont smallSystemFontSize]]}].width; if (cellWidth + 10 > maxCellWidth) maxCellWidth = cellWidth + 10; return maxCellWidth; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 21ce6970..94d1b355 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1664,7 +1664,7 @@ #else NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; #endif - [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height]; + [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:@{NSFontAttributeName : tableFont}]).height]; // If there are no table columns to add, return if (!cqColumnDefinition || ![cqColumnDefinition count]) return; @@ -1808,7 +1808,7 @@ NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[customQueryView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:@(-2), @"", nil]; + return @[@(-2), @""]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -1819,13 +1819,13 @@ // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -1837,7 +1837,7 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -1847,7 +1847,7 @@ fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -1857,14 +1857,14 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } } @@ -2290,9 +2290,7 @@ NSString *tmp = [customQueryView draggedRowsAsTabString]; if ( nil != tmp ) { - [pboard declareTypes:[NSArray arrayWithObjects: NSTabularTextPboardType, - NSStringPboardType, nil] - owner:nil]; + [pboard declareTypes:@[NSTabularTextPboardType, NSStringPboardType] owner:nil]; [pboard setString:tmp forType:NSStringPboardType]; [pboard setString:tmp forType:NSTabularTextPboardType]; return YES; @@ -3394,7 +3392,7 @@ NSMutableParagraphStyle *paraStyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; [paraStyle setTabStops:@[]]; [paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]]; - NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]]; + NSDictionary *attributes = @{NSParagraphStyleAttributeName : paraStyle, NSFontAttributeName : [NSFont systemFontOfSize:11]}; NSAttributedString *titleString = [[[NSAttributedString alloc] initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@⇥", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"] attributes:attributes] autorelease]; @@ -3420,7 +3418,7 @@ NSMutableParagraphStyle *paraStyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; [paraStyle setTabStops:@[]]; [paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]]; - NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]]; + NSDictionary *attributes = @{NSParagraphStyleAttributeName : paraStyle, NSFontAttributeName : [NSFont systemFontOfSize:11]}; NSAttributedString *titleString = [[[NSAttributedString alloc] initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@⇥", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"] attributes:attributes] autorelease]; @@ -3540,11 +3538,7 @@ // Result Table Font preference changed else if ([keyPath isEqualToString:SPGlobalResultTableFont]) { NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]; -#ifndef SP_CODA - [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height]; -#else - [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height]; -#endif + [customQueryView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:@{NSFontAttributeName : tableFont}]).height]; [customQueryView setFont:tableFont]; [customQueryView reloadData]; } @@ -3596,13 +3590,13 @@ if([saveQueryFavoriteGlobal state] == NSOnState) { [favorites addObject:[NSMutableDictionary dictionaryWithObjects: [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil] - forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]]; + forKeys:@[@"name", @"query"]]]; [prefs setObject:favorites forKey:SPQueryFavorites]; } else { [[SPQueryController sharedQueryController] addFavorite:[NSMutableDictionary dictionaryWithObjects: [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], [[queryToBeAddded mutableCopy] autorelease], nil] - forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]] forFileURL:[tableDocumentInstance fileURL]]; + forKeys:@[@"name", @"query"]] forFileURL:[tableDocumentInstance fileURL]]; } [saveQueryFavoriteGlobal setState:NSOffState]; diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index ed17a506..b0355b05 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -662,7 +662,7 @@ [tablesListInstance updateTables:self]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; // Import finished Growl notification [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished" @@ -1178,7 +1178,7 @@ [tablesListInstance performSelectorOnMainThread:@selector(updateTables:) withObject:self waitUntilDone:YES]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; // Select the new table [tablesListInstance selectItemWithName:selectedTableTarget]; diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m index 1bd9a8f9..58ffa2d2 100644 --- a/Source/SPDatabaseData.m +++ b/Source/SPDatabaseData.m @@ -167,7 +167,7 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, NSString *charSet = [NSString stringWithCString:c->name encoding:NSUTF8StringEncoding]; if ([charSet isEqualToString:characterSetEncoding]) { - [characterSetCollations addObject:[NSDictionary dictionaryWithObject:[NSString stringWithCString:c->collation encoding:NSUTF8StringEncoding] forKey:@"COLLATION_NAME"]]; + [characterSetCollations addObject:@{@"COLLATION_NAME" : [NSString stringWithCString:c->collation encoding:NSUTF8StringEncoding]}]; } ++c; @@ -191,36 +191,36 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, { if ([storageEngines count] == 0) { if ([serverSupport isMySQL3] || [serverSupport isMySQL4]) { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"MyISAM" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"MyISAM"}]; // Check if InnoDB support is enabled NSString *result = [self _getSingleVariableValue:@"have_innodb"]; if(result && [result isEqualToString:@"YES"]) - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"InnoDB" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"InnoDB"}]; // Before MySQL 4.1 the MEMORY engine was known as HEAP and the ISAM engine was included if ([serverSupport supportsPre41StorageEngines]) { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"HEAP" forKey:@"Engine"]]; - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"ISAM" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"HEAP"}]; + [storageEngines addObject:@{@"Engine" : @"ISAM"}]; } else { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"MEMORY" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"MEMORY"}]; } // BLACKHOLE storage engine was added in MySQL 4.1.11 if ([serverSupport supportsBlackholeStorageEngine]) { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"BLACKHOLE" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"BLACKHOLE"}]; } // ARCHIVE storage engine was added in MySQL 4.1.3 if ([serverSupport supportsArchiveStorageEngine]) { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"ARCHIVE" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"ARCHIVE"}]; } // CSV storage engine was added in MySQL 4.1.4 if ([serverSupport supportsCSVStorageEngine]) { - [storageEngines addObject:[NSDictionary dictionaryWithObject:@"CSV" forKey:@"Engine"]]; + [storageEngines addObject:@{@"Engine" : @"CSV"}]; } } // The table information_schema.engines didn't exist until MySQL 5.1.5 diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 88ab58ed..c62b42e4 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1012,8 +1012,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [self _addDatabase]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; - } + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; + } else { // Reset chooseDatabaseButton if ([[self database] length]) { @@ -1631,30 +1631,30 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; */ - (NSNumber *)encodingTagFromMySQLEncoding:(NSString *)mysqlEncoding { - NSDictionary *translationMap = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:SPEncodingUCS2], @"ucs2", - [NSNumber numberWithInt:SPEncodingUTF8], @"utf8", - [NSNumber numberWithInt:SPEncodingUTF8viaLatin1], @"utf8-", - [NSNumber numberWithInt:SPEncodingASCII], @"ascii", - [NSNumber numberWithInt:SPEncodingLatin1], @"latin1", - [NSNumber numberWithInt:SPEncodingMacRoman], @"macroman", - [NSNumber numberWithInt:SPEncodingCP1250Latin2], @"cp1250", - [NSNumber numberWithInt:SPEncodingISOLatin2], @"latin2", - [NSNumber numberWithInt:SPEncodingCP1256Arabic], @"cp1256", - [NSNumber numberWithInt:SPEncodingGreek], @"greek", - [NSNumber numberWithInt:SPEncodingHebrew], @"hebrew", - [NSNumber numberWithInt:SPEncodingLatin5Turkish], @"latin5", - [NSNumber numberWithInt:SPEncodingCP1257WinBaltic], @"cp1257", - [NSNumber numberWithInt:SPEncodingCP1251WinCyrillic], @"cp1251", - [NSNumber numberWithInt:SPEncodingBig5Chinese], @"big5", - [NSNumber numberWithInt:SPEncodingShiftJISJapanese], @"sjis", - [NSNumber numberWithInt:SPEncodingEUCJPJapanese], @"ujis", - [NSNumber numberWithInt:SPEncodingEUCKRKorean], @"euckr", - nil]; + NSDictionary *translationMap = @{ + @"ucs2" : @(SPEncodingUCS2), + @"utf8" : @(SPEncodingUTF8), + @"utf8-" : @(SPEncodingUTF8viaLatin1), + @"ascii" : @(SPEncodingASCII), + @"latin1" : @(SPEncodingLatin1), + @"macroman" : @(SPEncodingMacRoman), + @"cp1250" : @(SPEncodingCP1250Latin2), + @"latin2" : @(SPEncodingISOLatin2), + @"cp1256" : @(SPEncodingCP1256Arabic), + @"greek" : @(SPEncodingGreek), + @"hebrew" : @(SPEncodingHebrew), + @"latin5" : @(SPEncodingLatin5Turkish), + @"cp1257" : @(SPEncodingCP1257WinBaltic), + @"cp1251" : @(SPEncodingCP1251WinCyrillic), + @"big5" : @(SPEncodingBig5Chinese), + @"sjis" : @(SPEncodingShiftJISJapanese), + @"ujis" : @(SPEncodingEUCJPJapanese), + @"euckr" : @(SPEncodingEUCKRKorean) + }; NSNumber *encodingTag = [translationMap valueForKey:mysqlEncoding]; if (!encodingTag) - return [NSNumber numberWithInt:SPEncodingAutodetect]; + return @(SPEncodingAutodetect); return encodingTag; } @@ -2843,7 +2843,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[prefs integerForKey:SPLastSQLFileEncoding] includeDefaultEntry:NO encodingPopUp:&encodingPopUp]]; - [panel setAllowedFileTypes:[NSArray arrayWithObjects:SPFileExtensionSQL, nil]]; + [panel setAllowedFileTypes:@[SPFileExtensionSQL]]; if (![prefs stringForKey:@"lastSqlFileName"]) { [prefs setObject:@"" forKey:@"lastSqlFileName"]; @@ -2880,7 +2880,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } // Save current session (open connection windows as SPF file) - [panel setAllowedFileTypes:[NSArray arrayWithObjects:SPFileExtensionDefault, nil]]; + [panel setAllowedFileTypes:@[SPFileExtensionDefault]]; //Restore accessory view settings if possible if ([spfDocData objectForKey:@"save_password"]) { @@ -2933,7 +2933,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return; } - [panel setAllowedFileTypes:[NSArray arrayWithObjects:SPBundleFileExtension, nil]]; + [panel setAllowedFileTypes:@[SPBundleFileExtension]]; NSDictionary *spfSessionData = [SPAppDelegate spfSessionDocData]; @@ -3357,7 +3357,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfStructure setObject:[stateDetails objectForKey:SPQueryFavorites] forKey:SPQueryFavorites]; [spfStructure setObject:[stateDetails objectForKey:SPQueryHistory] forKey:SPQueryHistory]; [spfStructure setObject:[stateDetails objectForKey:SPContentFilters] forKey:SPContentFilters]; - [stateDetails removeObjectsForKeys:[NSArray arrayWithObjects:SPQueryFavorites, SPQueryHistory, SPContentFilters, nil]]; + [stateDetails removeObjectsForKeys:@[SPQueryFavorites, SPQueryHistory, SPContentFilters]]; [spfData addEntriesFromDictionary:stateDetails]; // Determine whether to use encryption when adding the data @@ -3443,13 +3443,13 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [[parentWindow windowController] addNewConnection:self]; // Get the current state - NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"connection", - @YES, @"history", - @YES, @"session", - @YES, @"query", - @YES, @"password", - nil]; + NSDictionary *allStateDetails = @{ + @"connection" : @YES, + @"history" : @YES, + @"session" : @YES, + @"query" : @YES, + @"password" : @YES + }; NSMutableDictionary *currentState = [NSMutableDictionary dictionaryWithDictionary:[self stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect, and clear the table @@ -3589,7 +3589,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } if (action == @selector(importFromClipboard:)){ - return [self database] && [[NSPasteboard generalPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:NSStringPboardType, nil]]; + return [self database] && [[NSPasteboard generalPasteboard] availableTypeFromArray:@[NSStringPboardType]]; } // Change "Save Query/Queries" menu item title dynamically @@ -4046,7 +4046,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; */ - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar { - return [NSArray arrayWithObjects: + return @[ SPMainToolbarDatabaseSelection, SPMainToolbarHistoryNavigation, SPMainToolbarShowConsole, @@ -4061,8 +4061,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSToolbarCustomizeToolbarItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, - NSToolbarSeparatorItemIdentifier, - nil]; + NSToolbarSeparatorItemIdentifier + ]; } /** @@ -4070,7 +4070,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; */ - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar { - return [NSArray arrayWithObjects: + return @[ SPMainToolbarDatabaseSelection, SPMainToolbarTableStructure, SPMainToolbarTableContent, @@ -4081,8 +4081,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSToolbarFlexibleSpaceItemIdentifier, SPMainToolbarHistoryNavigation, SPMainToolbarUserManager, - SPMainToolbarShowConsole, - nil]; + SPMainToolbarShowConsole + ]; } /** @@ -4090,14 +4090,14 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; */ - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: + return @[ SPMainToolbarTableStructure, SPMainToolbarTableContent, SPMainToolbarCustomQuery, SPMainToolbarTableInfo, SPMainToolbarTableRelations, - SPMainToolbarTableTriggers, - nil]; + SPMainToolbarTableTriggers + ]; } @@ -5643,7 +5643,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; - (NSDictionary*)shellVariables { - if(!_isConnected) return [NSDictionary dictionary]; + if(!_isConnected) return @{}; NSMutableDictionary *env = [NSMutableDictionary dictionary]; @@ -5865,9 +5865,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; { NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes:[NSArray arrayWithObjects: NSTabularTextPboardType, - NSStringPboardType, nil] - owner:nil]; + [pb declareTypes:@[NSTabularTextPboardType, NSStringPboardType] owner:nil]; [pb setString:tmp forType:NSStringPboardType]; [pb setString:tmp forType:NSTabularTextPboardType]; diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index e5250e1d..d5127e65 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -66,7 +66,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; editThemeListItems = [[NSArray arrayWithArray:[self _getAvailableThemes]] retain]; editorColors = - [[NSArray arrayWithObjects: + [@[ SPCustomQueryEditorTextColor, SPCustomQueryEditorBackgroundColor, SPCustomQueryEditorCaretColor, @@ -77,11 +77,11 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; SPCustomQueryEditorBacktickColor, SPCustomQueryEditorVariableColor, SPCustomQueryEditorHighlightQueryColor, - SPCustomQueryEditorSelectionColor, - nil] retain]; + SPCustomQueryEditorSelectionColor + ] retain]; editorNameForColors = - [[NSArray arrayWithObjects: + [@[ NSLocalizedString(@"Text", @"text label for color table (Prefs > Editor)"), NSLocalizedString(@"Background", @"background label for color table (Prefs > Editor)"), NSLocalizedString(@"Caret", @"caret label for color table (Prefs > Editor)"), @@ -92,8 +92,8 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; NSLocalizedString(@"Backtick Quote", @"backtick quote label for color table (Prefs > Editor)"), NSLocalizedString(@"Variable", @"variable label for color table (Prefs > Editor)"), NSLocalizedString(@"Query Background", @"query background label for color table (Prefs > Editor)"), - NSLocalizedString(@"Selection", @"selection label for color table (Prefs > Editor)"), - nil] retain]; + NSLocalizedString(@"Selection", @"selection label for color table (Prefs > Editor)") + ] retain]; } return self; diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 501b7c09..2e9eb9e2 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -490,7 +490,7 @@ static NSString *SPMySQLCommentField = @"Comment"; } NSError *error = nil; - NSArray *HTMLExcludes = [NSArray arrayWithObjects:@"doctype", @"html", @"head", @"body", @"xml", nil]; + NSArray *HTMLExcludes = @[@"doctype", @"html", @"head", @"body", @"xml"]; NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:NSHTMLTextDocumentType, NSDocumentTypeDocumentAttribute, HTMLExcludes, NSExcludedElementsDocumentAttribute, nil]; diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index 07d74ee0..76f376e8 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -377,7 +377,7 @@ static SPFavoritesController *sharedFavoritesController = nil; // from the current favourites tree and convert it to a dictionary representation // to create the plist data. This is done before file changes as it can sometimes // be terminated during shutdown. - NSDictionary *dictionary = [NSDictionary dictionaryWithObject:data forKey:SPFavoritesRootKey]; + NSDictionary *dictionary = @{SPFavoritesRootKey : data}; NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:dictionary format:NSPropertyListXMLFormat_v1_0 diff --git a/Source/SPFavoritesExporter.m b/Source/SPFavoritesExporter.m index d9342fa8..a8b78a86 100644 --- a/Source/SPFavoritesExporter.m +++ b/Source/SPFavoritesExporter.m @@ -77,7 +77,7 @@ [favorites addObject:[node dictionaryRepresentation]]; } - NSDictionary *dictionary = [NSDictionary dictionaryWithObject:favorites forKey:SPFavoritesDataRootKey]; + NSDictionary *dictionary = @{SPFavoritesDataRootKey : favorites}; [favorites release]; diff --git a/Source/SPFavoritesImporter.m b/Source/SPFavoritesImporter.m index 8dc1d94f..f80d6cff 100644 --- a/Source/SPFavoritesImporter.m +++ b/Source/SPFavoritesImporter.m @@ -127,9 +127,9 @@ static NSString *SPOldPreferenceFileFavoritesKey = @"favorites"; */ - (void)_informDelegateOfErrorCode:(NSUInteger)code description:(NSString *)description { - NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain - code:code - userInfo:[NSDictionary dictionaryWithObject:description forKey:NSLocalizedDescriptionKey]]; + NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain + code:code + userInfo:@{NSLocalizedDescriptionKey : description}]; [self _informDelegateOfImportCompletion:error]; } diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 2d8e9529..9048cfe9 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -143,7 +143,7 @@ } } - qlTypes = [[NSDictionary dictionaryWithObject:qlTypesItems forKey:SPQuickLookTypes] retain]; + qlTypes = [@{SPQuickLookTypes : qlTypesItems} retain]; [qlTypesItems release]; #endif diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 52b799d0..a79c8a40 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -162,7 +162,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; } - [defaultFieldTypesForComboBox setArray:[NSArray arrayWithObjects: + [defaultFieldTypesForComboBox setArray:@[ @"VARCHAR(255)", @"CHAR(63)", @"TEXT", @@ -172,9 +172,8 @@ static NSUInteger SPSourceColumnTypeInteger = 1; @"DATE", @"DATETIME", @"TIME", - @"TIMESTAMP", - nil - ]]; + @"TIMESTAMP" + ]]; [importFieldNamesHeaderSwitch setState:importFieldNamesHeader]; diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m index e9fd3f77..f363208c 100644 --- a/Source/SPGrowlController.m +++ b/Source/SPGrowlController.m @@ -98,7 +98,7 @@ static SPGrowlController *sharedGrowlController = nil; [notificationDictionary setObject:description forKey:@"description"]; [notificationDictionary setObject:document forKey:@"document"]; [notificationDictionary setObject:name forKey:@"name"]; - [notificationDictionary setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedInteger:[document hash]] forKey:@"notificationDocumentHash"] forKey:@"clickContext"]; + [notificationDictionary setObject:@{@"notificationDocumentHash" : @([document hash])} forKey:@"clickContext"]; [self performSelector:@selector(notifyWithObject:) withObject:notificationDictionary afterDelay:0.1]; } diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 77ea9fbe..1b0128ca 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -294,7 +294,7 @@ for(NSUInteger i=0; imaxWindowWidth) ? maxWindowWidth : w; } else { maxWindowWidth = 220; @@ -712,7 +712,7 @@ closeMe = YES; return; } else { - [newFiltered addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"No item found", @"no item found message"), @"display", @"", @"noCompletion", nil]]; + [newFiltered addObject:@{@"display" : NSLocalizedString(@"No item found", @"no item found message"), @"noCompletion" : @""}]; } } } @@ -725,7 +725,7 @@ // if fetching db structure add dummy row for displaying that info on top of the list if(isQueryingDatabaseStructure) - [newFiltered insertObject:[NSDictionary dictionaryWithObjectsAndKeys:@"dummy", @"display", @"", @"noCompletion", nil] atIndex:0]; + [newFiltered insertObject:@{@"display" : @"dummy", @"noCompletion" : @""} atIndex:0]; NSPoint old = NSMakePoint([self frame].origin.x, [self frame].origin.y + [self frame].size.height); diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 5db53418..07feee86 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -155,7 +155,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte [schemaStatusSplitView setMinSize:16.f ofSubviewAtIndex:1]; [self setWindowFrameAutosaveName:@"SPNavigator"]; - [outlineSchema2 registerForDraggedTypes:[NSArray arrayWithObjects:SPNavigatorTableDataPasteboardDragType, SPNavigatorPasteboardDragType, NSStringPboardType, nil]]; + [outlineSchema2 registerForDraggedTypes:@[SPNavigatorTableDataPasteboardDragType, SPNavigatorPasteboardDragType, NSStringPboardType]]; [outlineSchema2 setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES]; [outlineSchema2 setDraggingSourceOperationMask:NSDragOperationEvery forLocal:NO]; @@ -466,7 +466,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if(a) [allSchemaKeys setObject:a forKey:connectionName]; } else { - [schemaData setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@&DEL&no data loaded yet", connectionName]]; + [schemaData setObject:@{} forKey:[NSString stringWithFormat:@"%@&DEL&no data loaded yet", connectionName]]; [allSchemaKeys setObject:@[] forKey:connectionName]; } @@ -547,12 +547,12 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte } } - if([result count] < 1 ) return [NSArray arrayWithObjects:@0, @"", nil]; + if([result count] < 1 ) return @[@0, @""]; if([result count] == 1) { NSArray *split = [[result objectAtIndex:0] componentsSeparatedByString:SPUniqueSchemaDelimiter]; if([split count] == 2 ) return [NSArray arrayWithObjects:@1, [split lastObject], nil]; if([split count] == 3 ) return [NSArray arrayWithObjects:@2, [split lastObject], nil]; - return [NSArray arrayWithObjects:@0, @"", nil]; + return @[@0, @""]; } // case if field is equal to a table or db name NSMutableArray *arr = [NSMutableArray array]; @@ -560,14 +560,14 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if([[item componentsSeparatedByString:SPUniqueSchemaDelimiter] count] < 4) [arr addObject:item]; } - if([arr count] < 1 ) [NSArray arrayWithObjects:@0, @"", nil]; + if([arr count] < 1 ) @[@0, @""]; if([arr count] == 1) { NSArray *split = [[arr objectAtIndex:0] componentsSeparatedByString:SPUniqueSchemaDelimiter]; if([split count] == 2 ) [NSArray arrayWithObjects:@1, [split lastObject], nil]; if([split count] == 3 ) [NSArray arrayWithObjects:@2, [split lastObject], nil]; - return [NSArray arrayWithObjects:@0, @"", nil]; + return @[@0, @""]; } - return [NSArray arrayWithObjects:@0, @"", nil]; + return @[@0, @""]; } #ifndef SP_CODA @@ -611,7 +611,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if (![[doc getConnection] isConnected]) return; - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } - (IBAction)outlineViewAction:(id)sender @@ -1113,7 +1113,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard { // Provide data for our custom type, and simple NSStrings. - [pboard declareTypes:[NSArray arrayWithObjects:SPNavigatorTableDataPasteboardDragType, SPNavigatorPasteboardDragType, NSStringPboardType, nil] owner:self]; + [pboard declareTypes:@[SPNavigatorTableDataPasteboardDragType, SPNavigatorPasteboardDragType, NSStringPboardType] owner:self]; // Collect the actual schema paths without leading connection ID NSMutableArray *draggedItems = [NSMutableArray array]; diff --git a/Source/SPPreferenceControllerDelegate.m b/Source/SPPreferenceControllerDelegate.m index ca08f2f0..ce05de6c 100644 --- a/Source/SPPreferenceControllerDelegate.m +++ b/Source/SPPreferenceControllerDelegate.m @@ -91,41 +91,41 @@ - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: - SPPreferenceToolbarGeneral, - SPPreferenceToolbarTables, - SPPreferenceToolbarNotifications, - SPPreferenceToolbarEditor, - SPPreferenceToolbarShortcuts, - SPPreferenceToolbarAutoUpdate, - SPPreferenceToolbarNetwork, - nil]; + return @[ + SPPreferenceToolbarGeneral, + SPPreferenceToolbarTables, + SPPreferenceToolbarNotifications, + SPPreferenceToolbarEditor, + SPPreferenceToolbarShortcuts, + SPPreferenceToolbarAutoUpdate, + SPPreferenceToolbarNetwork + ]; } - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: - SPPreferenceToolbarGeneral, - SPPreferenceToolbarTables, - SPPreferenceToolbarNotifications, - SPPreferenceToolbarEditor, - SPPreferenceToolbarShortcuts, - SPPreferenceToolbarAutoUpdate, - SPPreferenceToolbarNetwork, - nil]; + return @[ + SPPreferenceToolbarGeneral, + SPPreferenceToolbarTables, + SPPreferenceToolbarNotifications, + SPPreferenceToolbarEditor, + SPPreferenceToolbarShortcuts, + SPPreferenceToolbarAutoUpdate, + SPPreferenceToolbarNetwork + ]; } - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { - return [NSArray arrayWithObjects: - SPPreferenceToolbarGeneral, - SPPreferenceToolbarTables, - SPPreferenceToolbarNotifications, - SPPreferenceToolbarEditor, - SPPreferenceToolbarShortcuts, - SPPreferenceToolbarAutoUpdate, - SPPreferenceToolbarNetwork, - nil]; + return @[ + SPPreferenceToolbarGeneral, + SPPreferenceToolbarTables, + SPPreferenceToolbarNotifications, + SPPreferenceToolbarEditor, + SPPreferenceToolbarShortcuts, + SPPreferenceToolbarAutoUpdate, + SPPreferenceToolbarNetwork + ]; } @end diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index a412088c..d88dc4c8 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -130,22 +130,22 @@ void SPApplyRevisionChanges(void) if (recordedVersionNumber < 561) { NSEnumerator *keyEnumerator; NSString *oldKey, *newKey; - NSDictionary *keysToUpgrade = [NSDictionary dictionaryWithObjectsAndKeys: - @"encoding", SPDefaultEncoding, - @"useMonospacedFonts", SPUseMonospacedFonts, - @"reloadAfterAdding", SPReloadAfterAddingRow, - @"reloadAfterEditing", SPReloadAfterEditingRow, - @"reloadAfterRemoving", SPReloadAfterRemovingRow, - @"dontShowBlob", SPLoadBlobsAsNeeded, - @"fetchRowCount", @"FetchCorrectRowCount", - @"limitRows", SPLimitResults, - @"limitRowsValue", SPLimitResultsValue, - @"nullValue", SPNullValue, - @"showError", SPShowNoAffectedRowsError, - @"connectionTimeout", SPConnectionTimeoutValue, - @"keepAliveInterval", SPKeepAliveInterval, - @"lastFavoriteIndex", SPLastFavoriteID, - nil]; + NSDictionary *keysToUpgrade = @{ + SPDefaultEncoding : @"encoding", + SPUseMonospacedFonts : @"useMonospacedFonts", + SPReloadAfterAddingRow : @"reloadAfterAdding", + SPReloadAfterEditingRow : @"reloadAfterEditing", + SPReloadAfterRemovingRow : @"reloadAfterRemoving", + SPLoadBlobsAsNeeded : @"dontShowBlob", + @"FetchCorrectRowCount" : @"fetchRowCount", + SPLimitResults : @"limitRows", + SPLimitResultsValue : @"limitRowsValue", + SPNullValue : @"nullValue", + SPShowNoAffectedRowsError : @"showError", + SPConnectionTimeoutValue : @"connectionTimeout", + SPKeepAliveInterval : @"keepAliveInterval", + SPLastFavoriteID : @"lastFavoriteIndex" + }; keyEnumerator = [keysToUpgrade keyEnumerator]; @@ -255,7 +255,7 @@ void SPApplyRevisionChanges(void) if (([favorite isKindOfClass:[NSDictionary class]]) && ([favorite objectForKey:@"name"]) && ([favorite objectForKey:@"query"])) { NSMutableString *favoriteName = [NSMutableString stringWithString:[favorite objectForKey:@"name"]]; [favoriteName replaceOccurrencesOfString:@"\n" withString:@" " options:NSLiteralSearch range:NSMakeRange(0, [favoriteName length])]; - [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], [favorite objectForKey:@"query"], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]]; + [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], [favorite objectForKey:@"query"], nil] forKeys:@[@"name", @"query"]]]; continue; } @@ -268,7 +268,7 @@ void SPApplyRevisionChanges(void) [favoriteName appendString:@"..."]; } - [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], favorite, nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]]; + [queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSString stringWithString:favoriteName], favorite, nil] forKeys:@[@"name", @"query"]]]; } [prefs setObject:queryFavoritesArray forKey:SPQueryFavorites]; @@ -287,27 +287,27 @@ void SPApplyRevisionChanges(void) // For versions prior to 2325 (<0.9.9), convert the old encoding pref string into the new localizable constant if (recordedVersionNumber < 2325 && [prefs objectForKey:SPOldDefaultEncodingKey] && [[prefs objectForKey:SPOldDefaultEncodingKey] isKindOfClass:[NSString class]]) { - NSDictionary *encodingMap = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:SPEncodingAutodetect], @"Autodetect", - [NSNumber numberWithInt:SPEncodingUCS2], @"UCS-2 Unicode (ucs2)", - [NSNumber numberWithInt:SPEncodingUTF8], @"UTF-8 Unicode (utf8)", - [NSNumber numberWithInt:SPEncodingUTF8viaLatin1], @"UTF-8 Unicode via Latin 1", - [NSNumber numberWithInt:SPEncodingASCII], @"US ASCII (ascii)", - [NSNumber numberWithInt:SPEncodingLatin1], @"ISO Latin 1 (latin1)", - [NSNumber numberWithInt:SPEncodingMacRoman], @"Mac Roman (macroman)", - [NSNumber numberWithInt:SPEncodingCP1250Latin2], @"Windows Latin 2 (cp1250)", - [NSNumber numberWithInt:SPEncodingISOLatin2], @"ISO Latin 2 (latin2)", - [NSNumber numberWithInt:SPEncodingCP1256Arabic], @"Windows Arabic (cp1256)", - [NSNumber numberWithInt:SPEncodingGreek], @"ISO Greek (greek)", - [NSNumber numberWithInt:SPEncodingHebrew], @"ISO Hebrew (hebrew)", - [NSNumber numberWithInt:SPEncodingLatin5Turkish], @"ISO Turkish (latin5)", - [NSNumber numberWithInt:SPEncodingCP1257WinBaltic], @"Windows Baltic (cp1257)", - [NSNumber numberWithInt:SPEncodingCP1251WinCyrillic], @"Windows Cyrillic (cp1251)", - [NSNumber numberWithInt:SPEncodingBig5Chinese], @"Big5 Traditional Chinese (big5)", - [NSNumber numberWithInt:SPEncodingShiftJISJapanese], @"Shift-JIS Japanese (sjis)", - [NSNumber numberWithInt:SPEncodingEUCJPJapanese], @"EUC-JP Japanese (ujis)", - [NSNumber numberWithInt:SPEncodingEUCKRKorean], @"EUC-KR Korean (euckr)", - nil]; + NSDictionary *encodingMap = @{ + @"Autodetect" : @(SPEncodingAutodetect), + @"UCS-2 Unicode (ucs2)" : @(SPEncodingUCS2), + @"UTF-8 Unicode (utf8)" : @(SPEncodingUTF8), + @"UTF-8 Unicode via Latin 1" : @(SPEncodingUTF8viaLatin1), + @"US ASCII (ascii)" : @(SPEncodingASCII), + @"ISO Latin 1 (latin1)" : @(SPEncodingLatin1), + @"Mac Roman (macroman)" : @(SPEncodingMacRoman), + @"Windows Latin 2 (cp1250)" : @(SPEncodingCP1250Latin2), + @"ISO Latin 2 (latin2)" : @(SPEncodingISOLatin2), + @"Windows Arabic (cp1256)" : @(SPEncodingCP1256Arabic), + @"ISO Greek (greek)" : @(SPEncodingGreek), + @"ISO Hebrew (hebrew)" : @(SPEncodingHebrew), + @"ISO Turkish (latin5)" : @(SPEncodingLatin5Turkish), + @"Windows Baltic (cp1257)" : @(SPEncodingCP1257WinBaltic), + @"Windows Cyrillic (cp1251)" : @(SPEncodingCP1251WinCyrillic), + @"Big5 Traditional Chinese (big5)" : @(SPEncodingBig5Chinese), + @"Shift-JIS Japanese (sjis)" : @(SPEncodingShiftJISJapanese), + @"EUC-JP Japanese (ujis)" : @(SPEncodingEUCJPJapanese), + @"EUC-KR Korean (euckr)" : @(SPEncodingEUCKRKorean) + }; NSNumber *newMappedValue = [encodingMap valueForKey:[prefs objectForKey:SPOldDefaultEncodingKey]]; @@ -394,7 +394,7 @@ void SPMigrateConnectionFavoritesData(void) [prefs removeObjectForKey:@"LastFavoriteIndex"]; } - NSDictionary *newFavorites = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, favorites, SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey]; + NSDictionary *newFavorites = @{SPFavoritesRootKey : [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, favorites, SPFavoriteChildrenKey, nil]}; error = nil; NSString *errorString = nil; diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index c77e82d2..f24a7891 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -167,7 +167,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard]; // Copy the string to the pasteboard - [pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil]; + [pasteBoard declareTypes:@[NSStringPboardType] owner:nil]; [pasteBoard setString:string forType:NSStringPboardType]; } } diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 0b1e59b6..c08aec3e 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -199,7 +199,7 @@ static SPQueryController *sharedQueryController = nil; NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard]; // Copy the string to the pasteboard - [pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil]; + [pasteBoard declareTypes:@[NSStringPboardType] owner:nil]; [pasteBoard setString:string forType:NSStringPboardType]; } #endif diff --git a/Source/SPQueryControllerInitializer.m b/Source/SPQueryControllerInitializer.m index 8890a607..fc03d107 100644 --- a/Source/SPQueryControllerInitializer.m +++ b/Source/SPQueryControllerInitializer.m @@ -136,7 +136,7 @@ static NSString *SPCompletionTokensSnippetsKey = @"function_argument_snippets"; } } - return errorDescription ? [NSError errorWithDomain:NSCocoaErrorDomain code:1 userInfo:[NSDictionary dictionaryWithObject:errorDescription forKey:NSLocalizedDescriptionKey]] : nil; + return errorDescription ? [NSError errorWithDomain:NSCocoaErrorDomain code:1 userInfo:@{NSLocalizedDescriptionKey : errorDescription}] : nil; } @end diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 38758a45..649d4b5a 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -43,8 +43,6 @@ #define SP_MULTIPLE_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[multiple selection]", @"[multiple selection]") #define SP_NO_SELECTION_PLACEHOLDER_STRING NSLocalizedString(@"[no selection]", @"[no selection]") -#define SP_Int(x) [NSNumber numberWithInteger:x] - @interface SPQueryFavoriteManager () - (void)_initWithNoSelection; @@ -86,11 +84,11 @@ - (void)awakeFromNib { #ifndef SP_CODA - [favorites addObject:[NSDictionary dictionaryWithObjectsAndKeys: - @"Global", @"name", - @"", @"headerOfFileURL", - @"", @"query", - nil]]; + [favorites addObject:@{ + @"name" : @"Global", + @"headerOfFileURL" : @"", + @"query" : @"" + }]; // Set up the split view [favoritesSplitView setMinSize:152.f ofSubviewAtIndex:0]; @@ -206,7 +204,7 @@ favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[[favoriteNameTextField stringValue] stringByAppendingFormat:@" Copy"], [favoriteQueryTextView string], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]; // Add a new favorite else - favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"New Favorite", @"", nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]; + favorite = [NSMutableDictionary dictionaryWithObjects:@[@"New Favorite", @""] forKeys:@[@"name", @"query"]]; // If a favourite is currently selected, add the new favourite next to it if ([favoritesTableView numberOfSelectedRows] > 0) { @@ -380,24 +378,24 @@ { // Look up the sender's tag to determine the placeholder to insert. // Note that tag values alter behaviour slightly - see below. - NSDictionary *lookupTable = [NSDictionary dictionaryWithObjectsAndKeys: - NSLocalizedString(@"default_value", @"Query snippet default value placeholder"), SP_Int(100), - NSLocalizedString(@"$(shell_command)", @"Query snippet shell command syntax and placeholder"), SP_Int(101), - @"$1", SP_Int(501), - @"¦a¦b¦", SP_Int(102), - @"¦¦a¦b¦¦", SP_Int(103), - @"¦", SP_Int(104), - @"$SP_SELECTED_TABLE", SP_Int(105), - @"$SP_SELECTED_TABLES", SP_Int(106), - @"$SP_SELECTED_DATABASE", SP_Int(107), - @"¦$SP_ASLIST_ALL_FIELDS¦", SP_Int(108), - @"¦¦$SP_ASLIST_ALL_FIELDS¦¦", SP_Int(109), - @"¦$SP_ASLIST_ALL_TABLES¦", SP_Int(110), - @"¦¦$SP_ASLIST_ALL_TABLES¦¦", SP_Int(111), - @"¦$SP_ASLIST_ALL_DATABASES¦", SP_Int(112), - @"¦¦$SP_ASLIST_ALL_DATABASES¦¦", SP_Int(113), - nil]; - NSString *placeholder = [lookupTable objectForKey:SP_Int([[sender selectedItem] tag])]; + NSDictionary *lookupTable = @{ + @100 : NSLocalizedString(@"default_value", @"Query snippet default value placeholder"), + @101 : NSLocalizedString(@"$(shell_command)", @"Query snippet shell command syntax and placeholder"), + @501 : @"$1", + @102 : @"¦a¦b¦", + @103 : @"¦¦a¦b¦¦", + @104 : @"¦", + @105 : @"$SP_SELECTED_TABLE", + @106 : @"$SP_SELECTED_TABLES", + @107 : @"$SP_SELECTED_DATABASE", + @108 : @"¦$SP_ASLIST_ALL_FIELDS¦", + @109 : @"¦¦$SP_ASLIST_ALL_FIELDS¦¦", + @110 : @"¦$SP_ASLIST_ALL_TABLES¦", + @111 : @"¦¦$SP_ASLIST_ALL_TABLES¦¦", + @112 : @"¦$SP_ASLIST_ALL_DATABASES¦", + @113 : @"¦¦$SP_ASLIST_ALL_DATABASES¦¦" + }; + NSString *placeholder = [lookupTable objectForKey:[NSNumber numberWithInteger:[[sender selectedItem] tag]]]; if (!placeholder) [NSException raise:NSInternalInconsistencyException format:@"Inserted placeholder (%lld) not found", (long long)[[sender selectedItem] tag]]; // Iterate through the current snippets, to get the lowest unused tab counter, and diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 649e4ac3..9fd57e6d 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -614,7 +614,7 @@ } // Export procedures and functions - for (NSString *procedureType in [NSArray arrayWithObjects:@"PROCEDURE", @"FUNCTION", nil]) + for (NSString *procedureType in @[@"PROCEDURE", @"FUNCTION"]) { // Check for cancellation flag if ([self isCancelled]) { diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index 43da2068..090970fb 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -370,7 +370,7 @@ NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard]; // Copy the string to the pasteboard - [pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil]; + [pasteBoard declareTypes:@[NSStringPboardType] owner:nil]; [pasteBoard setString:string forType:NSStringPboardType]; } } diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index ae49c772..67825671 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -568,7 +568,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper #else NSFont *tableFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; #endif - [tableContentView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height]; + [tableContentView setRowHeight:2.0f+NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:@{NSFontAttributeName : tableFont}]).height]; // Add the new columns to the table and filterTable for ( i = 0 ; i < (NSInteger)[dataColumns count] ; i++ ) { @@ -3333,7 +3333,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[tableContentView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:@(-2), @"", nil]; + return @[@(-2), @""]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -3344,13 +3344,13 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -3362,7 +3362,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -3372,7 +3372,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -3382,14 +3382,14 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:@(-1), @"", nil]; + return @[@(-1), @""]; } } @@ -4252,7 +4252,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper else if ([keyPath isEqualToString:SPGlobalResultTableFont]) { NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]; - [tableContentView setRowHeight:2.0f + NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height]; + [tableContentView setRowHeight:2.0f + NSSizeToCGSize([@"{ǞṶḹÜ∑zgyf" sizeWithAttributes:@{NSFontAttributeName : tableFont}]).height]; [tableContentView setFont:tableFont]; [tableContentView reloadData]; } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 4ee09fd9..0e340f49 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -1170,7 +1170,7 @@ */ - (NSDictionary *) parseFieldDefinitionStringParts:(NSArray *)definitionParts { - if (![definitionParts count]) return [NSDictionary dictionary]; + if (![definitionParts count]) return @{}; SPSQLParser *detailParser; SPSQLParser *fieldParser = [[SPSQLParser alloc] init]; diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 76a11a5c..4b16bdc0 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -78,7 +78,7 @@ object:nil]; // Add activities header - [activities addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"ACTIVITIES", @"header for activities pane"), @"name", nil]]; + [activities addObject:@{@"name" : NSLocalizedString(@"ACTIVITIES", @"header for activities pane")}]; [activitiesTable reloadData]; // Add Information header @@ -110,7 +110,7 @@ NSMutableArray *acts = [NSMutableArray array]; [acts removeAllObjects]; - [acts addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"ACTIVITIES", @"header for activities pane"), @"name", nil]]; + [acts addObject:@{@"name" : NSLocalizedString(@"ACTIVITIES", @"header for activities pane")}]; [acts addObjectsFromArray:[tableDocumentInstance runningActivities]]; [acts addObjectsFromArray:[SPAppDelegate runningActivities]]; diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index f2188a3b..f82dd3e7 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -163,7 +163,7 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; [thatTable backtickQuotedString], [thatColumn backtickQuotedString]]]; - NSArray *onActions = [NSArray arrayWithObjects:@"RESTRICT", @"CASCADE", @"SET NULL", @"NO ACTION", nil]; + NSArray *onActions = @[@"RESTRICT", @"CASCADE", @"SET NULL", @"NO ACTION"]; // If required add ON DELETE if ([onDeletePopUpButton selectedTag] >= 0) { diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 1b922683..9013fb05 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -116,12 +116,11 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [indexesTableView setFont:useMonospacedFont ? [NSFont fontWithName:SPDefaultMonospacedFontName size:monospacedFontSize] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; #endif - extraFieldSuggestions = [[NSArray arrayWithObjects: - @"None", - @"auto_increment", - @"on update CURRENT_TIMESTAMP", - @"SERIAL DEFAULT VALUE", - nil + extraFieldSuggestions = [@[ + @"None", + @"auto_increment", + @"on update CURRENT_TIMESTAMP", + @"SERIAL DEFAULT VALUE" ] retain]; // Note that changing the contents or ordering of this array will affect the implementation of @@ -254,7 +253,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [tableFields insertObject:[NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", allowNull ? @"1" : @"0", @"", [prefs stringForKey:SPNullValue], @"None", @"", @0, @0, nil] - forKeys:[NSArray arrayWithObjects:@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation", nil]] + forKeys:@[@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation"]] atIndex:insertIndex]; #else [tableFields insertObject:[NSMutableDictionary @@ -1208,7 +1207,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [indexesController setConnection:mySQLConnection]; // Set up tableView - [tableSourceView registerForDraggedTypes:[NSArray arrayWithObjects:SPDefaultPasteboardDragType, nil]]; + [tableSourceView registerForDraggedTypes:@[SPDefaultPasteboardDragType]]; } /** diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index 5366d49e..a15d31cd 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -288,9 +288,9 @@ // Query the structure of all databases in the background (mainly for completion) [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" - target:[tableDocumentInstance databaseStructureRetrieval] + target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + object:@{@"forceUpdate" : @YES}]; [self loadTable:selectedTable]; } diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 8d455b58..952d4868 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -168,7 +168,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; object:tableDocumentInstance]; #ifndef SP_CODA - [tablesListView registerForDraggedTypes:[NSArray arrayWithObjects:SPNavigatorTableDataPasteboardDragType, nil]]; + [tablesListView registerForDraggedTypes:@[SPNavigatorTableDataPasteboardDragType]]; #endif //create the charset helper @@ -360,7 +360,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:nil]; else // User press refresh button ergo force update - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", @YES, @"cancelQuerying", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES, @"cancelQuerying" : @YES}]; } /** @@ -704,13 +704,13 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; - (void)_duplicateConnectionToFrontTab { // Get the state of the document - NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"connection", - @YES, @"history", - @YES, @"session", - @YES, @"query", - @YES, @"password", - nil]; + NSDictionary *allStateDetails = @{ + @"connection" : @YES, + @"history" : @YES, + @"session" : @YES, + @"query" : @YES, + @"password" : @YES + }; NSMutableDictionary *documentState = [NSMutableDictionary dictionaryWithDictionary:[tableDocumentInstance stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect @@ -1621,7 +1621,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } #ifndef SP_CODA @@ -2276,10 +2276,10 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" - target:[tableDocumentInstance databaseStructureRetrieval] - selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" + target:[tableDocumentInstance databaseStructureRetrieval] + selector:@selector(queryDbStructureWithUserInfo:) + object:@{@"forceUpdate" : @YES}]; } #ifndef SP_CODA /* operations performed on whole tables */ @@ -2428,9 +2428,9 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // Query the structure of all databases in the background (mainly for completion) [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" - target:[tableDocumentInstance databaseStructureRetrieval] + target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + object:@{@"forceUpdate" : @YES}]; } else { // Error while creating new table @@ -2637,7 +2637,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [tableDocumentInstance loadTable:selectedTableName ofType:selectedTableType]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } } } diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index a4d118ed..059ad6ec 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -176,7 +176,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) /** * Allow hit tracking for link functionality */ -- (NSUInteger) hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView +- (NSCellHitResult) hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView { // Fast case for no link - make entire cell editable click area diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 17c61faf..4ed92f94 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -2907,7 +2907,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS #endif if(tabStopWidth < 1) tabStopWidth = 1; - float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width; + float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:@{NSFontAttributeName : tvFont}]).width; tabWidth = (float)tabStopWidth * tabWidth; NSInteger numberOfTabs = 256/tabStopWidth; diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m index 276b5ebd..33564d81 100644 --- a/Source/SPTooltip.m +++ b/Source/SPTooltip.m @@ -96,7 +96,7 @@ static CGFloat slow_in_out (CGFloat t) + (void)showWithObject:(id)content atLocation:(NSPoint)point { - [self showWithObject:content atLocation:point ofType:@"text" displayOptions:[NSDictionary dictionary]]; + [self showWithObject:content atLocation:point ofType:@"text" displayOptions:@{}]; } + (void)showWithObject:(id)content atLocation:(NSPoint)point ofType:(NSString *)type diff --git a/Source/SPWindowManagement.m b/Source/SPWindowManagement.m index 022ad7fa..c30a2826 100644 --- a/Source/SPWindowManagement.m +++ b/Source/SPWindowManagement.m @@ -116,13 +116,13 @@ [[[self frontDocumentWindow] windowController] addNewConnection:self]; // Get the state of the previously-frontmost document - NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"connection", - @YES, @"history", - @YES, @"session", - @YES, @"query", - @YES, @"password", - nil]; + NSDictionary *allStateDetails = @{ + @"connection" : @YES, + @"history" : @YES, + @"session" : @YES, + @"query" : @YES, + @"password" : @YES + }; NSMutableDictionary *frontState = [NSMutableDictionary dictionaryWithDictionary:[theFrontDocument stateIncludingDetails:allStateDetails]]; -- cgit v1.2.3 From 28a705f74854d5c34d0e952c0747a512c19fadc2 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 20:24:58 +0100 Subject: Fix issue #2040 Changing the query favorties/history would cause an UI inconsitency when the list was filtered before. --- Source/SPCustomQuery.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 94d1b355..216cafa8 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3363,6 +3363,9 @@ if(numberOfHistoryItems>0) for(id historyMenuItem in [[SPQueryController sharedQueryController] historyMenuItemsForFileURL:[tableDocumentInstance fileURL]]) [historyMenu addItem:historyMenuItem]; + + // Reapply the filter + [self filterQueryHistory:nil]; } /** @@ -3431,6 +3434,9 @@ [menu addItem:item]; [item release]; } + + // Reapply the filter + [self filterQueryFavorites:nil]; } #endif -- cgit v1.2.3 From d5dd8b1eb5b8bfaa040ddc52d603231e4828cec7 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 20:42:45 +0100 Subject: Attempt 1 to fix building on 10.7 --- Source/SPActivityTextFieldCell.m | 5 +++++ Source/SPTextAndLinkCell.m | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index 5eb2deda..c088c9cb 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -33,6 +33,11 @@ #define FAVORITE_NAME_FONT_SIZE 12.0f +#ifndef NS_OPTIONS +// This type is available since 10.5 but only got a "name" in 10.8 +typedef NSUInteger NSCellHitResult; +#endif + @interface SPActivityTextFieldCell (PrivateAPI) - (NSAttributedString *)constructSubStringAttributedString; diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index 059ad6ec..86d8ca9d 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -42,6 +42,11 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) return NSMakeRect(inRect.origin.x + inRect.size.width - 15, inRect.origin.y - 1, 12, inRect.size.height); } +#ifndef NS_OPTIONS +// This type is available since 10.5 but only got a "name" in 10.8 +typedef NSUInteger NSCellHitResult; +#endif + #pragma mark - #pragma mark Setup and teardown -- cgit v1.2.3 From c573bf18ff0ce2a350bec687f2d7cc5ba5a69865 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 21:00:30 +0100 Subject: Attempt 2 to fix building on 10.7, 10.8 --- Source/DMLocalizedNibBundle.m | 5 ----- Source/SPActivityTextFieldCell.m | 5 ----- Source/SPConstants.h | 16 ++++++++++++++++ Source/SPTableContent.m | 4 ---- Source/SPTextAndLinkCell.m | 4 ---- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Source/DMLocalizedNibBundle.m b/Source/DMLocalizedNibBundle.m index 90fc4264..5dc94f9f 100644 --- a/Source/DMLocalizedNibBundle.m +++ b/Source/DMLocalizedNibBundle.m @@ -12,11 +12,6 @@ #import #import -//Backwards compatibility -#ifndef __MAC_10_8 -#define __MAC_10_8 1080 -#endif - @interface NSBundle (DMLocalizedNibBundle) #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_8 - (BOOL)deliciousLocalizingLoadNibNamed:(NSString *)fileName owner:(id)owner topLevelObjects:(NSArray **)topLevelObjects; diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index c088c9cb..5eb2deda 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -33,11 +33,6 @@ #define FAVORITE_NAME_FONT_SIZE 12.0f -#ifndef NS_OPTIONS -// This type is available since 10.5 but only got a "name" in 10.8 -typedef NSUInteger NSCellHitResult; -#endif - @interface SPActivityTextFieldCell (PrivateAPI) - (NSAttributedString *)constructSubStringAttributedString; diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 322219ae..f630dd49 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -609,3 +609,19 @@ extern NSString *SPURLSchemeQueryResultStatusPathHeader; extern NSString *SPURLSchemeQueryResultMetaPathHeader; #define SPAppDelegate ((SPAppController *)[NSApp delegate]) + +//Backwards compatibility +#ifndef __MAC_10_7 +#define __MAC_10_7 1070 +#endif +#ifndef __MAC_10_8 +#define __MAC_10_8 1080 +#endif +#ifndef __MAC_10_10 +#define __MAC_10_10 101000 +#endif + +// This enum is available since 10.5 but only got a "name" in 10.10 +#if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10 +typedef NSUInteger NSCellHitResult; +#endif diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 67825671..d904ab73 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -70,10 +70,6 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOperator"; #endif -#ifndef __MAC_10_7 -#define __MAC_10_7 1070 -#endif - @interface SPTableContent (SPTableContentDataSource_Private_API) - (id)_contentValueForTableColumn:(NSUInteger)columnIndex row:(NSUInteger)rowIndex asPreview:(BOOL)asPreview; diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index 86d8ca9d..89521e54 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -42,10 +42,6 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) return NSMakeRect(inRect.origin.x + inRect.size.width - 15, inRect.origin.y - 1, 12, inRect.size.height); } -#ifndef NS_OPTIONS -// This type is available since 10.5 but only got a "name" in 10.8 -typedef NSUInteger NSCellHitResult; -#endif #pragma mark - #pragma mark Setup and teardown -- cgit v1.2.3 From 915b4fb171afec486a386b7098f6ccfe59058f4f Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 14 Dec 2014 17:19:50 +0100 Subject: Fix crash on export with "overwrite existing files" This should fix #2010. A required object was not retained long enough. --- Source/SPExportFileUtilities.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m index aafea54d..778deb3e 100644 --- a/Source/SPExportFileUtilities.m +++ b/Source/SPExportFileUtilities.m @@ -31,10 +31,11 @@ #import "SPExportFileUtilities.h" #import "SPExportInitializer.h" #import "SPExporter.h" -#import "SPAlertSheets.h" #import "SPExportFile.h" #import "SPDatabaseDocument.h" #import "SPCustomQuery.h" +#import "SPTableContent.h" +#import "SPTableContentDelegate.h" #import @@ -53,7 +54,7 @@ SPExportErrorChoice; @end -@implementation SPExportController (SPExportFileUtilities) +@implementation SPExportController (SPExportFileUtilitiesPrivateAPI) /** * Writes the CSV file header to the supplied export file. @@ -115,7 +116,7 @@ SPExportErrorChoice; if ([exportXMLFormatPopUpButton indexOfSelectedItem] == SPXMLExportMySQLFormat) { - NSString *tag = @""; + NSString *tag; if (exportSource == SPTableExport) { tag = [NSString stringWithFormat:@"\n\n\n", [tableDocumentInstance database]]; @@ -141,6 +142,11 @@ SPExportErrorChoice; */ - (void)errorCreatingExportFileHandles:(NSArray *)files { + // We don't know where "files" came from, but we know 2 things: + // - NSAlert will NOT retain it as contextInfo + // - This method continues execution after [alert beginSheet:...], thus even if files was retained before, it could be released before the alert ends + [files retain]; + // Get the number of files that already exist as well as couldn't be created because of other reasons NSUInteger filesAlreadyExisting = 0; NSUInteger parentFoldersMissing = 0; @@ -270,6 +276,7 @@ SPExportErrorChoice; [exportProgressWindow orderOut:self]; [alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:files]; + [alert autorelease]; } /** -- cgit v1.2.3 From ef5193bc6b897f1040f252789d7c4b635abcb11b Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 14 Dec 2014 21:26:09 +0100 Subject: Fix an exception when opening Bundle Editor Caused by an earlier commit of mine. --- Source/SPBundleEditorController.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index cb4ccf88..197ceee6 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -155,8 +155,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [allPopupScopeItems addObjectsFromArray:triggerGeneralArray]; [allPopupScopeItems addObjectsFromArray:withBlobDataTableArray]; - NSDictionary *menuItemTitles = @{ - allPopupScopeItems : @[ + NSDictionary *menuItemTitles = [NSDictionary dictionaryWithObjects:@[ NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Input source dropdown: 'None' item"), NSLocalizedString(@"None", @"Bundle Editor : Scope=Field : Input source dropdown: 'None' item"), @@ -212,8 +211,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; NSLocalizedString(@"save BLOB as image file", @"Bundle Editor : BLOB dropdown : 'save BLOB as image file' item"), NSLocalizedString(@"save BLOB as dat file", @"Bundle Editor : BLOB dropdown : 'save BLOB as dat file' item"), - ] - }; + ] forKeys:allPopupScopeItems]; NSMenuItem *anItem; for(NSString* title in inputGeneralScopeArray) { @@ -2112,6 +2110,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [triggerInputFieldPopUpMenu release]; [triggerDataTablePopUpMenu release]; [triggerGeneralPopUpMenu release]; + [withBlobDataTablePopUpMenu release]; [inputNonePopUpMenu release]; [inputGeneralScopeArray release]; -- cgit v1.2.3 From ca6b8681a49d51b5dfafbb2647119ada070df8da Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 14 Dec 2014 22:37:12 +0100 Subject: Roll some duplicate code into a loop (so the compiler can unroll it again) --- Source/SPBundleEditorController.m | 92 ++++++++++++++------------------------- 1 file changed, 33 insertions(+), 59 deletions(-) diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 197ceee6..ac227cf4 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -120,7 +120,6 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; inputGeneralScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; inputInputFieldScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; inputDataTableScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; - inputNonePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; outputGeneralScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; outputInputFieldScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; outputDataTableScopePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; @@ -129,6 +128,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; triggerDataTablePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; triggerGeneralPopUpMenu = [[NSMenu alloc] initWithTitle:@""]; withBlobDataTablePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; + inputNonePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; inputGeneralScopeArray = [@[SPBundleInputSourceNone] retain]; inputInputFieldScopeArray = [@[SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent] retain]; @@ -141,6 +141,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; triggerDataTableArray = [@[SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, SPBundleTriggerActionTableRowChanged] retain]; triggerGeneralArray = [@[SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged] retain]; withBlobDataTableArray = [@[SPBundleInputSourceBlobHandlingExclude, SPBundleInputSourceBlobHandlingInclude, SPBundleInputSourceBlobHandlingImageFileReference, SPBundleInputSourceBlobHandlingFileReference] retain]; + NSArray *inputNoneArray = @[SPBundleInputSourceNone]; //we only need that once to construct the menu NSMutableArray *allPopupScopeItems = [NSMutableArray array]; [allPopupScopeItems addObjectsFromArray:inputGeneralScopeArray]; @@ -154,6 +155,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [allPopupScopeItems addObjectsFromArray:triggerDataTableArray]; [allPopupScopeItems addObjectsFromArray:triggerGeneralArray]; [allPopupScopeItems addObjectsFromArray:withBlobDataTableArray]; + [allPopupScopeItems addObjectsFromArray:inputNoneArray]; NSDictionary *menuItemTitles = [NSDictionary dictionaryWithObjects:@[ NSLocalizedString(@"None", @"Bundle Editor : Scope=General : Input source dropdown: 'None' item"), @@ -211,68 +213,40 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; NSLocalizedString(@"save BLOB as image file", @"Bundle Editor : BLOB dropdown : 'save BLOB as image file' item"), NSLocalizedString(@"save BLOB as dat file", @"Bundle Editor : BLOB dropdown : 'save BLOB as dat file' item"), + NSLocalizedString(@"None", @"Bundle Editor : Scope=? : ? dropdown: 'None' item") ] forKeys:allPopupScopeItems]; - NSMenuItem *anItem; - for(NSString* title in inputGeneralScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(inputPopupButtonChanged:) keyEquivalent:@""]; - [inputGeneralScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in inputInputFieldScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(inputPopupButtonChanged:) keyEquivalent:@""]; - [inputInputFieldScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in inputDataTableScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(inputPopupButtonChanged:) keyEquivalent:@""]; - [inputDataTableScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in outputGeneralScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(outputPopupButtonChanged:) keyEquivalent:@""]; - [outputGeneralScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in outputInputFieldScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(outputPopupButtonChanged:) keyEquivalent:@""]; - [outputInputFieldScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in outputDataTableScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(outputPopupButtonChanged:) keyEquivalent:@""]; - [outputDataTableScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in inputFallbackInputFieldScopeArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(inputFallbackPopupButtonChanged:) keyEquivalent:@""]; - [inputFallbackInputFieldScopePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in triggerInputFieldArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(triggerButtonChanged:) keyEquivalent:@""]; - [triggerInputFieldPopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in triggerDataTableArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(triggerButtonChanged:) keyEquivalent:@""]; - [triggerDataTablePopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in triggerGeneralArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(triggerButtonChanged:) keyEquivalent:@""]; - [triggerGeneralPopUpMenu addItem:anItem]; - [anItem release]; - } - for(NSString* title in withBlobDataTableArray) { - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(withBlobButtonChanged:) keyEquivalent:@""]; - [withBlobDataTablePopUpMenu addItem:anItem]; - [anItem release]; + struct _menuItemMap { + NSArray *items; + NSMenu *menu; + SEL action; + }; + + struct _menuItemMap menus[] = { + {inputGeneralScopeArray, inputGeneralScopePopUpMenu, @selector(inputPopupButtonChanged:)}, + {inputInputFieldScopeArray, inputInputFieldScopePopUpMenu, @selector(inputPopupButtonChanged:)}, + {inputDataTableScopeArray, inputDataTableScopePopUpMenu, @selector(inputPopupButtonChanged:)}, + {outputGeneralScopeArray, outputGeneralScopePopUpMenu, @selector(outputPopupButtonChanged:)}, + {outputInputFieldScopeArray, outputInputFieldScopePopUpMenu, @selector(outputPopupButtonChanged:)}, + {outputDataTableScopeArray, outputDataTableScopePopUpMenu, @selector(outputPopupButtonChanged:)}, + {inputFallbackInputFieldScopeArray, inputFallbackInputFieldScopePopUpMenu, @selector(inputFallbackPopupButtonChanged:)}, + {triggerInputFieldArray, triggerInputFieldPopUpMenu, @selector(triggerButtonChanged:)}, + {triggerDataTableArray, triggerDataTablePopUpMenu, @selector(triggerButtonChanged:)}, + {triggerGeneralArray, triggerGeneralPopUpMenu, @selector(triggerButtonChanged:)}, + {withBlobDataTableArray, withBlobDataTablePopUpMenu, @selector(withBlobButtonChanged:)}, + {inputNoneArray, inputNonePopUpMenu, NULL} + }; + + for(unsigned int i=0;i<(sizeof(menus)/sizeof(struct _menuItemMap));i++) { + struct _menuItemMap *menu = &menus[i]; + for(NSString* title in menu->items) { + NSMenuItem *anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:menu->action keyEquivalent:@""]; + [menu->menu addItem:anItem]; + [anItem release]; + } } - anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:SPBundleInputSourceNone] action:nil keyEquivalent:@""]; - [inputNonePopUpMenu addItem:anItem]; - [anItem release]; + NSMenuItem *anItem; [inputGeneralScopePopUpMenu compatibleRemoveAllItems]; anItem = [[NSMenuItem alloc] initWithTitle:SP_BUNDLEEDITOR_SCOPE_GENERAL_STRING action:@selector(scopeButtonChanged:) keyEquivalent:@""]; [anItem setTag:kGeneralScopeArrayIndex]; -- cgit v1.2.3 From f90b5d98b485aac53c793a6c2d4df5418d6cb14d Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 19 Dec 2014 17:05:15 +0100 Subject: Add code for utf8mb4 encoding --- Source/SPConstants.h | 3 ++- Source/SPDatabaseDocument.m | 38 ++++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Source/SPConstants.h b/Source/SPConstants.h index f630dd49..60787559 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -177,7 +177,8 @@ typedef enum SPEncodingBig5Chinese = 150, SPEncodingShiftJISJapanese = 160, SPEncodingEUCJPJapanese = 170, - SPEncodingEUCKRKorean = 180 + SPEncodingEUCKRKorean = 180, + SPEncodingUTF8MB4 = 190 } SPEncodingTypes; // Table index type menu tags diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c62b42e4..9f5ce128 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1649,7 +1649,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; @"big5" : @(SPEncodingBig5Chinese), @"sjis" : @(SPEncodingShiftJISJapanese), @"ujis" : @(SPEncodingEUCJPJapanese), - @"euckr" : @(SPEncodingEUCKRKorean) + @"euckr" : @(SPEncodingEUCKRKorean), + @"utf8mb4" : @(SPEncodingUTF8MB4) }; NSNumber *encodingTag = [translationMap valueForKey:mysqlEncoding]; @@ -1665,24 +1666,25 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; - (NSString *)mysqlEncodingFromEncodingTag:(NSNumber *)encodingTag { NSDictionary *translationMap = [NSDictionary dictionaryWithObjectsAndKeys: - @"ucs2", [NSString stringWithFormat:@"%i", SPEncodingUCS2], - @"utf8", [NSString stringWithFormat:@"%i", SPEncodingUTF8], - @"utf8-", [NSString stringWithFormat:@"%i", SPEncodingUTF8viaLatin1], - @"ascii", [NSString stringWithFormat:@"%i", SPEncodingASCII], - @"latin1", [NSString stringWithFormat:@"%i", SPEncodingLatin1], + @"ucs2", [NSString stringWithFormat:@"%i", SPEncodingUCS2], + @"utf8", [NSString stringWithFormat:@"%i", SPEncodingUTF8], + @"utf8-", [NSString stringWithFormat:@"%i", SPEncodingUTF8viaLatin1], + @"ascii", [NSString stringWithFormat:@"%i", SPEncodingASCII], + @"latin1", [NSString stringWithFormat:@"%i", SPEncodingLatin1], @"macroman", [NSString stringWithFormat:@"%i", SPEncodingMacRoman], - @"cp1250", [NSString stringWithFormat:@"%i", SPEncodingCP1250Latin2], - @"latin2", [NSString stringWithFormat:@"%i", SPEncodingISOLatin2], - @"cp1256", [NSString stringWithFormat:@"%i", SPEncodingCP1256Arabic], - @"greek", [NSString stringWithFormat:@"%i", SPEncodingGreek], - @"hebrew", [NSString stringWithFormat:@"%i", SPEncodingHebrew], - @"latin5", [NSString stringWithFormat:@"%i", SPEncodingLatin5Turkish], - @"cp1257", [NSString stringWithFormat:@"%i", SPEncodingCP1257WinBaltic], - @"cp1251", [NSString stringWithFormat:@"%i", SPEncodingCP1251WinCyrillic], - @"big5", [NSString stringWithFormat:@"%i", SPEncodingBig5Chinese], - @"sjis", [NSString stringWithFormat:@"%i", SPEncodingShiftJISJapanese], - @"ujis", [NSString stringWithFormat:@"%i", SPEncodingEUCJPJapanese], - @"euckr", [NSString stringWithFormat:@"%i", SPEncodingEUCKRKorean], + @"cp1250", [NSString stringWithFormat:@"%i", SPEncodingCP1250Latin2], + @"latin2", [NSString stringWithFormat:@"%i", SPEncodingISOLatin2], + @"cp1256", [NSString stringWithFormat:@"%i", SPEncodingCP1256Arabic], + @"greek", [NSString stringWithFormat:@"%i", SPEncodingGreek], + @"hebrew", [NSString stringWithFormat:@"%i", SPEncodingHebrew], + @"latin5", [NSString stringWithFormat:@"%i", SPEncodingLatin5Turkish], + @"cp1257", [NSString stringWithFormat:@"%i", SPEncodingCP1257WinBaltic], + @"cp1251", [NSString stringWithFormat:@"%i", SPEncodingCP1251WinCyrillic], + @"big5", [NSString stringWithFormat:@"%i", SPEncodingBig5Chinese], + @"sjis", [NSString stringWithFormat:@"%i", SPEncodingShiftJISJapanese], + @"ujis", [NSString stringWithFormat:@"%i", SPEncodingEUCJPJapanese], + @"euckr", [NSString stringWithFormat:@"%i", SPEncodingEUCKRKorean], + @"utf8mb4", [NSString stringWithFormat:@"%i", SPEncodingUTF8MB4], nil]; NSString *mysqlEncoding = [translationMap valueForKey:[NSString stringWithFormat:@"%i", [encodingTag intValue]]]; -- cgit v1.2.3 From 617c0005b5aa212828c03dfe1c825511defb958e Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 19 Dec 2014 17:50:42 +0100 Subject: Touch all XIB files with Xcode 6.1.1 No"real" changes were made. NOTE: There is actually a chance for this change to break stuff. --- Interfaces/English.lproj/AboutPanel.xib | 306 +- Interfaces/English.lproj/BundleEditor.xib | 300 +- Interfaces/English.lproj/BundleHTMLOutput.xib | 76 +- Interfaces/English.lproj/ConnectionErrorDialog.xib | 30 +- Interfaces/English.lproj/ConnectionView.xib | 329 +- Interfaces/English.lproj/Console.xib | 62 +- Interfaces/English.lproj/ContentFilterManager.xib | 1496 +++++- Interfaces/English.lproj/ContentPaginationView.xib | 1384 ++++- Interfaces/English.lproj/DBView.xib | 5294 +++++++++++++++++++- Interfaces/English.lproj/DataMigrationDialog.xib | 4124 ++++++++++++++- Interfaces/English.lproj/DatabaseProcessList.xib | 87 +- .../English.lproj/DatabaseServerVariables.xib | 184 +- Interfaces/English.lproj/EncodingPopupView.xib | 51 +- Interfaces/English.lproj/ExportDialog.xib | 1591 +++++- Interfaces/English.lproj/FieldEditorSheet.xib | 924 +++- Interfaces/English.lproj/GotoDatabaseDialog.xib | 66 +- Interfaces/English.lproj/ImportAccessory.xib | 462 +- Interfaces/English.lproj/IndexesView.xib | 1406 +++++- Interfaces/English.lproj/MainMenu.xib | 2734 ++++++++-- Interfaces/English.lproj/MainWindow.xib | 190 +- Interfaces/English.lproj/Navigator.xib | 297 +- Interfaces/English.lproj/Preferences.xib | 274 +- Interfaces/English.lproj/PrintAccessory.xib | 50 +- .../English.lproj/ProgressIndicatorLayer.xib | 3519 ++++++++++++- Interfaces/English.lproj/QueryFavoriteManager.xib | 1494 +++++- Interfaces/English.lproj/SSHQuestionDialog.xib | 111 +- Interfaces/English.lproj/SaveSPFAccessory.xib | 3499 ++++++++++++- Interfaces/English.lproj/UserManagerView.xib | 213 +- 28 files changed, 28206 insertions(+), 2347 deletions(-) diff --git a/Interfaces/English.lproj/AboutPanel.xib b/Interfaces/English.lproj/AboutPanel.xib index a9dd57d4..d3f23f69 100644 --- a/Interfaces/English.lproj/AboutPanel.xib +++ b/Interfaces/English.lproj/AboutPanel.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -54,7 +54,7 @@ {213, 107} - + 256 @@ -81,8 +81,9 @@ NeXT Rich Text Format v1.0 pasteboard type NeXT TIFF v4.0 pasteboard type - {273, 239} + {262, 239} + @@ -98,11 +99,11 @@ - 273 + 262 1 - 67111173 + 2309 0 @@ -150,8 +151,9 @@ - {{1, 1}, {273, 239}} + {{1, 1}, {262, 239}} + @@ -179,8 +181,9 @@ 256 - {{260, 1}, {14, 239}} + {{263, 1}, {11, 239}} + NO 256 @@ -192,6 +195,7 @@ -2147483392 {{-100, -100}, {87, 18}} + NO 1 @@ -202,6 +206,7 @@ {{207, 20}, {275, 241}} + 133138 @@ -216,13 +221,14 @@ 256 {{8, 74}, {191, 22}} + YES -2079326144 138413056 Sequel Pro - .LucidaGrandeUI + YES 18 1044 @@ -248,13 +254,14 @@ 256 {{23, 12}, {161, 32}} + YES 67108864 134217728 License - .LucidaGrandeUI + YES 13 1044 @@ -284,6 +291,7 @@ {{29, 104}, {149, 157}} + YES 134217728 @@ -305,13 +313,14 @@ 268 {{8, 52}, {191, 14}} + YES 68157504 138548224 Build Version - .LucidaGrandeUI + YES 11 3100 @@ -334,6 +343,8 @@ {502, 281} + + {{0, 0}, {1440, 878}} {213, 129} @@ -388,7 +399,7 @@ 1 - 67111169 + 2305 0 @@ -487,7 +498,7 @@ NO - + appNameVersionTextField @@ -781,14 +792,267 @@ - + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPAboutController + NSWindowController + + id + id + + + + closeApplicationLicenseSheet: + id + + + openApplicationLicenseSheet: + id + + + + NSTextField + NSTextView + NSPanel + NSTextView + NSTextField + + + + appBuildVersionTextField + NSTextField + + + appCreditsTextView + NSTextView + + + appLicensePanel + NSPanel + + + appLicenseTextView + NSTextView + + + appNameVersionTextField + NSTextField + + + + IBProjectSource + ../Source/SPAboutController.h + + + + SPAboutController + + id + id + + + + closeApplicationLicenseSheet: + id + + + openApplicationLicenseSheet: + id + + + + IBProjectSource + ../Source/SPAboutController.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/BundleEditor.xib b/Interfaces/English.lproj/BundleEditor.xib index a4d68b29..ffd2103e 100644 --- a/Interfaces/English.lproj/BundleEditor.xib +++ b/Interfaces/English.lproj/BundleEditor.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSActionCell @@ -86,7 +86,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{0, 0.5}, {142, 23}} + {{0, 1}, {142, 23}} YES @@ -146,7 +146,7 @@ 67108928 134219776 - .LucidaGrandeUI + YES 13 1044 @@ -318,7 +318,7 @@ 2048 - .LucidaGrandeUI + YES 11 3100 @@ -810,7 +810,7 @@ 262144 [Shortcut recorder placeholder] - .LucidaGrandeUI + YES 9 3614 @@ -1802,7 +1802,7 @@ NO - + window @@ -4112,11 +4112,9 @@ id id id - id id id id - id @@ -4171,10 +4169,6 @@ moveSelectionLineUp: id - - orderFrontSharingServicePicker: - id - selectCurrentLine: id @@ -4187,19 +4181,124 @@ selectEnclosingBrackets: id - - toggleQuickLookPreviewPanel: + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: id IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.m SPBundleCommandTextView NSTextView + + commandScrollView + NSScrollView + + + commandScrollView + + commandScrollView + NSScrollView + + + + IBProjectSource + ../Source/SPBundleCommandTextView.h + + + + SPBundleCommandTextView id id @@ -4224,20 +4323,9 @@ id - - commandScrollView - NSScrollView - - - commandScrollView - - commandScrollView - NSScrollView - - IBProjectSource - ./Classes/SPBundleCommandTextView.h + ../Source/SPBundleCommandTextView.m @@ -4260,7 +4348,6 @@ id id id - id id id id @@ -4330,10 +4417,6 @@ showHelp: id - - showWindow: - id - triggerButtonChanged: id @@ -4523,7 +4606,118 @@ IBProjectSource - ./Classes/SPBundleEditorController.h + ../Source/SPBundleEditorController.h + + + + SPBundleEditorController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addCommandBundle: + id + + + closeSheet: + id + + + closeUndeleteDefaultBundlesSheet: + id + + + displayBundleMetaInfo: + id + + + duplicateCommandBundle: + id + + + inputFallbackPopupButtonChanged: + id + + + inputPopupButtonChanged: + id + + + outputPopupButtonChanged: + id + + + performClose: + id + + + reloadBundles: + id + + + removeCommandBundle: + id + + + revealCommandBundleInFinder: + id + + + saveAndCloseWindow: + id + + + saveBundle: + id + + + scopeButtonChanged: + id + + + showHelp: + id + + + showWindow: + id + + + triggerButtonChanged: + id + + + undeleteDefaultBundles: + id + + + withBlobButtonChanged: + id + + + + IBProjectSource + ../Source/SPBundleEditorController.m @@ -4531,7 +4725,7 @@ NSOutlineView IBProjectSource - ./Classes/SPOutlineView.h + ../Source/SPOutlineView.h @@ -4564,7 +4758,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -4572,9 +4784,11 @@ NSWindow IBProjectSource - ./Classes/SPWindow.h + ../Source/SPWindow.h + + SRRecorderCell NSActionCell @@ -4590,8 +4804,8 @@ - IBProjectSource - ./Classes/SRRecorderCell.h + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderCell.h @@ -4609,8 +4823,8 @@ - IBProjectSource - ./Classes/SRRecorderControl.h + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderControl.h @@ -4618,10 +4832,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/BundleHTMLOutput.xib b/Interfaces/English.lproj/BundleHTMLOutput.xib index d7e0755c..9796e267 100644 --- a/Interfaces/English.lproj/BundleHTMLOutput.xib +++ b/Interfaces/English.lproj/BundleHTMLOutput.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 - 4514 - 3338 + 6254 + 6254 NSCustomObject @@ -45,7 +45,7 @@ {50, 50} - + 4352 @@ -70,6 +70,7 @@ {480, 270} + @@ -88,6 +89,8 @@ {480, 270} + + {{0, 0}, {1440, 878}} @@ -99,7 +102,7 @@ NO - + window @@ -229,14 +232,61 @@ - + + + + SPBundleHTMLOutputController + NSWindowController + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + webView + WebView + + + webView + + webView + WebView + + + + IBProjectSource + ../Source/SPBundleHTMLOutputController.h + + + + SPBundleHTMLOutputController + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPBundleHTMLOutputController.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ConnectionErrorDialog.xib b/Interfaces/English.lproj/ConnectionErrorDialog.xib index ccd7a7d9..e6802666 100644 --- a/Interfaces/English.lproj/ConnectionErrorDialog.xib +++ b/Interfaces/English.lproj/ConnectionErrorDialog.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -48,7 +48,7 @@ - + 256 @@ -56,13 +56,14 @@ 274 {{112, 64}, {404, 34}} + YES 67108864 272629760 Sequel Pro appears to have lost the connection to the server, or the server has stopped responding. - .LucidaGrandeUI + YES 13 1044 @@ -94,6 +95,7 @@ 289 {{365, 12}, {154, 32}} + 1 YES @@ -116,6 +118,7 @@ 289 {{198, 12}, {167, 32}} + YES 67108864 @@ -145,6 +148,7 @@ {{20, 53}, {75, 74}} + YES 134217728 @@ -174,6 +178,7 @@ {{70, 49}, {32, 32}} + YES 134217728 @@ -195,13 +200,14 @@ 268 {{112, 110}, {404, 17}} + YES 68157504 272630784 Connection Lost - .LucidaGrandeUI-Bold + YES 13 2072 @@ -215,6 +221,8 @@ {533, 147} + + {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} @@ -223,7 +231,7 @@ NO - + connectionErrorDialog @@ -407,10 +415,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ConnectionView.xib b/Interfaces/English.lproj/ConnectionView.xib index 7356d24b..75941fbf 100644 --- a/Interfaces/English.lproj/ConnectionView.xib +++ b/Interfaces/English.lproj/ConnectionView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSButton @@ -54,7 +54,7 @@ NSApplication - + 274 @@ -78,7 +78,6 @@ {{0, 1}, {200, 22}} - YES @@ -101,7 +100,6 @@ 292 {{61, -1}, {32, 25}} - YES @@ -109,7 +107,7 @@ 134217728 - .LucidaGrandeUI + YES 13 1044 @@ -132,7 +130,6 @@ 292 {{30, -1}, {32, 25}} - YES @@ -159,7 +156,6 @@ 292 {{-2, 0}, {36, 23}} - YES @@ -388,7 +384,6 @@ {{185, 1}, {15, 22}} - YES @@ -419,7 +414,6 @@ 4352 {200, 489} - YES NO @@ -439,7 +433,7 @@ 2048 Favorites - .LucidaGrandeUI + YES 11 3100 @@ -523,7 +517,6 @@ {200, 489} - @@ -537,7 +530,6 @@ -2147483392 {{229, 1}, {15, 524}} - NO @@ -549,7 +541,6 @@ -2147483392 {{1, 525}, {228, 15}} - NO 1 @@ -560,7 +551,6 @@ {{0, 23}, {200, 489}} - 133680 @@ -574,7 +564,6 @@ {200, 513} - YES @@ -607,7 +596,6 @@ 268 {{158.5, 3}, {125, 28}} - YES @@ -630,7 +618,6 @@ 268 {{15, 3}, {145, 28}} - YES @@ -653,7 +640,6 @@ 265 {{286, 3}, {145, 28}} - YES @@ -674,7 +660,6 @@ {446, 37} - NSView @@ -683,8 +668,6 @@ 274 {{13, 61}, {420, 417}} - - 1 @@ -1705,7 +1688,6 @@ 268 {{108, 3}, {251, 18}} - YES @@ -1730,7 +1712,6 @@ 268 {{110, 343}, {247, 22}} - SPColorSelectorView @@ -1739,7 +1720,6 @@ 268 {{110, 313}, {247, 22}} - YES @@ -1760,7 +1740,6 @@ 268 {{7, 315}, {98, 17}} - YES @@ -1780,7 +1759,6 @@ 268 {{110, 279}, {247, 22}} - YES @@ -1801,7 +1779,6 @@ 268 {{7, 281}, {98, 17}} - YES @@ -1821,7 +1798,6 @@ 268 {{110, 245}, {247, 22}} - YES @@ -1842,7 +1818,6 @@ 268 {{7, 247}, {98, 17}} - YES @@ -1862,7 +1837,6 @@ 268 {{110, 211}, {247, 22}} - YES @@ -1884,7 +1858,6 @@ 268 {{7, 213}, {98, 17}} - YES @@ -1904,7 +1877,6 @@ 268 {{110, 177}, {247, 22}} - YES @@ -1926,7 +1898,6 @@ 268 {{10, 179}, {95, 17}} - YES @@ -1946,7 +1917,6 @@ 268 {{110, 129}, {247, 22}} - YES @@ -1967,7 +1937,6 @@ 268 {{10, 131}, {95, 17}} - YES @@ -1987,7 +1956,6 @@ 268 {{110, 95}, {247, 22}} - YES @@ -2008,7 +1976,6 @@ 268 {{7, 97}, {98, 17}} - YES @@ -2028,7 +1995,6 @@ 268 {{110, 61}, {219, 22}} - YES @@ -2049,7 +2015,6 @@ 268 {{7, 63}, {98, 17}} - YES @@ -2069,7 +2034,6 @@ 268 {{110, 27}, {247, 22}} - YES @@ -2091,7 +2055,6 @@ 268 {{7, 29}, {98, 17}} - YES @@ -2111,7 +2074,6 @@ 268 {{110, 373}, {247, 22}} - YES @@ -2133,7 +2095,6 @@ 268 {{7, 375}, {98, 17}} - YES @@ -2153,7 +2114,6 @@ 268 {{328, 60}, {29, 24}} - YES @@ -2178,7 +2138,6 @@ 268 {{7, 63}, {98, 17}} - YES @@ -2198,7 +2157,6 @@ 268 {{110, 61}, {219, 22}} - YES @@ -2220,7 +2178,6 @@ {{12, -34}, {377, 422}} - NSView @@ -2233,7 +2190,6 @@ 268 {{-3, 15}, {107, 17}} - YES @@ -2253,7 +2209,6 @@ 268 {{109, 13}, {220, 22}} - YES @@ -2279,8 +2234,6 @@ 268 {{328, 12}, {29, 24}} - - YES 67108864 @@ -2304,7 +2257,6 @@ 268 {{-3, 49}, {107, 17}} - YES @@ -2324,7 +2276,6 @@ 268 {{109, 47}, {220, 22}} - YES @@ -2350,7 +2301,6 @@ 268 {{328, 46}, {29, 24}} - YES @@ -2375,7 +2325,6 @@ 268 {{-3, 83}, {107, 17}} - YES @@ -2395,7 +2344,6 @@ 268 {{109, 81}, {220, 22}} - YES @@ -2420,7 +2368,6 @@ 268 {{328, 80}, {29, 24}} - YES @@ -2443,14 +2390,12 @@ {{12, -146}, {377, 104}} - NSView {{10, 33}, {400, 371}} - SSH @@ -2472,7 +2417,6 @@ 289 {{285, 33}, {147, 32}} - YES @@ -2495,7 +2439,6 @@ 1316 {{20, 43}, {16, 16}} - 28938 16 @@ -2506,7 +2449,6 @@ -2147483356 {{41, 43}, {252, 17}} - YES @@ -2526,7 +2468,6 @@ 292 {{15, 37}, {25, 25}} - YES @@ -2547,21 +2488,18 @@ {{116.5, 5}, {446, 472}} - NSCustomView {681, 480} - SPFlippedView {681, 481} - @@ -2572,8 +2510,6 @@ -2147483392 {{663, 0}, {16, 580}} - - NO _doScroller: @@ -2585,7 +2521,6 @@ -2147483392 {{0, 466}, {663, 15}} - NO 1 @@ -2596,7 +2531,6 @@ {681, 481} - 133680 @@ -2611,7 +2545,6 @@ 266 {{17, 489}, {647, 17}} - YES @@ -2619,7 +2552,7 @@ 138413056 Enter connection details below, or choose a favorite - .LucidaGrandeUI-Bold + YES 13 2072 @@ -2633,14 +2566,12 @@ {{201, 0}, {681, 513}} - YES {882, 513} - YES 2 @@ -2648,8 +2579,6 @@ {882, 513} - - SPFlippedView @@ -2693,7 +2622,7 @@ MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA - .LucidaGrandeUI + YES 10 2843 @@ -2971,7 +2900,7 @@ YES - + 274 @@ -2979,6 +2908,7 @@ 292 {{14, 14}, {273, 18}} + YES 67108864 @@ -3002,6 +2932,7 @@ 274 {{2, 42}, {575, 34}} + YES 67108864 @@ -3017,6 +2948,8 @@ {579, 83} + + NSView @@ -3232,7 +3165,7 @@ - + 268 @@ -3240,6 +3173,7 @@ 268 {{-3, 12}, {371, 34}} + YES 67108864 @@ -3255,12 +3189,14 @@ {365, 52} + + NSView NO - + errorDetailWindow @@ -8024,7 +7960,7 @@ NSTextFieldCell IBProjectSource - ./Classes/ImageAndTextCell.h + ../Source/ImageAndTextCell.h @@ -8043,11 +7979,9 @@ id id id - id id id id - id @@ -8102,10 +8036,6 @@ moveSelectionLineUp: id - - orderFrontSharingServicePicker: - id - selectCurrentLine: id @@ -8118,14 +8048,101 @@ selectEnclosingBrackets: id - - toggleQuickLookPreviewPanel: + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: id IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.m @@ -8144,7 +8161,7 @@ IBProjectSource - ./Classes/SPColorSelectorView.h + ../Source/SPColorSelectorView.h @@ -8515,7 +8532,103 @@ IBProjectSource - ./Classes/SPConnectionController.h + ../Source/SPConnectionController.h + + + + SPConnectionController + + id + id + id + id + NSButton + id + id + id + id + id + id + id + id + id + id + id + id + + + + addFavorite: + id + + + addFavoriteUsingCurrentDetails: + id + + + addGroup: + id + + + cancelConnection: + id + + + chooseKeyLocation: + NSButton + + + duplicateFavorite: + id + + + exportFavorites: + id + + + importFavorites: + id + + + initiateConnection: + id + + + makeSelectedFavoriteDefault: + id + + + nodeDoubleClicked: + id + + + removeNode: + id + + + renameNode: + id + + + saveFavorite: + id + + + showHelp: + id + + + updateKeyLocationFileVisibility: + id + + + updateSSLInterface: + id + + + + IBProjectSource + ../Source/SPConnectionController.m @@ -8523,7 +8636,7 @@ ImageAndTextCell IBProjectSource - ./Classes/SPFavoriteTextFieldCell.h + ../Source/SPFavoriteTextFieldCell.h @@ -8531,7 +8644,7 @@ NSOutlineView IBProjectSource - ./Classes/SPFavoritesOutlineView.h + ../Source/SPFavoritesOutlineView.h @@ -8539,7 +8652,7 @@ NSView IBProjectSource - ./Classes/SPFlippedView.h + ../Source/SPFlippedView.h @@ -8572,7 +8685,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -8580,10 +8711,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/Console.xib b/Interfaces/English.lproj/Console.xib index b46381f8..d48195cf 100644 --- a/Interfaces/English.lproj/Console.xib +++ b/Interfaces/English.lproj/Console.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSButton @@ -109,7 +109,7 @@ 134348800 Save As... - .LucidaGrandeUI + YES 11 3100 @@ -468,7 +468,7 @@ 134217728 Clear - .LucidaGrandeUI + YES 13 1044 @@ -750,7 +750,7 @@ NO - + window @@ -1549,7 +1549,53 @@ IBProjectSource - ./Classes/SPQueryController.h + ../Source/SPQueryController.h + + + + SPQueryController + + id + id + id + id + id + id + id + + + + clearConsole: + id + + + saveConsoleAs: + id + + + toggleShowConnections: + id + + + toggleShowDatabases: + id + + + toggleShowHelpStatements: + id + + + toggleShowSelectShowStatements: + id + + + toggleShowTimeStamps: + id + + + + IBProjectSource + ../Source/SPQueryController.m @@ -1557,10 +1603,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ContentFilterManager.xib b/Interfaces/English.lproj/ContentFilterManager.xib index e4a273b3..89104d4a 100644 --- a/Interfaces/English.lproj/ContentFilterManager.xib +++ b/Interfaces/English.lproj/ContentFilterManager.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSArrayController @@ -79,7 +79,7 @@ 0 Box - .LucidaGrandeUI + YES 13 1044 @@ -384,7 +384,7 @@ 2048 Content Filters - .LucidaGrandeUI + YES 11 3100 @@ -559,7 +559,7 @@ 262144 Suppress leading <field> placeholder - .LucidaGrandeUI + YES 9 3614 @@ -1113,7 +1113,7 @@ NO - + window @@ -2160,7 +2160,7 @@ NSTextFieldCell IBProjectSource - ./Classes/ImageAndTextCell.h + ../Source/ImageAndTextCell.h @@ -2251,7 +2251,98 @@ IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m @@ -2263,7 +2354,6 @@ id id id - id id id id @@ -2289,10 +2379,6 @@ importContentFilterByAdding: id - - importFavoritesByReplacing: - id - insertPlaceholder: id @@ -2382,7 +2468,63 @@ IBProjectSource - ./Classes/SPContentFilterManager.h + ../Source/SPContentFilterManager.h + + + + SPContentFilterManager + + id + id + id + id + id + id + id + id + id + + + + addContentFilter: + id + + + closeContentFilterManagerSheet: + id + + + duplicateContentFilter: + id + + + exportContentFilter: + id + + + importContentFilterByAdding: + id + + + importFavoritesByReplacing: + id + + + insertPlaceholder: + id + + + removeContentFilter: + id + + + suppressLeadingFiledPlaceholderWasChanged: + id + + + + IBProjectSource + ../Source/SPContentFilterManager.m @@ -2401,7 +2543,25 @@ IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m @@ -2428,11 +2588,9 @@ id id id - id id id id - id id @@ -2516,10 +2674,6 @@ saveQueryHistory: id - - searchInDocForWebViewSelection: - id - showCompletionList: id @@ -2532,10 +2686,6 @@ showHelpForSearchString: id - - showHelpForWebViewSelection: - id - switchDefaultQueryAction: id @@ -2822,89 +2972,240 @@ IBProjectSource - ./Classes/SPCustomQuery.h - - - - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h + ../Source/SPCustomQuery.h - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - - - - addConnectionToFavorites: - id - - - addDatabase: - id - - - alterDatabase: - id - - - analyzeTable: + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: id @@ -2931,10 +3232,6 @@ chooseEncoding: id - - closeErrorConnectionSheet: - id - closePanelSheet: id @@ -3003,10 +3300,6 @@ optimizeTable: id - - printDocument: - id - refreshTables: id @@ -3075,30 +3368,6 @@ validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -3451,16 +3720,347 @@ IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPDatabaseDocument.h - SPExtendedTableInfo - NSObject + SPDatabaseDocument - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id id id id @@ -3587,22 +4187,63 @@ tableSourceInstance id - - tableTypePopUpButton - NSPopUpButton + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id - - tableUpdatedAt - NSTextField + + updateTableEncoding: + id - - tablesListInstance - SPTablesList + + updateTableType: + id IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.m @@ -3635,7 +4276,25 @@ IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -3801,7 +4460,53 @@ IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -3912,7 +4617,73 @@ IBProjectSource - ./Classes/SPQueryFavoriteManager.h + ../Source/SPQueryFavoriteManager.h + + + + SPQueryFavoriteManager + + id + id + id + id + id + id + id + id + id + id + id + + + + addQueryFavorite: + id + + + closeQueryManagerSheet: + id + + + duplicateQueryFavorite: + id + + + exportFavorites: + id + + + importFavoritesByAdding: + id + + + importFavoritesByReplacing: + id + + + insertPlaceholder: + id + + + removeAllQueryFavorites: + id + + + removeQueryFavorite: + id + + + saveFavoriteToFile: + id + + + showHelp: + id + + + + IBProjectSource + ../Source/SPQueryFavoriteManager.m @@ -3945,7 +4716,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -4069,6 +4858,7 @@ id id NSButton + NSBox NSButton NSButton NSButton @@ -4076,6 +4866,7 @@ NSStepper NSButton NSView + NSViewController id id id @@ -4200,6 +4991,10 @@ multipleLineEditingButton NSButton + + paginationBox + NSBox + paginationButton NSButton @@ -4224,54 +5019,154 @@ paginationPreviousButton NSButton - - paginationView - NSView + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id - - reloadButton + + removeRow: id - - removeButton + + setCompareTypes: id - - secondBetweenField + + setDefaultOperator: id - - spHistoryControllerInstance - SPHistoryController + + showDefaultOperaterHelp: + id - - tableContentView - SPCopyTable + + showFilterTable: + id - - tableDataInstance - SPTableData + + tableFilterClear: + id - - tableDocumentInstance - SPDatabaseDocument + + toggleDistinctSelect: + id - - tableInfoInstance - SPTableInfo + + toggleFilterField: + id - - tableSourceInstance + + toggleLookAllFieldsMode: id - - tablesListInstance + + toggleNegateClause: id + + togglePagination: + NSButton + IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.m @@ -4293,7 +5188,7 @@ IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -4340,7 +5235,7 @@ IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -4350,7 +5245,6 @@ id id id - id id id id @@ -4370,10 +5264,6 @@ duplicateField: id - - reloadTable: - id - removeField: id @@ -4536,7 +5426,94 @@ IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m @@ -4544,7 +5521,7 @@ NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -4555,9 +5532,9 @@ id id id + id id id - id id id id @@ -4580,6 +5557,10 @@ openTableInNewTab: id + + openTableInNewWindow: + id + removeTable: id @@ -4588,10 +5569,6 @@ renameTable: id - - tableEncodingButtonChanged: - id - togglePaneCollapse: id @@ -4626,6 +5603,8 @@ NSSearchField NSMenuItem NSMenuItem + NSMenuItem + NSMenuItem NSMenuItem NSMenuItem NSMenuItem @@ -4725,6 +5704,14 @@ openTableInNewTabMenuItem NSMenuItem + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + removeTableContextMenuItem NSMenuItem @@ -4860,26 +5847,94 @@ IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h - SPTextView - NSTextView + SPTablesList - id - id + id + id + id + id + id + id + id + id + id + id + id + id - - printDocument: + + addTable: id - - showMySQLHelpForCurrentWord: + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: id + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + SPCustomQuery NSScrollView @@ -4906,7 +5961,28 @@ IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m @@ -4914,10 +5990,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ContentPaginationView.xib b/Interfaces/English.lproj/ContentPaginationView.xib index 23d4bfcd..4865483d 100644 --- a/Interfaces/English.lproj/ContentPaginationView.xib +++ b/Interfaces/English.lproj/ContentPaginationView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSBox @@ -56,7 +56,6 @@ {{1, 1}, {328, 134}} - {{0, -47}, {330, 136}} @@ -70,7 +69,7 @@ 0 - .LucidaGrandeUI + YES 11 3100 @@ -112,9 +111,11 @@ YES - + + 0 + - + 268 @@ -122,7 +123,6 @@ 268 {{15, 31}, {166, 18}} - YES @@ -152,7 +152,6 @@ 268 {{187, 31}, {52, 19}} - YES @@ -229,7 +228,6 @@ 268 {{241, 28}, {15, 22}} - YES @@ -251,7 +249,6 @@ 12 {{14, 50}, {302, 5}} - {0, 0} @@ -259,7 +256,7 @@ 0 Box - .LucidaGrandeUI + YES 13 1044 @@ -279,7 +276,6 @@ 268 {{204, 59}, {15, 22}} - YES @@ -300,7 +296,6 @@ 268 {{259, 33}, {60, 14}} - YES @@ -333,8 +328,6 @@ 268 {{15, 6}, {303, 18}} - - YES 67108864 @@ -358,7 +351,6 @@ 268 {{15, 64}, {129, 14}} - YES @@ -378,7 +370,6 @@ 268 {{150, 61}, {52, 19}} - YES @@ -446,7 +437,6 @@ 268 {{225, 62}, {91, 17}} - YES @@ -466,8 +456,6 @@ {330, 89} - - _NS:9 NSView @@ -475,7 +463,7 @@ NO - + paginationView @@ -969,11 +957,9 @@ id id id - id id id id - id @@ -1028,10 +1014,6 @@ moveSelectionLineUp: id - - orderFrontSharingServicePicker: - id - selectCurrentLine: id @@ -1044,14 +1026,101 @@ selectEnclosingBrackets: id - - toggleQuickLookPreviewPanel: + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: id IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.m @@ -1070,7 +1139,25 @@ IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m @@ -1097,11 +1184,9 @@ id id id - id id id id - id id @@ -1185,10 +1270,6 @@ saveQueryHistory: id - - searchInDocForWebViewSelection: - id - showCompletionList: id @@ -1201,10 +1282,6 @@ showHelpForSearchString: id - - showHelpForWebViewSelection: - id - switchDefaultQueryAction: id @@ -1491,119 +1568,266 @@ IBProjectSource - ./Classes/SPCustomQuery.h - - - - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h + ../Source/SPCustomQuery.h - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id - - addConnectionToFavorites: + + chooseQueryFavorite: id - - addDatabase: + + chooseQueryHistory: id - - alterDatabase: + + clearQueryHistory: id - - analyzeTable: + + closeSheet: id - - backForwardInHistory: + + copyQueryHistory: id - - cancelTask: + + filterQueryFavorites: id - - checkTable: + + filterQueryHistory: id - - checksumTable: + + gearMenuItemSelected: id - - chooseDatabase: + + helpSearchFindNextInPage: id - - chooseEncoding: + + helpSearchFindPreviousInPage: id - + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + closeErrorConnectionSheet: id + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + closePanelSheet: id @@ -1672,10 +1896,6 @@ optimizeTable: id - - printDocument: - id - refreshTables: id @@ -1744,30 +1964,6 @@ validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -2085,42 +2281,373 @@ tableTriggersInstance id - - tablesListInstance - SPTablesList - - - taskCancelButton - NSButton - - - taskDescriptionText + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: id - - taskProgressIndicator + + viewRelations: id - - taskProgressLayer - NSBox - - - titleAccessoryView + + viewStatus: id - - titleImageView + + viewStructure: id - - titleStringView + + viewTriggers: id IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m @@ -2271,7 +2798,48 @@ IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m @@ -2304,7 +2872,25 @@ IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -2470,7 +3056,53 @@ IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -2503,7 +3135,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -2792,54 +3442,150 @@ paginationView NSView - - paginationViewController - NSViewController + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id - - reloadButton + + reloadTable: id - - removeButton + + removeRow: id - - secondBetweenField + + setCompareTypes: id - - spHistoryControllerInstance - SPHistoryController + + setDefaultOperator: + id - - tableContentView - SPCopyTable + + showDefaultOperaterHelp: + id - - tableDataInstance - SPTableData + + showFilterTable: + id - - tableDocumentInstance - SPDatabaseDocument + + tableFilterClear: + id - - tableInfoInstance - SPTableInfo + + toggleDistinctSelect: + id - - tableSourceInstance + + toggleFilterField: id - - tablesListInstance + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: id + + togglePagination: + NSButton + IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.m @@ -2861,7 +3607,7 @@ IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -2908,7 +3654,7 @@ IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -2918,7 +3664,6 @@ id id id - id id id id @@ -2938,10 +3683,6 @@ duplicateField: id - - reloadTable: - id - removeField: id @@ -3104,7 +3845,94 @@ IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m @@ -3112,7 +3940,7 @@ NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -3126,7 +3954,6 @@ id id id - id id id id @@ -3161,10 +3988,6 @@ renameTable: id - - tableEncodingButtonChanged: - id - togglePaneCollapse: id @@ -3443,26 +4266,94 @@ IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h - SPTextView - NSTextView + SPTablesList - id - id + id + id + id + id + id + id + id + id + id + id + id + id - - printDocument: + + addTable: id - - showMySQLHelpForCurrentWord: + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: id + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + SPCustomQuery NSScrollView @@ -3489,25 +4380,28 @@ IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h - WebView - - reloadFromOrigin: - id - - - reloadFromOrigin: - - reloadFromOrigin: + SPTextView + + id + id + + + + printDocument: id - + + showMySQLHelpForCurrentWord: + id + + IBProjectSource - ./Classes/WebView.h + ../Source/SPTextView.m @@ -3515,10 +4409,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 35efd25d..a47effcc 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 - 5056 - 5056 + 6254 + 6254 NSBox @@ -68,7 +68,7 @@ NSApplication - + 274 @@ -108,10 +108,8 @@ 4362 {218, 38} - - - NSAppearanceNameVibrantLight - + + YES NO YES @@ -130,7 +128,7 @@ 2048 - .LucidaGrandeUI + YES 11 3100 @@ -153,7 +151,7 @@ 2048 Text Cell - .LucidaGrandeUI + YES 13 1044 @@ -220,6 +218,7 @@ {{1, 1}, {218, 38}} + 2 @@ -229,6 +228,7 @@ -2147483392 {{-100, -100}, {15, 8}} + NO @@ -239,6 +239,7 @@ -2147483392 {{-100, -100}, {223, 15}} + NO 1 @@ -248,7 +249,8 @@ {{-1, -13}, {220, 40}} - + + 133122 @@ -263,6 +265,7 @@ 290 {{5, 2}, {204, 19}} + YES YES @@ -324,6 +327,7 @@ {214, 24} + YES @@ -344,8 +348,8 @@ 4352 {214, 334} - - + + YES NO YES @@ -410,6 +414,7 @@ {214, 334} + @@ -418,6 +423,7 @@ -2147483392 {{197, 0}, {15, 292}} + NO @@ -429,6 +435,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -438,7 +445,8 @@ {214, 334} - + + 133648 @@ -451,18 +459,21 @@ {{0, 25}, {214, 334}} + YES {214, 359} + 2 {214, 359} + YES @@ -483,8 +494,8 @@ 4352 {216, 166} - - + + YES NO YES @@ -549,6 +560,7 @@ {216, 166} + 2 @@ -558,6 +570,7 @@ -2147483392 {{-100, -100}, {15, 20}} + NO @@ -568,6 +581,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -577,7 +591,8 @@ {{-1, 0}, {216, 166}} - + + 133648 @@ -600,8 +615,8 @@ 4352 {214, 166} - - + + YES NO YES @@ -666,6 +681,7 @@ {214, 166} + 2 @@ -675,6 +691,7 @@ -2147483392 {{-100, -100}, {15, 20}} + NO @@ -686,6 +703,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -695,7 +713,8 @@ {214, 166} - + + 133632 @@ -708,12 +727,14 @@ {{0, 360}, {214, 166}} + YES {{0, 23}, {214, 526}} + 2 @@ -730,6 +751,7 @@ {214, 23} + YES @@ -760,6 +782,7 @@ {{199, 0}, {15, 23}} + YES @@ -782,6 +805,7 @@ 260 {{-1, -1}, {32, 25}} + YES @@ -808,6 +832,7 @@ 260 {{92, -1}, {32, 25}} + YES @@ -838,6 +863,7 @@ 260 {{29, 0}, {36, 23}} + {250, 250} YES @@ -1064,7 +1090,6 @@ - -1 YES 1 YES @@ -1077,6 +1102,7 @@ 260 {{61, -1}, {32, 25}} + YES @@ -1101,6 +1127,7 @@ {214, 549} + YES @@ -1113,7 +1140,7 @@ 274 {{-6, -10}, {740, 564}} - + source @@ -1168,7 +1195,7 @@ 4352 {693, 288} - + YES NO YES @@ -1791,13 +1818,12 @@ {{-1, 22}, {695, 306}} - + 133682 - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -2092,7 +2118,7 @@ 272761856 INDEXES - .LucidaGrandeUI-Bold + YES 11 3357 @@ -2157,7 +2183,7 @@ 4352 {693, 141} - + YES NO YES @@ -2477,13 +2503,12 @@ {{-1, 22}, {695, 159}} - + 133682 - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -3524,6 +3549,7 @@ {{6, 10}, {695, 23}} + YES @@ -3543,6 +3569,7 @@ 292 {{36, 10}, {36, 23}} + {250, 250} YES @@ -3628,6 +3655,7 @@ 292 {{6, 9}, {32, 25}} + YES @@ -3652,6 +3680,7 @@ 292 {{68, 9}, {32, 25}} + YES @@ -3698,9 +3727,29 @@ 6418 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + {693, 141} - + + @@ -3758,11 +3807,12 @@ {{1, 1}, {693, 141}} + - {5, 5} + {1, -1} 0 4 @@ -3772,6 +3822,7 @@ -2147483392 {{-100, -100}, {87, 11}} + NO 257 @@ -3784,6 +3835,7 @@ -2147483392 {{224, 1}, {15, 133}} + NO @@ -3792,7 +3844,8 @@ {{0, 1}, {695, 143}} - + + 133650 @@ -3804,6 +3857,7 @@ {695, 143} + YES NSView @@ -3817,6 +3871,7 @@ 265 {{507, 214}, {180, 22}} + YES @@ -3918,7 +3973,8 @@ 4352 {694, 182} - + + YES NO YES @@ -3927,6 +3983,7 @@ 256 {694, 17} + @@ -3935,6 +3992,7 @@ -2147483392 {15, 20} + @@ -3986,6 +4044,7 @@ {{1, 17}, {693, 182}} {{0.5, 0}, {693, 182}} + @@ -3998,8 +4057,8 @@ {{1, 0}, {693, 17}} - {{1, 0}, {693, 17}} + @@ -4008,6 +4067,7 @@ -2147483392 {{680, 17}, {15, 199}} + NO @@ -4019,6 +4079,7 @@ 256 {{1, 199}, {693, 15}} + YES NO @@ -4032,7 +4093,8 @@ {{0, -1}, {695, 215}} - + + 133810 @@ -4049,6 +4111,7 @@ 268 {{156, 214}, {98, 22}} + YES @@ -4162,6 +4225,7 @@ 264 {{38, 214}, {108, 22}} + YES @@ -4275,6 +4339,7 @@ 268 {{-13, 214}, {48, 23}} + {250, 250} YES @@ -4586,6 +4651,7 @@ {{26, 214}, {669, 23}} + YES @@ -4603,6 +4669,7 @@ {{0, 152}, {695, 237}} + YES NSView @@ -4610,11 +4677,13 @@ {695, 389} + {695, 391} + YES @@ -4627,6 +4696,7 @@ 268 {{15, 91}, {363, 14}} + YES @@ -4654,7 +4724,8 @@ 2322 {671, 72} - + + @@ -4699,6 +4770,7 @@ {671, 72} + @@ -4710,6 +4782,7 @@ -2147483392 {{-100, -100}, {87, 18}} + NO 1 @@ -4722,6 +4795,7 @@ -2147483392 {{225, 0}, {15, 135}} + NO @@ -4730,7 +4804,8 @@ {{12, 12}, {671, 72}} - + + 133648 @@ -4742,12 +4817,14 @@ {{0, 392}, {695, 117}} + YES {{6, 33}, {695, 509}} + 2 @@ -4756,6 +4833,7 @@ 290 {{103, 12}, {581, 17}} + YES 67108864 @@ -4772,6 +4850,7 @@ {{10, 7}, {705, 544}} + Custom Query @@ -5261,7 +5340,10 @@ Box - + + 3 + MCAwLjgAA + 3 2 @@ -5283,7 +5365,10 @@ Box - + + 3 + MCAwLjgAA + 3 2 @@ -6501,7 +6586,6 @@ - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -6643,12 +6727,14 @@ {{215, 0}, {728, 549}} + YES {943, 549} + YES 2 @@ -6656,6 +6742,8 @@ {943, 549} + + NSView @@ -8108,7 +8196,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 Box - + + 3 + MCAwLjgAA + 3 2 @@ -8246,12 +8337,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134217728 Table: - .LucidaGrandeUI + YES 11 1558 - + + 3 + MCAwLjgAA + 1 @@ -8322,12 +8416,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134217728 Name - .LucidaGrandeUI + YES 11 1558 - + + 3 + MCAwLjgAA + 1 @@ -8580,12 +8677,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134217728 Action - .LucidaGrandeUI + YES 11 1558 - + + 3 + MCAwLjgAA + 1 @@ -8788,12 +8888,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134217728 References - .LucidaGrandeUI + YES 11 1558 - + + 3 + MCAwLjgAA + 1 @@ -9123,12 +9226,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134217728 Trigger: - .LucidaGrandeUI + YES 11 1558 - + + 3 + MCAwLjgAA + 1 @@ -9197,7 +9303,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 2322 {318, 168} - + @@ -9274,7 +9380,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{20, 45}, {320, 170}} - + 133650 @@ -9375,7 +9481,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 4196352 Doing Stuff… - .LucidaGrandeUI-Bold + YES 13 2072 @@ -9477,7 +9583,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 2322 {370, 204} - + @@ -9554,7 +9660,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{-1, 35}, {383, 206}} - + 133138 @@ -9713,7 +9819,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 2322 {411, 264} - + @@ -9790,7 +9896,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{-1, 42}, {413, 266}} - + 133650 @@ -9902,7 +10008,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 2322 {352, 178} - + @@ -9979,7 +10085,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{20, 45}, {365, 180}} - + 133138 @@ -10154,7 +10260,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 75497472 0 - .LucidaGrandeUI + YES 12 787 @@ -10284,7 +10390,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 Box - + + 3 + MCAwLjgAA + 3 2 @@ -10447,7 +10556,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 274 {752, 125} - + YES NO YES @@ -10558,13 +10667,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {752, 142} - + 133680 - QSAAAEEgAABBmAAAQZgAAA 0.25 4 @@ -10738,7 +10846,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 134479872 Edit - .LucidaGrandeUI + YES 9 3614 @@ -11146,7 +11254,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {600, 127} {260, 127} - + 256 @@ -11154,6 +11262,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{17, 93}, {225, 14}} + YES @@ -11173,6 +11282,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{19, 67}, {220, 18}} + YES @@ -11193,6 +11303,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 289 {{150, 13}, {94, 28}} + {250, 750} 1 YES @@ -11218,6 +11329,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 292 {{14, 13}, {99, 28}} + {250, 750} YES @@ -11242,6 +11354,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{18, 43}, {224, 18}} + YES @@ -11263,6 +11376,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {260, 127} + + {{0, 0}, {1920, 1178}} @@ -11280,7 +11395,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - + 256 @@ -11288,6 +11403,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{228, 12}, {96, 32}} + {250, 750} 1 YES @@ -11312,6 +11428,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{132, 12}, {96, 32}} + {250, 750} YES @@ -11336,6 +11453,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{20, 60}, {298, 22}} + YES @@ -11359,6 +11477,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{17, 113}, {304, 17}} + YES @@ -11378,6 +11497,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{17, 90}, {304, 14}} + YES @@ -11394,6 +11514,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {338, 150} + + {{0, 0}, {1920, 1178}} @@ -11628,7 +11750,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 256 {358, 139} - + YES NO YES @@ -11800,13 +11922,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {360, 157} - + 133682 - QSAAAEEgAABBgAAAQYAAAA 0.25 4 @@ -11818,7 +11939,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NSView - + 4364 @@ -11826,6 +11947,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{20, 1}, {176, 19}} + YES 342884417 @@ -11877,6 +11999,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {217, 20} + + NSView @@ -12379,7 +12503,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NO - + addDatabaseButton @@ -26710,14 +26834,5022 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - + + + + ImageAndTextCell + NSTextFieldCell + + IBProjectSource + ../Source/ImageAndTextCell.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPComboPopupButton + NSPopUpButton + + IBProjectSource + ../Source/SPComboPopupButton.h + + + + SPComboPopupButtonCell + NSPopUpButtonCell + + + + SPCopyTable + SPTableView + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m + + + + SPCustomQuery + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + switchDefaultQueryAction: + id + + + + id + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSScrollView + SPCopyTable + NSMenuItem + NSPopUpButton + id + NSScrollView + NSTextField + NSSegmentedControl + NSSearchField + NSSearchFieldCell + NSSegmentedControl + WebView + NSWindow + NSMenuItem + NSMenuItem + SPSplitView + NSTextField + id + NSMenuItem + NSMenuItem + NSSearchField + id + NSMenuItem + NSWindow + id + NSSearchField + id + NSMenuItem + NSButton + SPSplitView + id + id + id + NSMenuItem + NSMenuItem + NSMenuItem + NSButton + NSButton + NSMenuItem + NSMenuItem + id + id + SPTextView + id + id + + + + affectedRowsText + id + + + autohelpMenuItem + NSMenuItem + + + autoindentMenuItem + NSMenuItem + + + autopairMenuItem + NSMenuItem + + + autouppercaseKeywordsMenuItem + NSMenuItem + + + clearHistoryMenuItem + NSMenuItem + + + commentCurrentQueryMenuItem + NSMenuItem + + + commentLineOrSelectionMenuItem + NSMenuItem + + + completionListMenuItem + NSMenuItem + + + copyHistoryMenuItem + NSMenuItem + + + customQueryScrollView + NSScrollView + + + customQueryView + SPCopyTable + + + editorFontMenuItem + NSMenuItem + + + encodingPopUp + NSPopUpButton + + + errorText + id + + + errorTextScrollView + NSScrollView + + + errorTextTitle + NSTextField + + + helpNavigator + NSSegmentedControl + + + helpSearchField + NSSearchField + + + helpSearchFieldCell + NSSearchFieldCell + + + helpTargetSelector + NSSegmentedControl + + + helpWebView + WebView + + + helpWebViewWindow + NSWindow + + + nextHistoryMenuItem + NSMenuItem + + + previousHistoryMenuItem + NSMenuItem + + + queryEditorSplitView + SPSplitView + + + queryFavoriteNameTextField + NSTextField + + + queryFavoritesButton + id + + + queryFavoritesSaveAllMenuItem + NSMenuItem + + + queryFavoritesSaveAsMenuItem + NSMenuItem + + + queryFavoritesSearchField + NSSearchField + + + queryFavoritesSearchFieldView + id + + + queryFavoritesSearchMenuItem + NSMenuItem + + + queryFavoritesSheet + NSWindow + + + queryHistoryButton + id + + + queryHistorySearchField + NSSearchField + + + queryHistorySearchFieldView + id + + + queryHistorySearchMenuItem + NSMenuItem + + + queryInfoButton + NSButton + + + queryInfoPaneSplitView + SPSplitView + + + runAllButton + id + + + runPrimaryActionButton + id + + + runPrimaryActionButtonAsSelection + id + + + runPrimaryActionMenuItem + NSMenuItem + + + runSecondaryActionMenuItem + NSMenuItem + + + saveHistoryMenuItem + NSMenuItem + + + saveQueryFavoriteButton + NSButton + + + saveQueryFavoriteGlobal + NSButton + + + shiftLeftMenuItem + NSMenuItem + + + shiftRightMenuItem + NSMenuItem + + + tableDocumentInstance + id + + + tablesListInstance + id + + + textView + SPTextView + + + valueSheet + id + + + valueTextField + id + + + + IBProjectSource + ../Source/SPCustomQuery.h + + + + SPCustomQuery + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDataImport + NSObject + + id + id + id + + + + cancelProgressBar: + id + + + changeFormat: + id + + + closeSheet: + id + + + + id + id + id + id + id + id + id + id + NSPopUpButton + id + NSButton + id + id + id + NSPopUpButton + id + id + NSTextView + id + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addCreateTableSwitch + id + + + addDropTableSwitch + id + + + addErrorsSwitch + id + + + addTableContentSwitch + id + + + csvFullStreamingSwitch + id + + + customQueryInstance + id + + + errorsSheet + id + + + errorsView + id + + + importEncodingPopup + NSPopUpButton + + + importFieldMapperSheetWindow + id + + + importFieldNamesSwitch + NSButton + + + importFieldsEnclosedField + id + + + importFieldsEscapedField + id + + + importFieldsTerminatedField + id + + + importFormatPopup + NSPopUpButton + + + importFromClipboardAccessoryView + id + + + importFromClipboardSheet + id + + + importFromClipboardTextView + NSTextView + + + importLinesTerminatedField + id + + + importSQLErrorHandlingPopup + NSPopUpButton + + + importTabView + id + + + importView + id + + + multiCSVFullStreamingSwitch + id + + + multiXMLFullStreamingSwitch + id + + + singleProgressBar + id + + + singleProgressSheet + id + + + singleProgressText + id + + + singleProgressTitle + id + + + sqlCompressionSwitch + id + + + sqlFullStreamingSwitch + id + + + tableContentInstance + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPDataImport.h + + + + SPDataImport + + id + id + id + + + + cancelProgressBar: + id + + + changeFormat: + id + + + closeSheet: + id + + + + IBProjectSource + ../Source/SPDataImport.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + id + id + NSWindow + SPSplitView + id + NSButton + id + NSTextField + NSTextView + NSWindow + id + NSTextView + NSPopUpButton + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + NSTableView + NSScrollView + NSPopUpButton + id + id + id + id + id + id + id + id + NSSearchField + NSView + NSProgressIndicator + id + id + id + NSButton + NSButton + NSSecureTextField + NSButton + NSButton + NSButton + id + id + id + id + id + SPTableContent + SPTableData + id + NSScrollView + NSTableView + id + SPTableStructure + NSTabView + id + SPTablesList + NSButton + id + id + NSBox + id + id + id + + + + addDatabaseButton + id + + + chooseDatabaseButton + id + + + connectionErrorDialog + NSWindow + + + contentViewSplitter + SPSplitView + + + copyDatabaseButton + id + + + copyDatabaseDataButton + NSButton + + + copyDatabaseMessageField + id + + + createTableSyntaxTextField + NSTextField + + + createTableSyntaxTextView + NSTextView + + + createTableSyntaxWindow + NSWindow + + + customQueryInstance + id + + + customQueryTextView + NSTextView + + + databaseAlterCollationButton + NSPopUpButton + + + databaseAlterEncodingButton + NSPopUpButton + + + databaseAlterSheet + id + + + databaseCollationButton + id + + + databaseCopyNameField + id + + + databaseCopySheet + id + + + databaseDataInstance + id + + + databaseEncodingButton + id + + + databaseNameField + id + + + databaseRenameNameField + id + + + databaseRenameSheet + id + + + databaseSheet + id + + + dbTablesTableView + NSTableView + + + documentActivityScrollView + NSScrollView + + + encodingPopUp + NSPopUpButton + + + exportControllerInstance + id + + + extendedTableInfoInstance + id + + + favoritesButton + id + + + historyControl + id + + + inputTextWindow + id + + + inputTextWindowHeader + id + + + inputTextWindowMessage + id + + + inputTextWindowSecureTextField + id + + + listFilterField + NSSearchField + + + parentView + NSView + + + queryProgressBar + NSProgressIndicator + + + renameDatabaseButton + id + + + renameDatabaseMessageField + id + + + saveConnectionAccessory + id + + + saveConnectionAutoConnect + NSButton + + + saveConnectionEncrypt + NSButton + + + saveConnectionEncryptString + NSSecureTextField + + + saveConnectionIncludeData + NSButton + + + saveConnectionIncludeQuery + NSButton + + + saveConnectionSavePassword + NSButton + + + saveConnectionSavePasswordAlert + id + + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDumpInstance + id + + + tableInfoScrollView + NSScrollView + + + tableInfoTable + NSTableView + + + tableRelationsInstance + id + + + tableSourceInstance + SPTableStructure + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExportController + NSWindowController + + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSButton + NSButton + NSButton + id + + + + cancelExport: + id + + + changeExportCompressionFormat: + id + + + changeExportOutputPath: + id + + + closeSheet: + id + + + export: + id + + + exportCustomQueryResultAsFormat: + id + + + refreshTableList: + id + + + selectDeselectAllTables: + id + + + switchInput: + id + + + toggleAdvancedExportOptionsView: + id + + + toggleCustomFilenameFormatView: + id + + + toggleNewFilePerTable: + NSButton + + + toggleSQLIncludeContent: + NSButton + + + toggleSQLIncludeDropSyntax: + NSButton + + + toggleSQLIncludeStructure: + NSButton + + + toggleXMLOutputFormat: + id + + + + SPCustomQuery + NSTextView + NSWindow + NSView + NSButton + NSButton + NSButton + NSComboBox + NSComboBox + NSComboBox + NSButton + NSComboBox + NSTextField + NSTokenField + NSTokenField + NSView + NSButton + NSButton + NSButton + NSButton + NSButton + NSBox + NSTextField + NSPopUpButton + NSTabView + NSPopUpButton + NSTextField + NSButton + NSProgressIndicator + NSTextField + NSTextField + NSWindow + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSPopUpButton + NSTextField + NSButton + NSTableView + NSBox + NSScrollView + NSTabView + NSButton + NSPopUpButton + NSButton + NSButton + NSTextField + NSView + SPTableContent + SPTableData + SPDatabaseDocument + SPTablesList + + + + customQueryInstance + SPCustomQuery + + + errorsTextView + NSTextView + + + errorsWindow + NSWindow + + + exportAdvancedOptionsView + NSView + + + exportAdvancedOptionsViewButton + NSButton + + + exportAdvancedOptionsViewLabelButton + NSButton + + + exportButton + NSButton + + + exportCSVFieldsEscapedField + NSComboBox + + + exportCSVFieldsTerminatedField + NSComboBox + + + exportCSVFieldsWrappedField + NSComboBox + + + exportCSVIncludeFieldNamesCheck + NSButton + + + exportCSVLinesTerminatedField + NSComboBox + + + exportCSVNULLValuesAsTextField + NSTextField + + + exportCustomFilenameTokenField + NSTokenField + + + exportCustomFilenameTokensField + NSTokenField + + + exportCustomFilenameView + NSView + + + exportCustomFilenameViewButton + NSButton + + + exportCustomFilenameViewLabelButton + NSButton + + + exportDeselectAllTablesButton + NSButton + + + exportDotForceLowerTableNamesCheck + NSButton + + + exportFilePerTableCheck + NSButton + + + exportFilenameDividerBox + NSBox + + + exportFormatInfoText + NSTextField + + + exportInputPopUpButton + NSPopUpButton + + + exportOptionsTabBar + NSTabView + + + exportOutputCompressionFormatPopupButton + NSPopUpButton + + + exportPathField + NSTextField + + + exportProcessLowMemoryButton + NSButton + + + exportProgressIndicator + NSProgressIndicator + + + exportProgressText + NSTextField + + + exportProgressTitle + NSTextField + + + exportProgressWindow + NSWindow + + + exportRefreshTablesButton + NSButton + + + exportSQLBLOBFieldsAsHexCheck + NSButton + + + exportSQLIncludeAutoIncrementValueButton + NSButton + + + exportSQLIncludeContentCheck + NSButton + + + exportSQLIncludeDropSyntaxCheck + NSButton + + + exportSQLIncludeErrorsCheck + NSButton + + + exportSQLIncludeStructureCheck + NSButton + + + exportSQLInsertDividerPopUpButton + NSPopUpButton + + + exportSQLInsertNValueTextField + NSTextField + + + exportSelectAllTablesButton + NSButton + + + exportTableList + NSTableView + + + exportTableListButtonBar + NSBox + + + exportTablelistScrollView + NSScrollView + + + exportTypeTabBar + NSTabView + + + exportUseUTF8BOMButton + NSButton + + + exportXMLFormatPopUpButton + NSPopUpButton + + + exportXMLIncludeContent + NSButton + + + exportXMLIncludeStructure + NSButton + + + exportXMLNULLValuesAsTextField + NSTextField + + + exporterView + NSView + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExportController.h + + + + SPExportController + + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSButton + NSButton + NSButton + id + + + + cancelExport: + id + + + changeExportCompressionFormat: + id + + + changeExportOutputPath: + id + + + closeSheet: + id + + + export: + id + + + exportCustomQueryResultAsFormat: + id + + + refreshTableList: + id + + + selectDeselectAllTables: + id + + + switchInput: + id + + + toggleAdvancedExportOptionsView: + id + + + toggleCustomFilenameFormatView: + id + + + toggleNewFilePerTable: + NSButton + + + toggleSQLIncludeContent: + NSButton + + + toggleSQLIncludeDropSyntax: + NSButton + + + toggleSQLIncludeStructure: + NSButton + + + toggleXMLOutputFormat: + id + + + + IBProjectSource + ../Source/SPExportController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + SPDatabaseData + id + NSPopUpButton + NSTextView + NSTextView + NSTextField + SPTableData + NSTextField + id + NSPopUpButton + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + id + NSPopUpButton + NSTextField + SPTablesList + + + + databaseDataInstance + SPDatabaseData + + + resetAutoIncrementResetButton + id + + + tableCollationPopUpButton + NSPopUpButton + + + tableCommentsTextView + NSTextView + + + tableCreateSyntaxTextView + NSTextView + + + tableCreatedAt + NSTextField + + + tableDataInstance + SPTableData + + + tableDataSize + NSTextField + + + tableDocumentInstance + id + + + tableEncodingPopUpButton + NSPopUpButton + + + tableIndexSize + NSTextField + + + tableMaxDataSize + NSTextField + + + tableRowAutoIncrement + NSTextField + + + tableRowAvgLength + NSTextField + + + tableRowFormat + NSTextField + + + tableRowNumber + NSTextField + + + tableSizeFree + NSTextField + + + tableSourceInstance + id + + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m + + + + SPHistoryController + NSObject + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + NSSegmentedControl + SPDatabaseDocument + + + + historyControl + NSSegmentedControl + + + theDocument + SPDatabaseDocument + + + + IBProjectSource + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m + + + + SPIndexesController + NSWindowController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + NSButton + NSButton + NSBox + NSButton + SPDatabaseDocument + NSView + NSButton + NSButton + NSTextField + NSTextField + NSTextField + NSTableColumn + NSPopUpButton + NSTextField + NSPopUpButton + NSScrollView + NSTableView + SPTableView + NSButton + NSButton + SPTableData + SPTableStructure + SPTablesList + + + + addIndexButton + NSButton + + + addIndexedColumnButton + NSButton + + + anchoredButtonBar + NSBox + + + confirmAddIndexButton + NSButton + + + dbDocument + SPDatabaseDocument + + + indexAdvancedOptionsView + NSView + + + indexAdvancedOptionsViewButton + NSButton + + + indexAdvancedOptionsViewLabelButton + NSButton + + + indexKeyBlockSizeTextField + NSTextField + + + indexNameLabel + NSTextField + + + indexNameTextField + NSTextField + + + indexSizeTableColumn + NSTableColumn + + + indexStorageTypePopUpButton + NSPopUpButton + + + indexTypeLabel + NSTextField + + + indexTypePopUpButton + NSPopUpButton + + + indexedColumnsScrollView + NSScrollView + + + indexedColumnsTableView + NSTableView + + + indexesTableView + SPTableView + + + removeIndexButton + NSButton + + + removeIndexedColumnButton + NSButton + + + tableData + SPTableData + + + tableStructure + SPTableStructure + + + tablesList + SPTablesList + + + + IBProjectSource + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m + + + + SPProcessListController + NSWindowController + + id + id + id + id + id + id + id + id + NSMenuItem + NSButton + NSMenuItem + + + + closeSheet: + id + + + copy: + id + + + killProcessConnection: + id + + + killProcessQuery: + id + + + refreshProcessList: + id + + + saveServerProcesses: + id + + + setAutoRefreshInterval: + id + + + setCustomAutoRefreshInterval: + id + + + toggeleShowFullProcessList: + NSMenuItem + + + toggleProcessListAutoRefresh: + NSButton + + + toggleShowProcessID: + NSMenuItem + + + + NSButton + NSMenuItem + NSButton + NSTextField + NSWindow + NSSearchField + NSTableView + NSTextField + NSButton + NSProgressIndicator + NSButton + + + + autoRefreshButton + NSButton + + + autoRefreshIntervalMenuItem + NSMenuItem + + + customIntervalButton + NSButton + + + customIntervalTextField + NSTextField + + + customIntervalWindow + NSWindow + + + filterProcessesSearchField + NSSearchField + + + processListTableView + NSTableView + + + processesCountTextField + NSTextField + + + refreshProcessesButton + NSButton + + + refreshProgressIndicator + NSProgressIndicator + + + saveProcessesButton + NSButton + + + + IBProjectSource + ../Source/SPProcessListController.h + + + + SPProcessListController + + id + id + id + id + id + id + id + id + NSMenuItem + NSButton + NSMenuItem + + + + closeSheet: + id + + + copy: + id + + + killProcessConnection: + id + + + killProcessQuery: + id + + + refreshProcessList: + id + + + saveServerProcesses: + id + + + setAutoRefreshInterval: + id + + + setCustomAutoRefreshInterval: + id + + + toggeleShowFullProcessList: + NSMenuItem + + + toggleProcessListAutoRefresh: + NSButton + + + toggleShowProcessID: + NSMenuItem + + + + IBProjectSource + ../Source/SPProcessListController.m + + + + SPQueryController + NSWindowController + + id + id + id + id + id + id + id + id + + + + clearConsole: + id + + + copy: + id + + + saveConsoleAs: + id + + + toggleShowConnections: + id + + + toggleShowDatabases: + id + + + toggleShowHelpStatements: + id + + + toggleShowSelectShowStatements: + id + + + toggleShowTimeStamps: + id + + + + NSButton + NSSearchField + NSTableView + NSButton + NSButton + NSButton + NSTextField + NSProgressIndicator + NSButton + NSView + + + + clearConsoleButton + NSButton + + + consoleSearchField + NSSearchField + + + consoleTableView + NSTableView + + + includeConnectionButton + NSButton + + + includeDatabaseButton + NSButton + + + includeTimeStampsButton + NSButton + + + loggingDisabledTextField + NSTextField + + + progressIndicator + NSProgressIndicator + + + saveConsoleButton + NSButton + + + saveLogView + NSView + + + + IBProjectSource + ../Source/SPQueryController.h + + + + SPQueryController + + id + id + id + id + id + id + id + + + + clearConsole: + id + + + saveConsoleAs: + id + + + toggleShowConnections: + id + + + toggleShowDatabases: + id + + + toggleShowHelpStatements: + id + + + toggleShowSelectShowStatements: + id + + + toggleShowTimeStamps: + id + + + + IBProjectSource + ../Source/SPQueryController.m + + + + SPServerVariablesController + NSWindowController + + id + id + id + id + id + + + + closeSheet: + id + + + copy: + id + + + copyServerVariableName: + id + + + copyServerVariableValue: + id + + + saveServerVariables: + id + + + + NSSearchField + NSButton + NSTextField + NSTableView + + + + filterVariablesSearchField + NSSearchField + + + saveVariablesButton + NSButton + + + variablesCountTextField + NSTextField + + + variablesTableView + NSTableView + + + + IBProjectSource + ../Source/SPServerVariablesController.h + + + + SPServerVariablesController + + id + id + id + id + id + + + + closeSheet: + id + + + copy: + id + + + copyServerVariableName: + id + + + copyServerVariableValue: + id + + + saveServerVariables: + id + + + + IBProjectSource + ../Source/SPServerVariablesController.m + + + + SPSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + NSView + NSButton + + + + additionalDragHandleView + NSView + + + collapseToggleButton + NSButton + + + + IBProjectSource + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m + + + + SPTableContent + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + id + id + id + id + SPSplitView + NSView + id + id + NSPopUpButton + id + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSButton + NSPanel + NSComboBox + SPSplitView + SPCopyTable + SPTextView + NSPanel + id + id + id + id + NSButton + NSBox + NSButton + NSButton + NSButton + NSTextField + NSStepper + NSButton + NSView + NSViewController + id + id + id + SPHistoryController + SPCopyTable + SPTableData + SPDatabaseDocument + SPTableInfo + id + id + + + + addButton + id + + + argumentField + id + + + betweenTextField + id + + + compareField + id + + + contentSplitView + SPSplitView + + + contentViewPane + NSView + + + countText + id + + + duplicateButton + id + + + fieldField + NSPopUpButton + + + filterButton + id + + + filterTableClearButton + NSButton + + + filterTableDistinctCheckbox + NSButton + + + filterTableFilterButton + NSButton + + + filterTableLiveSearchCheckbox + NSButton + + + filterTableNegateCheckbox + NSButton + + + filterTableQueryTitle + NSTextField + + + filterTableSearchAllFields + NSButton + + + filterTableSetDefaultOperatorSheet + NSPanel + + + filterTableSetDefaultOperatorValue + NSComboBox + + + filterTableSplitView + SPSplitView + + + filterTableView + SPCopyTable + + + filterTableWhereClause + SPTextView + + + filterTableWindow + NSPanel + + + firstBetweenField + id + + + limitRowsButton + id + + + limitRowsField + id + + + limitRowsStepper + id + + + multipleLineEditingButton + NSButton + + + paginationBox + NSBox + + + paginationButton + NSButton + + + paginationGoButton + NSButton + + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + IBProjectSource + ../Source/SPTableContent.m + + + + SPTableContentFilterController + NSObject + + IBProjectSource + ../Source/SPTableContentFilterController.h + + + + SPTableData + NSObject + + SPDatabaseDocument + SPTablesList + + + + tableDocumentInstance + SPDatabaseDocument + + + tableListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableData.h + + + + SPTableInfo + NSObject + + NSTableView + id + id + id + NSScrollView + id + id + + + + activitiesTable + NSTableView + + + infoTable + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableInfoScrollView + NSScrollView + + + tableList + id + + + tableListInstance + id + + + + IBProjectSource + ../Source/SPTableInfo.h + + + + SPTableRelations + NSObject + + id + id + id + id + id + id + id + id + + + + addRelation: + id + + + closeRelationSheet: + id + + + confirmAddRelation: + id + + + openRelationSheet: + id + + + refreshRelations: + id + + + removeRelation: + id + + + selectReferenceTable: + id + + + selectTableColumn: + id + + + + NSButton + NSPanel + NSBox + NSPopUpButton + NSButton + NSTextField + NSProgressIndicator + NSTextField + NSPopUpButton + NSPopUpButton + NSTextField + NSPopUpButton + NSPopUpButton + NSButton + SPTableView + NSButton + SPTableData + SPDatabaseDocument + SPTablesList + + + + addRelationButton + NSButton + + + addRelationPanel + NSPanel + + + addRelationTableBox + NSBox + + + columnPopUpButton + NSPopUpButton + + + confirmAddRelationButton + NSButton + + + constraintName + NSTextField + + + dataProgressIndicator + NSProgressIndicator + + + labelTextField + NSTextField + + + onDeletePopUpButton + NSPopUpButton + + + onUpdatePopUpButton + NSPopUpButton + + + progressStatusTextField + NSTextField + + + refColumnPopUpButton + NSPopUpButton + + + refTablePopUpButton + NSPopUpButton + + + refreshRelationsButton + NSButton + + + relationsTableView + SPTableView + + + removeRelationButton + NSButton + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableRelations.h + + + + SPTableRelations + + id + id + id + id + id + id + id + id + + + + addRelation: + id + + + closeRelationSheet: + id + + + confirmAddRelation: + id + + + openRelationSheet: + id + + + refreshRelations: + id + + + removeRelation: + id + + + selectReferenceTable: + id + + + selectTableColumn: + id + + + + IBProjectSource + ../Source/SPTableRelations.m + + + + SPTableStructure + NSObject + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + id + id + id + SPDatabaseData + id + id + NSPopUpButtonCell + SPExtendedTableInfo + SPIndexesController + NSButton + SPTableView + id + id + id + id + id + id + id + id + id + SPTableData + SPDatabaseDocument + SPTableInfo + SPTableView + NSSplitView + SPTablesList + id + + + + addFieldButton + id + + + addIndexButton + id + + + chooseKeyButton + id + + + databaseDataInstance + SPDatabaseData + + + duplicateFieldButton + id + + + editTableButton + id + + + encodingPopupCell + NSPopUpButtonCell + + + extendedTableInfoInstance + SPExtendedTableInfo + + + indexesController + SPIndexesController + + + indexesShowButton + NSButton + + + indexesTableView + SPTableView + + + keySheet + id + + + refreshIndexesButton + id + + + reloadFieldsButton + id + + + removeFieldButton + id + + + removeIndexButton + id + + + resetAutoIncrementLine + id + + + resetAutoIncrementSheet + id + + + resetAutoIncrementValue + id + + + structureGrabber + id + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceView + SPTableView + + + tablesIndexesSplitView + NSSplitView + + + tablesListInstance + SPTablesList + + + viewColumnsMenu + id + + + + IBProjectSource + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m + + + + SPTableTextFieldCell + ImageAndTextCell + + IBProjectSource + ../Source/SPTableTextFieldCell.h + + + + SPTableTriggers + NSObject + + id + id + id + id + id + id + + + + addTrigger: + id + + + closeTriggerSheet: + id + + + confirmAddTrigger: + id + + + editTrigger: + id + + + refreshTriggers: + id + + + removeTrigger: + id + + + + NSButton + NSPanel + NSBox + NSButton + NSTextField + NSButton + NSButton + id + id + id + id + NSPopUpButton + NSPopUpButton + NSTextField + NSTextView + SPTableView + + + + addTriggerButton + NSButton + + + addTriggerPanel + NSPanel + + + addTriggerTableBox + NSBox + + + confirmAddTriggerButton + NSButton + + + labelTextField + NSTextField + + + refreshTriggersButton + NSButton + + + removeTriggerButton + NSButton + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableList + id + + + tablesListInstance + id + + + triggerActionTimePopUpButton + NSPopUpButton + + + triggerEventPopUpButton + NSPopUpButton + + + triggerNameTextField + NSTextField + + + triggerStatementTextView + NSTextView + + + triggersTableView + SPTableView + + + + IBProjectSource + ../Source/SPTableTriggers.h + + + + SPTableTriggers + + id + id + id + id + id + id + + + + addTrigger: + id + + + closeTriggerSheet: + id + + + confirmAddTrigger: + id + + + editTrigger: + id + + + refreshTriggers: + id + + + removeTrigger: + id + + + + IBProjectSource + ../Source/SPTableTriggers.m + + + + SPTableView + NSTableView + + IBProjectSource + ../Source/SPTableView.h + + + + SPTablesList + NSObject + + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + id + NSMenuItem + NSMenuItem + id + NSButton + id + id + id + id + SPDatabaseData + NSMenuItem + NSMenuItem + id + NSSearchField + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + SPHistoryController + id + SPTableContent + id + SPDatabaseDocument + id + id + id + SPSplitView + SPSplitView + id + id + SPTableStructure + id + id + SPTableView + id + id + id + id + NSMenuItem + + + + addTableButton + id + + + copyCreateSyntaxContextMenuItem + NSMenuItem + + + copyCreateSyntaxMenuItem + NSMenuItem + + + copyTableButton + id + + + copyTableContentSwitch + NSButton + + + copyTableMessageField + id + + + copyTableNameField + id + + + copyTableSheet + id + + + customQueryInstance + id + + + databaseDataInstance + SPDatabaseData + + + duplicateTableContextMenuItem + NSMenuItem + + + duplicateTableMenuItem + NSMenuItem + + + extendedTableInfoInstance + id + + + listFilterField + NSSearchField + + + openTableInNewTabContextMenuItem + NSMenuItem + + + openTableInNewTabMenuItem + NSMenuItem + + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + + + removeTableContextMenuItem + NSMenuItem + + + removeTableMenuItem + NSMenuItem + + + renameTableContextMenuItem + NSMenuItem + + + renameTableMenuItem + NSMenuItem + + + separatorTableContextMenuItem + NSMenuItem + + + separatorTableContextMenuItem2 + NSMenuItem + + + separatorTableContextMenuItem3 + NSMenuItem + + + separatorTableMenuItem + NSMenuItem + + + separatorTableMenuItem2 + NSMenuItem + + + separatorTableMenuItem3 + NSMenuItem + + + showCreateSyntaxContextMenuItem + NSMenuItem + + + showCreateSyntaxMenuItem + NSMenuItem + + + spHistoryControllerInstance + SPHistoryController + + + tableCollationButton + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + id + + + tableDocumentInstance + SPDatabaseDocument + + + tableDumpInstance + id + + + tableEncodingButton + id + + + tableInfoInstance + id + + + tableListFilterSplitView + SPSplitView + + + tableListSplitView + SPSplitView + + + tableNameField + id + + + tableSheet + id + + + tableSourceInstance + SPTableStructure + + + tableTriggersInstance + id + + + tableTypeButton + id + + + tablesListView + SPTableView + + + toolbarActionsButton + id + + + toolbarAddButton + id + + + toolbarReloadButton + id + + + truncateTableButton + id + + + truncateTableContextMenuItem + NSMenuItem + + + + IBProjectSource + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + + + SPCustomQuery + NSScrollView + SPDatabaseDocument + SPTablesList + + + + customQueryInstance + SPCustomQuery + + + scrollView + NSScrollView + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m + + + + + 0 + IBCocoaFramework + YES com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/DataMigrationDialog.xib b/Interfaces/English.lproj/DataMigrationDialog.xib index 9ad6fa18..09e05118 100644 --- a/Interfaces/English.lproj/DataMigrationDialog.xib +++ b/Interfaces/English.lproj/DataMigrationDialog.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -65,7 +65,7 @@ {634, 348} - + 274 @@ -77,17 +77,19 @@ 274 {{1, 1}, {656, 0}} + {{-12, 53}, {658, 2}} + {0, 0} 67108864 0 Box - .LucidaGrandeUI + YES 11 3100 @@ -128,13 +130,14 @@ 271 {{14, 12}, {604, 17}} + YES 68157504 138413056 CSV Import Field Mapping - .LucidaGrandeUI + YES 13 1044 @@ -166,6 +169,7 @@ 265 {{512, 51}, {226, 32}} + YES 67108864 @@ -187,6 +191,7 @@ 265 {{664, 1}, {226, 32}} + YES 67108864 @@ -208,6 +213,7 @@ 265 {{668, 1}, {226, 32}} + YES 67108864 @@ -227,10 +233,12 @@ {{1, 1}, {634, 39}} + {{-1, 308}, {636, 41}} + {0, 0} 67108864 @@ -266,6 +274,7 @@ 288 {634, 126} + YES NO YES @@ -274,12 +283,15 @@ 256 {634, 17} + - - + + -2147483392 {{-22, 0}, {12, 17}} + + @@ -528,6 +540,7 @@ {{1, 17}, {634, 126}} + @@ -538,11 +551,26 @@ 6 + + + 2338 + + + + {{1, 0}, {634, 17}} + + + + + + 4 + -2147483392 {{413, 18}, {11, 140}} + NO 256 @@ -554,6 +582,7 @@ -2147483392 {{-100, -100}, {227, 11}} + NO 257 @@ -561,28 +590,18 @@ 0.035674519836902618 0.99047619104385376 - - - 2338 - - - - {{1, 0}, {634, 17}} - - - - - 4 - + {{-1, 129}, {636, 144}} + 133650 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -593,6 +612,7 @@ 289 {{415, 12}, {102, 32}} + YES 67108864 @@ -619,6 +639,7 @@ 289 {{517, 12}, {102, 32}} + 1 YES @@ -643,6 +664,7 @@ 292 {{20, 19}, {32, 24}} + YES 603979776 @@ -668,6 +690,7 @@ 292 {{51, 19}, {32, 24}} + 1 YES @@ -695,6 +718,7 @@ 294 {{88, 23}, {195, 14}} + YES 67108928 @@ -713,6 +737,7 @@ 267 {{361, 278}, {200, 22}} + YES -2076180416 @@ -744,6 +769,7 @@ 289 {{484, 97}, {133, 22}} + YES -2076180416 @@ -808,6 +834,7 @@ 289 {{302, 102}, {180, 14}} + YES 68157504 @@ -830,6 +857,7 @@ {{5, 280}, {316, 20}} + YES 69206081 @@ -851,6 +879,7 @@ 292 {{17, 100}, {275, 18}} + YES -2080374784 @@ -879,6 +908,7 @@ 289 {{484, 73}, {133, 22}} + YES -2076180416 @@ -961,6 +991,7 @@ 289 {{302, 79}, {180, 14}} + YES 68157504 @@ -979,6 +1010,7 @@ 289 {{326, 12}, {82, 32}} + YES 67108864 @@ -1000,6 +1032,7 @@ 292 {{11, 56}, {29, 26}} + YES 67108864 @@ -1026,6 +1059,7 @@ 268 {{17, 8}, {100, 18}} + YES 67108864 @@ -1049,6 +1083,7 @@ 268 {{132, 8}, {80, 18}} + 1 YES @@ -1071,6 +1106,7 @@ {{200, 20}, {230, 44}} + NSView @@ -1082,6 +1118,7 @@ 268 {{227, 62}, {335, 18}} + YES -2080374784 @@ -1111,8 +1148,28 @@ 2322 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + {400, 37} + @@ -1132,7 +1189,7 @@ 1 - 67121127 + 12263 0 @@ -1170,6 +1227,7 @@ {{1, 1}, {400, 37}} + @@ -1199,6 +1257,7 @@ -2147483392 {{386, 1}, {15, 37}} + NO 512 @@ -1211,6 +1270,7 @@ -2147483392 {{-100, -100}, {87, 15}} + NO 513 @@ -1221,6 +1281,7 @@ {{20, 20}, {402, 39}} + 133650 @@ -1235,6 +1296,7 @@ 268 {{227, 85}, {104, 18}} + YES 67108864 @@ -1258,6 +1320,7 @@ 268 {{17, 85}, {100, 18}} + YES 67108864 @@ -1281,6 +1344,7 @@ 268 {{17, 62}, {181, 18}} + 2 YES @@ -1305,6 +1369,7 @@ 268 {{137, 85}, {80, 18}} + 1 YES @@ -1329,6 +1394,7 @@ 268 {{354, 85}, {70, 18}} + YES 67108864 @@ -1350,6 +1416,7 @@ {{93, -57}, {442, 121}} + NSView @@ -1361,6 +1428,7 @@ 289 {{212, 8}, {335, 18}} + YES 67108864 @@ -1384,6 +1452,7 @@ 268 {{17, 8}, {100, 18}} + YES 67108864 @@ -1407,6 +1476,7 @@ 268 {{132, 8}, {70, 18}} + YES 67108864 @@ -1428,6 +1498,7 @@ {{110, 20}, {390, 44}} + NSView @@ -1435,6 +1506,7 @@ 292 {{34, 58}, {58, 23}} + YES -2080374784 @@ -1456,6 +1528,7 @@ 265 {{487, 280}, {106, 19}} + YES -1804599231 @@ -1480,6 +1553,7 @@ 265 {{402, 283}, {80, 14}} + YES 68157504 @@ -1498,6 +1572,7 @@ 265 {{599, 280}, {20, 20}} + YES 67108864 @@ -1523,6 +1598,7 @@ 265 {{566, 281}, {61, 17}} + YES -2080374784 @@ -1541,6 +1617,8 @@ {634, 348} + + {{0, 0}, {1440, 878}} {634, 370} @@ -1978,7 +2056,7 @@ 274 - {13, 0} + {15, 0} YES @@ -1986,7 +2064,7 @@ YES - 10 + 12 10 1000 @@ -2024,7 +2102,7 @@ 16 tableViewAction: - -765427712 + -767524864 1 @@ -2270,7 +2348,7 @@ NO - + tableTargetPopup @@ -4536,14 +4614,3988 @@ - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPCopyTable + SPTableView + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m + + + + SPCustomQuery + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + switchDefaultQueryAction: + id + + + + id + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSScrollView + SPCopyTable + NSMenuItem + NSPopUpButton + id + NSScrollView + NSTextField + NSSegmentedControl + NSSearchField + NSSearchFieldCell + NSSegmentedControl + WebView + NSWindow + NSMenuItem + NSMenuItem + SPSplitView + NSTextField + id + NSMenuItem + NSMenuItem + NSSearchField + id + NSMenuItem + NSWindow + id + NSSearchField + id + NSMenuItem + NSButton + SPSplitView + id + id + id + NSMenuItem + NSMenuItem + NSMenuItem + NSButton + NSButton + NSMenuItem + NSMenuItem + id + id + SPTextView + id + id + + + + affectedRowsText + id + + + autohelpMenuItem + NSMenuItem + + + autoindentMenuItem + NSMenuItem + + + autopairMenuItem + NSMenuItem + + + autouppercaseKeywordsMenuItem + NSMenuItem + + + clearHistoryMenuItem + NSMenuItem + + + commentCurrentQueryMenuItem + NSMenuItem + + + commentLineOrSelectionMenuItem + NSMenuItem + + + completionListMenuItem + NSMenuItem + + + copyHistoryMenuItem + NSMenuItem + + + customQueryScrollView + NSScrollView + + + customQueryView + SPCopyTable + + + editorFontMenuItem + NSMenuItem + + + encodingPopUp + NSPopUpButton + + + errorText + id + + + errorTextScrollView + NSScrollView + + + errorTextTitle + NSTextField + + + helpNavigator + NSSegmentedControl + + + helpSearchField + NSSearchField + + + helpSearchFieldCell + NSSearchFieldCell + + + helpTargetSelector + NSSegmentedControl + + + helpWebView + WebView + + + helpWebViewWindow + NSWindow + + + nextHistoryMenuItem + NSMenuItem + + + previousHistoryMenuItem + NSMenuItem + + + queryEditorSplitView + SPSplitView + + + queryFavoriteNameTextField + NSTextField + + + queryFavoritesButton + id + + + queryFavoritesSaveAllMenuItem + NSMenuItem + + + queryFavoritesSaveAsMenuItem + NSMenuItem + + + queryFavoritesSearchField + NSSearchField + + + queryFavoritesSearchFieldView + id + + + queryFavoritesSearchMenuItem + NSMenuItem + + + queryFavoritesSheet + NSWindow + + + queryHistoryButton + id + + + queryHistorySearchField + NSSearchField + + + queryHistorySearchFieldView + id + + + queryHistorySearchMenuItem + NSMenuItem + + + queryInfoButton + NSButton + + + queryInfoPaneSplitView + SPSplitView + + + runAllButton + id + + + runPrimaryActionButton + id + + + runPrimaryActionButtonAsSelection + id + + + runPrimaryActionMenuItem + NSMenuItem + + + runSecondaryActionMenuItem + NSMenuItem + + + saveHistoryMenuItem + NSMenuItem + + + saveQueryFavoriteButton + NSButton + + + saveQueryFavoriteGlobal + NSButton + + + shiftLeftMenuItem + NSMenuItem + + + shiftRightMenuItem + NSMenuItem + + + tableDocumentInstance + id + + + tablesListInstance + id + + + textView + SPTextView + + + valueSheet + id + + + valueTextField + id + + + + IBProjectSource + ../Source/SPCustomQuery.h + + + + SPCustomQuery + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + id + id + NSWindow + SPSplitView + id + NSButton + id + NSTextField + NSTextView + NSWindow + id + NSTextView + NSPopUpButton + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + NSTableView + NSScrollView + NSPopUpButton + id + id + id + id + id + id + id + id + NSSearchField + NSView + NSProgressIndicator + id + id + id + NSButton + NSButton + NSSecureTextField + NSButton + NSButton + NSButton + id + id + id + id + id + SPTableContent + SPTableData + id + NSScrollView + NSTableView + id + SPTableStructure + NSTabView + id + SPTablesList + NSButton + id + id + NSBox + id + id + id + + + + addDatabaseButton + id + + + chooseDatabaseButton + id + + + connectionErrorDialog + NSWindow + + + contentViewSplitter + SPSplitView + + + copyDatabaseButton + id + + + copyDatabaseDataButton + NSButton + + + copyDatabaseMessageField + id + + + createTableSyntaxTextField + NSTextField + + + createTableSyntaxTextView + NSTextView + + + createTableSyntaxWindow + NSWindow + + + customQueryInstance + id + + + customQueryTextView + NSTextView + + + databaseAlterCollationButton + NSPopUpButton + + + databaseAlterEncodingButton + NSPopUpButton + + + databaseAlterSheet + id + + + databaseCollationButton + id + + + databaseCopyNameField + id + + + databaseCopySheet + id + + + databaseDataInstance + id + + + databaseEncodingButton + id + + + databaseNameField + id + + + databaseRenameNameField + id + + + databaseRenameSheet + id + + + databaseSheet + id + + + dbTablesTableView + NSTableView + + + documentActivityScrollView + NSScrollView + + + encodingPopUp + NSPopUpButton + + + exportControllerInstance + id + + + extendedTableInfoInstance + id + + + favoritesButton + id + + + historyControl + id + + + inputTextWindow + id + + + inputTextWindowHeader + id + + + inputTextWindowMessage + id + + + inputTextWindowSecureTextField + id + + + listFilterField + NSSearchField + + + parentView + NSView + + + queryProgressBar + NSProgressIndicator + + + renameDatabaseButton + id + + + renameDatabaseMessageField + id + + + saveConnectionAccessory + id + + + saveConnectionAutoConnect + NSButton + + + saveConnectionEncrypt + NSButton + + + saveConnectionEncryptString + NSSecureTextField + + + saveConnectionIncludeData + NSButton + + + saveConnectionIncludeQuery + NSButton + + + saveConnectionSavePassword + NSButton + + + saveConnectionSavePasswordAlert + id + + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDumpInstance + id + + + tableInfoScrollView + NSScrollView + + + tableInfoTable + NSTableView + + + tableRelationsInstance + id + + + tableSourceInstance + SPTableStructure + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + SPDatabaseData + id + NSPopUpButton + NSTextView + NSTextView + NSTextField + SPTableData + NSTextField + id + NSPopUpButton + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + id + NSPopUpButton + NSTextField + SPTablesList + + + + databaseDataInstance + SPDatabaseData + + + resetAutoIncrementResetButton + id + + + tableCollationPopUpButton + NSPopUpButton + + + tableCommentsTextView + NSTextView + + + tableCreateSyntaxTextView + NSTextView + + + tableCreatedAt + NSTextField + + + tableDataInstance + SPTableData + + + tableDataSize + NSTextField + + + tableDocumentInstance + id + + + tableEncodingPopUpButton + NSPopUpButton + + + tableIndexSize + NSTextField + + + tableMaxDataSize + NSTextField + + + tableRowAutoIncrement + NSTextField + + + tableRowAvgLength + NSTextField + + + tableRowFormat + NSTextField + + + tableRowNumber + NSTextField + + + tableSizeFree + NSTextField + + + tableSourceInstance + id + + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m + + + + SPFieldMapperController + NSWindowController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addGlobalSourceVariable: + id + + + addGlobalValue: + id + + + addNewColumn: + id + + + advancedCheckboxValidation: + id + + + changeFieldAlignment: + id + + + changeHasHeaderCheckbox: + id + + + changeImportMethod: + id + + + changeTableTarget: + id + + + closeGlobalValuesSheet: + id + + + closeInfoSheet: + id + + + closeSheet: + id + + + goBackToFileChooser: + id + + + goBackToFileChooserFromPathControl: + id + + + insertNULLValue: + id + + + insertPulldownValue: + id + + + insertRecentGlobalValue: + id + + + newTable: + id + + + newTableInfo: + id + + + openAdvancedSheet: + id + + + removeGlobalValue: + id + + + removeNewColumn: + id + + + setAllTypesTo: + id + + + stepRow: + id + + + + NSButton + NSMenuItem + NSButton + NSBox + NSButton + NSView + NSTextField + NSView + NSView + NSPopUpButton + NSTextField + NSButton + NSButton + NSScrollView + SPTableView + NSPathControl + NSWindow + NSTableView + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSPopUpButton + NSButton + NSPopUpButton + NSButton + NSButton + NSButton + NSMenuItem + NSButton + NSPopUpButton + NSPopUpButton + NSWindow + NSButton + NSTextField + NSTextField + NSButton + SPTextView + NSMenu + NSTextField + NSButton + NSButton + NSButton + NSButton + NSMenuItem + NSButton + NSPopUpButton + NSComboBoxCell + + + + addGlobalValueButton + NSButton + + + addNewColumnMenuItem + NSMenuItem + + + addRemainingDataSwitch + NSButton + + + advancedBox + NSBox + + + advancedButton + NSButton + + + advancedInsertView + NSView + + + advancedLabel + NSTextField + + + advancedReplaceView + NSView + + + advancedUpdateView + NSView + + + alignByPopup + NSPopUpButton + + + alignByPopupLabel + NSTextField + + + delayedCheckBox + NSButton + + + delayedReplaceCheckBox + NSButton + + + fieldMapperTableScrollView + NSScrollView + + + fieldMapperTableView + SPTableView + + + fileSourcePath + NSPathControl + + + globalValuesSheet + NSWindow + + + globalValuesTableView + NSTableView + + + gobackButton + NSButton + + + highPriorityCheckBox + NSButton + + + ignoreCheckBox + NSButton + + + ignoreUpdateCheckBox + NSButton + + + importButton + NSButton + + + importFieldNamesHeaderSwitch + NSButton + + + importMethodLabel + NSTextField + + + importMethodPopup + NSPopUpButton + + + insertNULLValueButton + NSButton + + + insertPullDownButton + NSPopUpButton + + + lowPriorityCheckBox + NSButton + + + lowPriorityReplaceCheckBox + NSButton + + + lowPriorityUpdateCheckBox + NSButton + + + matchingNameMenuItem + NSMenuItem + + + newTableButton + NSButton + + + newTableInfoEncodingPopup + NSPopUpButton + + + newTableInfoEnginePopup + NSPopUpButton + + + newTableInfoWindow + NSWindow + + + newTableNameInfoButton + NSButton + + + newTableNameLabel + NSTextField + + + newTableNameTextField + NSTextField + + + onupdateCheckBox + NSButton + + + onupdateTextView + SPTextView + + + recentGlobalValueMenu + NSMenu + + + recordCountLabel + NSTextField + + + removeGlobalValueButton + NSButton + + + replaceAfterSavingCheckBox + NSButton + + + rowDownButton + NSButton + + + rowUpButton + NSButton + + + setAllTypesToMenuItem + NSMenuItem + + + skipexistingRowsCheckBox + NSButton + + + tableTargetPopup + NSPopUpButton + + + typeComboxBox + NSComboBoxCell + + + + IBProjectSource + ../Source/SPFieldMapperController.h + + + + SPFieldMapperController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addGlobalSourceVariable: + id + + + addGlobalValue: + id + + + addNewColumn: + id + + + advancedCheckboxValidation: + id + + + changeFieldAlignment: + id + + + changeHasHeaderCheckbox: + id + + + changeImportMethod: + id + + + changeTableTarget: + id + + + closeGlobalValuesSheet: + id + + + closeInfoSheet: + id + + + closeSheet: + id + + + goBackToFileChooser: + id + + + goBackToFileChooserFromPathControl: + id + + + insertNULLValue: + id + + + insertPulldownValue: + id + + + insertRecentGlobalValue: + id + + + newTable: + id + + + newTableInfo: + id + + + openAdvancedSheet: + id + + + removeGlobalValue: + id + + + removeNewColumn: + id + + + setAllTypesTo: + id + + + stepRow: + id + + + + IBProjectSource + ../Source/SPFieldMapperController.m + + + + SPHistoryController + NSObject + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + NSSegmentedControl + SPDatabaseDocument + + + + historyControl + NSSegmentedControl + + + theDocument + SPDatabaseDocument + + + + IBProjectSource + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m + + + + SPIndexesController + NSWindowController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + NSButton + NSButton + NSBox + NSButton + SPDatabaseDocument + NSView + NSButton + NSButton + NSTextField + NSTextField + NSTextField + NSTableColumn + NSPopUpButton + NSTextField + NSPopUpButton + NSScrollView + NSTableView + SPTableView + NSButton + NSButton + SPTableData + SPTableStructure + SPTablesList + + + + addIndexButton + NSButton + + + addIndexedColumnButton + NSButton + + + anchoredButtonBar + NSBox + + + confirmAddIndexButton + NSButton + + + dbDocument + SPDatabaseDocument + + + indexAdvancedOptionsView + NSView + + + indexAdvancedOptionsViewButton + NSButton + + + indexAdvancedOptionsViewLabelButton + NSButton + + + indexKeyBlockSizeTextField + NSTextField + + + indexNameLabel + NSTextField + + + indexNameTextField + NSTextField + + + indexSizeTableColumn + NSTableColumn + + + indexStorageTypePopUpButton + NSPopUpButton + + + indexTypeLabel + NSTextField + + + indexTypePopUpButton + NSPopUpButton + + + indexedColumnsScrollView + NSScrollView + + + indexedColumnsTableView + NSTableView + + + indexesTableView + SPTableView + + + removeIndexButton + NSButton + + + removeIndexedColumnButton + NSButton + + + tableData + SPTableData + + + tableStructure + SPTableStructure + + + tablesList + SPTablesList + + + + IBProjectSource + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m + + + + SPSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + NSView + NSButton + + + + additionalDragHandleView + NSView + + + collapseToggleButton + NSButton + + + + IBProjectSource + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m + + + + SPTableContent + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + id + id + id + id + SPSplitView + NSView + id + id + NSPopUpButton + id + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSButton + NSPanel + NSComboBox + SPSplitView + SPCopyTable + SPTextView + NSPanel + id + id + id + id + NSButton + NSBox + NSButton + NSButton + NSButton + NSTextField + NSStepper + NSButton + NSView + NSViewController + id + id + id + SPHistoryController + SPCopyTable + SPTableData + SPDatabaseDocument + SPTableInfo + id + id + + + + addButton + id + + + argumentField + id + + + betweenTextField + id + + + compareField + id + + + contentSplitView + SPSplitView + + + contentViewPane + NSView + + + countText + id + + + duplicateButton + id + + + fieldField + NSPopUpButton + + + filterButton + id + + + filterTableClearButton + NSButton + + + filterTableDistinctCheckbox + NSButton + + + filterTableFilterButton + NSButton + + + filterTableLiveSearchCheckbox + NSButton + + + filterTableNegateCheckbox + NSButton + + + filterTableQueryTitle + NSTextField + + + filterTableSearchAllFields + NSButton + + + filterTableSetDefaultOperatorSheet + NSPanel + + + filterTableSetDefaultOperatorValue + NSComboBox + + + filterTableSplitView + SPSplitView + + + filterTableView + SPCopyTable + + + filterTableWhereClause + SPTextView + + + filterTableWindow + NSPanel + + + firstBetweenField + id + + + limitRowsButton + id + + + limitRowsField + id + + + limitRowsStepper + id + + + multipleLineEditingButton + NSButton + + + paginationBox + NSBox + + + paginationButton + NSButton + + + paginationGoButton + NSButton + + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + IBProjectSource + ../Source/SPTableContent.m + + + + SPTableData + NSObject + + SPDatabaseDocument + SPTablesList + + + + tableDocumentInstance + SPDatabaseDocument + + + tableListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableData.h + + + + SPTableInfo + NSObject + + NSTableView + id + id + id + NSScrollView + id + id + + + + activitiesTable + NSTableView + + + infoTable + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableInfoScrollView + NSScrollView + + + tableList + id + + + tableListInstance + id + + + + IBProjectSource + ../Source/SPTableInfo.h + + + + SPTableStructure + NSObject + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + id + id + id + SPDatabaseData + id + id + NSPopUpButtonCell + SPExtendedTableInfo + SPIndexesController + NSButton + SPTableView + id + id + id + id + id + id + id + id + id + SPTableData + SPDatabaseDocument + SPTableInfo + SPTableView + NSSplitView + SPTablesList + id + + + + addFieldButton + id + + + addIndexButton + id + + + chooseKeyButton + id + + + databaseDataInstance + SPDatabaseData + + + duplicateFieldButton + id + + + editTableButton + id + + + encodingPopupCell + NSPopUpButtonCell + + + extendedTableInfoInstance + SPExtendedTableInfo + + + indexesController + SPIndexesController + + + indexesShowButton + NSButton + + + indexesTableView + SPTableView + + + keySheet + id + + + refreshIndexesButton + id + + + reloadFieldsButton + id + + + removeFieldButton + id + + + removeIndexButton + id + + + resetAutoIncrementLine + id + + + resetAutoIncrementSheet + id + + + resetAutoIncrementValue + id + + + structureGrabber + id + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceView + SPTableView + + + tablesIndexesSplitView + NSSplitView + + + tablesListInstance + SPTablesList + + + viewColumnsMenu + id + + + + IBProjectSource + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m + + + + SPTableView + NSTableView + + IBProjectSource + ../Source/SPTableView.h + + + + SPTablesList + NSObject + + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + id + NSMenuItem + NSMenuItem + id + NSButton + id + id + id + id + SPDatabaseData + NSMenuItem + NSMenuItem + id + NSSearchField + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + SPHistoryController + id + SPTableContent + id + SPDatabaseDocument + id + id + id + SPSplitView + SPSplitView + id + id + SPTableStructure + id + id + SPTableView + id + id + id + id + NSMenuItem + + + + addTableButton + id + + + copyCreateSyntaxContextMenuItem + NSMenuItem + + + copyCreateSyntaxMenuItem + NSMenuItem + + + copyTableButton + id + + + copyTableContentSwitch + NSButton + + + copyTableMessageField + id + + + copyTableNameField + id + + + copyTableSheet + id + + + customQueryInstance + id + + + databaseDataInstance + SPDatabaseData + + + duplicateTableContextMenuItem + NSMenuItem + + + duplicateTableMenuItem + NSMenuItem + + + extendedTableInfoInstance + id + + + listFilterField + NSSearchField + + + openTableInNewTabContextMenuItem + NSMenuItem + + + openTableInNewTabMenuItem + NSMenuItem + + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + + + removeTableContextMenuItem + NSMenuItem + + + removeTableMenuItem + NSMenuItem + + + renameTableContextMenuItem + NSMenuItem + + + renameTableMenuItem + NSMenuItem + + + separatorTableContextMenuItem + NSMenuItem + + + separatorTableContextMenuItem2 + NSMenuItem + + + separatorTableContextMenuItem3 + NSMenuItem + + + separatorTableMenuItem + NSMenuItem + + + separatorTableMenuItem2 + NSMenuItem + + + separatorTableMenuItem3 + NSMenuItem + + + showCreateSyntaxContextMenuItem + NSMenuItem + + + showCreateSyntaxMenuItem + NSMenuItem + + + spHistoryControllerInstance + SPHistoryController + + + tableCollationButton + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + id + + + tableDocumentInstance + SPDatabaseDocument + + + tableDumpInstance + id + + + tableEncodingButton + id + + + tableInfoInstance + id + + + tableListFilterSplitView + SPSplitView + + + tableListSplitView + SPSplitView + + + tableNameField + id + + + tableSheet + id + + + tableSourceInstance + SPTableStructure + + + tableTriggersInstance + id + + + tableTypeButton + id + + + tablesListView + SPTableView + + + toolbarActionsButton + id + + + toolbarAddButton + id + + + toolbarReloadButton + id + + + truncateTableButton + id + + + truncateTableContextMenuItem + NSMenuItem + + + + IBProjectSource + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + + + SPCustomQuery + NSScrollView + SPDatabaseDocument + SPTablesList + + + + customQueryInstance + SPCustomQuery + + + scrollView + NSScrollView + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m + + + + + 0 + IBCocoaFramework + YES com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/DatabaseProcessList.xib b/Interfaces/English.lproj/DatabaseProcessList.xib index 64cc67ce..7b271a72 100644 --- a/Interfaces/English.lproj/DatabaseProcessList.xib +++ b/Interfaces/English.lproj/DatabaseProcessList.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSButton @@ -111,7 +111,7 @@ 2048 ID - .LucidaGrandeUI + YES 11 3100 @@ -607,7 +607,7 @@ 134217728 Clear - .LucidaGrandeUI + YES 13 1044 @@ -1092,7 +1092,7 @@ NO - + window @@ -2079,7 +2079,6 @@ id id id - id NSMenuItem NSButton NSMenuItem @@ -2117,10 +2116,6 @@ setCustomAutoRefreshInterval: id - - showWindow: - id - toggeleShowFullProcessList: NSMenuItem @@ -2195,7 +2190,73 @@ IBProjectSource - ./Classes/SPProcessListController.h + ../Source/SPProcessListController.h + + + + SPProcessListController + + id + id + id + id + id + id + id + id + NSMenuItem + NSButton + NSMenuItem + + + + closeSheet: + id + + + copy: + id + + + killProcessConnection: + id + + + killProcessQuery: + id + + + refreshProcessList: + id + + + saveServerProcesses: + id + + + setAutoRefreshInterval: + id + + + setCustomAutoRefreshInterval: + id + + + toggeleShowFullProcessList: + NSMenuItem + + + toggleProcessListAutoRefresh: + NSButton + + + toggleShowProcessID: + NSMenuItem + + + + IBProjectSource + ../Source/SPProcessListController.m @@ -2203,10 +2264,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/DatabaseServerVariables.xib b/Interfaces/English.lproj/DatabaseServerVariables.xib index 406cf466..e32ec48c 100644 --- a/Interfaces/English.lproj/DatabaseServerVariables.xib +++ b/Interfaces/English.lproj/DatabaseServerVariables.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -58,7 +58,7 @@ {433, 341} - + 256 @@ -72,27 +72,31 @@ 256 - {432, 251} + {421, 251} + YES NO YES 256 - {432, 17} + {421, 17} + - - + + 256 {{422, 0}, {12, 17}} + + Variable_name - 230 + 224 40 1000 @@ -100,7 +104,7 @@ 2048 Variable Name - .LucidaGrandeUI + YES 11 3100 @@ -141,7 +145,7 @@ Value - 196 + 191 40 1000 @@ -198,18 +202,34 @@ 1 - {{1, 17}, {432, 251}} + {{1, 17}, {421, 251}} + 4 + + + 2338 + + + + {{1, 0}, {421, 17}} + + + + + + 4 + 256 - {{419, 17}, {14, 251}} + {{422, 17}, {11, 251}} + NO 256 @@ -221,34 +241,25 @@ -2147483392 {{-100, -100}, {358, 11}} + NO 257 _doScroller: 0.99721449613571167 - - - 2338 - - - - {{1, 0}, {432, 17}} - - - - - 4 - + {{-1, 39}, {434, 269}} + 133138 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -259,6 +270,7 @@ 257 {{342, 5}, {77, 28}} + YES 67108864 @@ -285,6 +297,7 @@ 260 {{12, 5}, {125, 28}} + YES -2080374784 @@ -306,13 +319,14 @@ 268 {{9, 316}, {156, 14}} + YES 68157504 272761856 Server Variables - .LucidaGrandeUI-Bold + YES 11 3357 @@ -333,6 +347,7 @@ 265 {{251, 314}, {170, 19}} + YES 342884416 @@ -393,6 +408,7 @@ -2147483382 {{167, 316}, {79, 14}} + YES 68157504 @@ -408,6 +424,8 @@ {433, 341} + + {{0, 0}, {1440, 878}} {433, 363} @@ -462,7 +480,7 @@ NO - + window @@ -834,14 +852,110 @@ - + + + + SPServerVariablesController + NSWindowController + + id + id + id + id + id + + + + closeSheet: + id + + + copy: + id + + + copyServerVariableName: + id + + + copyServerVariableValue: + id + + + saveServerVariables: + id + + + + NSSearchField + NSButton + NSTextField + NSTableView + + + + filterVariablesSearchField + NSSearchField + + + saveVariablesButton + NSButton + + + variablesCountTextField + NSTextField + + + variablesTableView + NSTableView + + + + IBProjectSource + ../Source/SPServerVariablesController.h + + + + SPServerVariablesController + + id + id + id + id + id + + + + closeSheet: + id + + + copy: + id + + + copyServerVariableName: + id + + + copyServerVariableValue: + id + + + saveServerVariables: + id + + + + IBProjectSource + ../Source/SPServerVariablesController.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/EncodingPopupView.xib b/Interfaces/English.lproj/EncodingPopupView.xib index 3114bbc5..2d74cd25 100644 --- a/Interfaces/English.lproj/EncodingPopupView.xib +++ b/Interfaces/English.lproj/EncodingPopupView.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSCustomObject @@ -38,7 +38,7 @@ NSApplication - + 268 @@ -46,13 +46,14 @@ 268 {{6, 10}, {143, 14}} + YES 68157504 71435264 File Encoding: - .LucidaGrandeUI + YES 11 3100 @@ -84,6 +85,7 @@ 268 {{151, 5}, {180, 22}} + YES -1539309504 @@ -154,12 +156,14 @@ {348, 34} + + NSView NO - + encodingPopUp @@ -288,14 +292,35 @@ - + + + + SPEncodingPopupAccessory + NSObject + + NSView + NSPopUpButton + + + + encodingAccessoryView + NSView + + + encodingPopUp + NSPopUpButton + + + + IBProjectSource + ../Source/SPEncodingPopupAccessory.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ExportDialog.xib b/Interfaces/English.lproj/ExportDialog.xib index 09ee1ec1..3c3d6a2f 100644 --- a/Interfaces/English.lproj/ExportDialog.xib +++ b/Interfaces/English.lproj/ExportDialog.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -136,7 +136,7 @@ - .LucidaGrandeUI + YES 13 1044 @@ -215,7 +215,7 @@ 131072 Low memory export (may block server) - .LucidaGrandeUI + YES 11 3100 @@ -571,7 +571,7 @@ 4196352 Doing Stuff… - .LucidaGrandeUI-Bold + YES 13 2072 @@ -646,7 +646,7 @@ 4194304 The following export errors occurred: - .LucidaGrandeUI-Bold + YES 11 3357 @@ -689,7 +689,7 @@ 1 - 67111169 + 2305 0 @@ -3026,7 +3026,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NO - + exportProgressWindow @@ -5556,11 +5556,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id - id id id id - id @@ -5615,10 +5613,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 moveSelectionLineUp: id - - orderFrontSharingServicePicker: - id - selectCurrentLine: id @@ -5631,14 +5625,101 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 selectEnclosingBrackets: id - - toggleQuickLookPreviewPanel: + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: id IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.m @@ -5657,7 +5738,25 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m @@ -5684,11 +5783,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id - id id id id - id id @@ -5772,10 +5869,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 saveQueryHistory: id - - searchInDocForWebViewSelection: - id - showCompletionList: id @@ -5788,10 +5881,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 showHelpForSearchString: id - - showHelpForWebViewSelection: - id - switchDefaultQueryAction: id @@ -6078,126 +6167,280 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPCustomQuery.h - - - - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h + ../Source/SPCustomQuery.h - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id - - addConnectionToFavorites: + + chooseQueryFavorite: id - - addDatabase: + + chooseQueryHistory: id - - alterDatabase: + + clearQueryHistory: id - - analyzeTable: + + closeSheet: id - - backForwardInHistory: + + copyQueryHistory: id - - cancelTask: + + filterQueryFavorites: id - - checkTable: + + filterQueryHistory: id - - checksumTable: + + gearMenuItemSelected: id - - chooseDatabase: + + helpSearchFindNextInPage: id - - chooseEncoding: + + helpSearchFindPreviousInPage: id - - closePanelSheet: + + helpSegmentDispatcher: id - - closePasswordSheet: + + helpSelectHelpTargetMySQL: id - - closeSheet: + + helpSelectHelpTargetPage: id - - copyChecksumFromSheet: + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: id @@ -6288,6 +6531,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 showFilterTable: id + + showGotoDatabase: + id + showMySQLHelp: id @@ -6316,30 +6563,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -6692,47 +6915,378 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPDatabaseDocument.h - SPExportController - NSWindowController + SPDatabaseDocument - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id id + id + id + id + id id - id - id - id - id - id - id - NSButton - NSButton - NSButton - NSButton - id - - - - cancelExport: - id - - - changeExportCompressionFormat: - id - - - changeExportOutputPath: - id - - - closeSheet: - id - + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExportController + NSWindowController + + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSButton + NSButton + NSButton + id + + + + cancelExport: + id + + + changeExportCompressionFormat: + id + + + changeExportOutputPath: + id + + + closeSheet: + id + export: id @@ -7029,46 +7583,137 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 exportUseUTF8BOMButton NSButton - - exportXMLFormatPopUpButton - NSPopUpButton + + exportXMLFormatPopUpButton + NSPopUpButton + + + exportXMLIncludeContent + NSButton + + + exportXMLIncludeStructure + NSButton + + + exportXMLNULLValuesAsTextField + NSTextField + + + exporterView + NSView + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExportController.h + + + + SPExportController + + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSButton + NSButton + NSButton + id + + + + cancelExport: + id + + + changeExportCompressionFormat: + id + + + changeExportOutputPath: + id + + + closeSheet: + id + + + export: + id + + + exportCustomQueryResultAsFormat: + id + + + refreshTableList: + id + + + selectDeselectAllTables: + id + + + switchInput: + id + + + toggleAdvancedExportOptionsView: + id + + + toggleCustomFilenameFormatView: + id - - exportXMLIncludeContent + + toggleNewFilePerTable: NSButton - - exportXMLIncludeStructure + + toggleSQLIncludeContent: NSButton - - exportXMLNULLValuesAsTextField - NSTextField - - - exporterView - NSView - - - tableContentInstance - SPTableContent - - - tableDataInstance - SPTableData + + toggleSQLIncludeDropSyntax: + NSButton - - tableDocumentInstance - SPDatabaseDocument + + toggleSQLIncludeStructure: + NSButton - - tablesListInstance - SPTablesList + + toggleXMLOutputFormat: + id IBProjectSource - ./Classes/SPExportController.h + ../Source/SPExportController.m @@ -7219,7 +7864,48 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m @@ -7252,7 +7938,25 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -7418,7 +8122,53 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -7451,7 +8201,25 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -7575,6 +8343,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id NSButton + NSBox NSButton NSButton NSButton @@ -7582,6 +8351,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSStepper NSButton NSView + NSViewController id id id @@ -7706,6 +8476,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 multipleLineEditingButton NSButton + + paginationBox + NSBox + paginationButton NSButton @@ -7714,70 +8488,170 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 paginationGoButton NSButton - - paginationNextButton - NSButton + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id - - paginationPageField - NSTextField + + duplicateRow: + id - - paginationPageStepper - NSStepper + + filterTable: + id - - paginationPreviousButton - NSButton + + navigatePaginationFromButton: + id - - paginationView - NSView + + reloadTable: + id - - reloadButton + + removeRow: id - - removeButton + + setCompareTypes: id - - secondBetweenField + + setDefaultOperator: id - - spHistoryControllerInstance - SPHistoryController + + showDefaultOperaterHelp: + id - - tableContentView - SPCopyTable + + showFilterTable: + id - - tableDataInstance - SPTableData + + tableFilterClear: + id - - tableDocumentInstance - SPDatabaseDocument + + toggleDistinctSelect: + id - - tableInfoInstance - SPTableInfo + + toggleFilterField: + id - - tableSourceInstance + + toggleLookAllFieldsMode: id - - tablesListInstance + + toggleNegateClause: id + + togglePagination: + NSButton + IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.m @@ -7799,7 +8673,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -7846,7 +8720,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -7856,7 +8730,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id - id id id id @@ -7876,10 +8749,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 duplicateField: id - - reloadTable: - id - removeField: id @@ -8042,7 +8911,94 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m @@ -8050,7 +9006,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -8061,6 +9017,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id + id id id id @@ -8085,6 +9042,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 openTableInNewTab: id + + openTableInNewWindow: + id + removeTable: id @@ -8127,6 +9088,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSSearchField NSMenuItem NSMenuItem + NSMenuItem + NSMenuItem NSMenuItem NSMenuItem NSMenuItem @@ -8226,6 +9189,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 openTableInNewTabMenuItem NSMenuItem + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + removeTableContextMenuItem NSMenuItem @@ -8361,7 +9332,78 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m @@ -8404,7 +9446,28 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m @@ -8412,10 +9475,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/FieldEditorSheet.xib b/Interfaces/English.lproj/FieldEditorSheet.xib index f88bcc27..4772a1bc 100644 --- a/Interfaces/English.lproj/FieldEditorSheet.xib +++ b/Interfaces/English.lproj/FieldEditorSheet.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -60,7 +60,7 @@ - + 4370 @@ -69,6 +69,7 @@ {{0, 48}, {667, 5}} + {250, 750} {0, 0} @@ -76,7 +77,7 @@ 134217728 Box - .LucidaGrandeUI + YES 13 1044 @@ -104,6 +105,7 @@ 257 {{581, 13}, {66, 25}} + {250, 750} 1 YES @@ -112,7 +114,7 @@ 134348800 OK - .LucidaGrandeUI + YES 11 3100 @@ -137,6 +139,7 @@ -2147483391 {{581, 13}, {66, 25}} + {250, 750} 1 YES @@ -162,6 +165,7 @@ 257 {{498, 13}, {75, 25}} + {250, 750} YES @@ -185,6 +189,7 @@ 256 {{102, 13}, {82, 25}} + {250, 750} YES @@ -208,6 +213,7 @@ 256 {{12, 13}, {82, 25}} + {250, 750} YES @@ -231,6 +237,7 @@ 292 {{401, 12}, {48, 25}} + YES 71303232 @@ -285,9 +292,10 @@ 292 {{230, 15}, {163, 19}} + YES - -2080374784 + -2071986176 131072 @@ -331,6 +339,7 @@ 2322 {667, 349} + @@ -350,7 +359,7 @@ 1 - 67111781 + 2917 0 @@ -397,6 +406,7 @@ {667, 349} + @@ -411,6 +421,7 @@ -2147483392 {{-100, -100}, {87, 18}} + NO 257 @@ -422,6 +433,7 @@ -2147483392 {{220, 1}, {11, 141}} + NO 256 @@ -430,6 +442,7 @@ {{0, 51}, {667, 349}} + 133648 @@ -452,6 +465,7 @@ {{0, 51}, {667, 349}} + YES 270532609 @@ -475,8 +489,28 @@ 2322 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + {667, 349} + @@ -496,7 +530,7 @@ 1 - 67121123 + 12259 0 @@ -521,6 +555,7 @@ {667, 349} + @@ -532,6 +567,7 @@ -2147483392 {{-100, -100}, {87, 18}} + NO 257 @@ -543,6 +579,7 @@ -2147483392 {{639, 2}, {11, 359}} + NO 256 @@ -551,6 +588,7 @@ {{0, 51}, {667, 349}} + 133648 @@ -565,6 +603,7 @@ 301 {{325, 232}, {32, 32}} + {750, 750} 28686 16 @@ -576,6 +615,7 @@ {{0, 398}, {667, 5}} + {250, 750} {0, 0} @@ -599,6 +639,7 @@ 266 {{9, 408}, {459, 14}} + YES 67108928 @@ -627,6 +668,7 @@ 265 {{470, 406}, {185, 18}} + YES 67108864 @@ -652,6 +694,8 @@ {667, 428} + + {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} @@ -685,7 +729,7 @@ 134479872 - .LucidaGrandeUI + YES 9 3614 @@ -2907,7 +2951,7 @@ NO - + bitSheet @@ -7345,14 +7389,858 @@ - + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPEditSheetTextView + NSTextView + + IBProjectSource + ../Source/SPEditSheetTextView.h + + + + SPEditSheetTextView + + id + id + id + id + + + + cut: + id + + + paste: + id + + + redo: + id + + + undo: + id + + + + IBProjectSource + ../Source/SPEditSheetTextView.m + + + + SPFieldEditorController + NSWindowController + + id + id + id + id + id + id + id + id + id + id + + + + bitSheetBitButtonWasClicked: + id + + + bitSheetOperatorButtonWasClicked: + id + + + bitSheetSelectBit0: + id + + + closeEditSheet: + id + + + dropImage: + id + + + openEditSheet: + id + + + quickLookFormatButton: + id + + + saveEditSheet: + id + + + segmentControllerChanged: + id + + + setToNull: + id + + + + id + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSButton + NSTextField + NSTextField + NSTextField + NSButton + NSTextField + NSButton + id + SPWindow + id + id + id + id + id + id + id + id + id + id + id + id + + + + bitSheet + id + + + bitSheetBitButton0 + NSButton + + + bitSheetBitButton1 + NSButton + + + bitSheetBitButton10 + NSButton + + + bitSheetBitButton11 + NSButton + + + bitSheetBitButton12 + NSButton + + + bitSheetBitButton13 + NSButton + + + bitSheetBitButton14 + NSButton + + + bitSheetBitButton15 + NSButton + + + bitSheetBitButton16 + NSButton + + + bitSheetBitButton17 + NSButton + + + bitSheetBitButton18 + NSButton + + + bitSheetBitButton19 + NSButton + + + bitSheetBitButton2 + NSButton + + + bitSheetBitButton20 + NSButton + + + bitSheetBitButton21 + NSButton + + + bitSheetBitButton22 + NSButton + + + bitSheetBitButton23 + NSButton + + + bitSheetBitButton24 + NSButton + + + bitSheetBitButton25 + NSButton + + + bitSheetBitButton26 + NSButton + + + bitSheetBitButton27 + NSButton + + + bitSheetBitButton28 + NSButton + + + bitSheetBitButton29 + NSButton + + + bitSheetBitButton3 + NSButton + + + bitSheetBitButton30 + NSButton + + + bitSheetBitButton31 + NSButton + + + bitSheetBitButton32 + NSButton + + + bitSheetBitButton33 + NSButton + + + bitSheetBitButton34 + NSButton + + + bitSheetBitButton35 + NSButton + + + bitSheetBitButton36 + NSButton + + + bitSheetBitButton37 + NSButton + + + bitSheetBitButton38 + NSButton + + + bitSheetBitButton39 + NSButton + + + bitSheetBitButton4 + NSButton + + + bitSheetBitButton40 + NSButton + + + bitSheetBitButton41 + NSButton + + + bitSheetBitButton42 + NSButton + + + bitSheetBitButton43 + NSButton + + + bitSheetBitButton44 + NSButton + + + bitSheetBitButton45 + NSButton + + + bitSheetBitButton46 + NSButton + + + bitSheetBitButton47 + NSButton + + + bitSheetBitButton48 + NSButton + + + bitSheetBitButton49 + NSButton + + + bitSheetBitButton5 + NSButton + + + bitSheetBitButton50 + NSButton + + + bitSheetBitButton51 + NSButton + + + bitSheetBitButton52 + NSButton + + + bitSheetBitButton53 + NSButton + + + bitSheetBitButton54 + NSButton + + + bitSheetBitButton55 + NSButton + + + bitSheetBitButton56 + NSButton + + + bitSheetBitButton57 + NSButton + + + bitSheetBitButton58 + NSButton + + + bitSheetBitButton59 + NSButton + + + bitSheetBitButton6 + NSButton + + + bitSheetBitButton60 + NSButton + + + bitSheetBitButton61 + NSButton + + + bitSheetBitButton62 + NSButton + + + bitSheetBitButton63 + NSButton + + + bitSheetBitButton7 + NSButton + + + bitSheetBitButton8 + NSButton + + + bitSheetBitButton9 + NSButton + + + bitSheetBitLabel0 + NSTextField + + + bitSheetBitLabel16 + NSTextField + + + bitSheetBitLabel24 + NSTextField + + + bitSheetBitLabel32 + NSTextField + + + bitSheetBitLabel40 + NSTextField + + + bitSheetBitLabel48 + NSTextField + + + bitSheetBitLabel56 + NSTextField + + + bitSheetBitLabel8 + NSTextField + + + bitSheetCloseButton + NSButton + + + bitSheetFieldName + NSTextField + + + bitSheetHexTextField + NSTextField + + + bitSheetIntegerTextField + NSTextField + + + bitSheetNULLButton + NSButton + + + bitSheetOctalTextField + NSTextField + + + bitSheetOkButton + NSButton + + + editImage + id + + + editSheet + SPWindow + + + editSheetCancelButton + id + + + editSheetFieldName + id + + + editSheetIsNotEditableCancelButton + id + + + editSheetOkButton + id + + + editSheetOpenButton + id + + + editSheetProgressBar + id + + + editSheetQuickLookButton + id + + + editSheetSegmentControl + id + + + editTextScrollView + id + + + editTextView + id + + + hexTextScrollView + id + + + hexTextView + id + + + + IBProjectSource + ../Source/SPFieldEditorController.h + + + + SPFieldEditorController + + id + id + id + id + id + id + id + id + id + id + + + + bitSheetBitButtonWasClicked: + id + + + bitSheetOperatorButtonWasClicked: + id + + + bitSheetSelectBit0: + id + + + closeEditSheet: + id + + + dropImage: + id + + + openEditSheet: + id + + + quickLookFormatButton: + id + + + saveEditSheet: + id + + + segmentControllerChanged: + id + + + setToNull: + id + + + + IBProjectSource + ../Source/SPFieldEditorController.m + + + + SPImageView + NSImageView + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ../Source/SPImageView.h + + + + SPWindow + NSWindow + + IBProjectSource + ../Source/SPWindow.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/GotoDatabaseDialog.xib b/Interfaces/English.lproj/GotoDatabaseDialog.xib index 89fe61e9..590ed579 100644 --- a/Interfaces/English.lproj/GotoDatabaseDialog.xib +++ b/Interfaces/English.lproj/GotoDatabaseDialog.xib @@ -2,13 +2,13 @@ 1060 - 13D65 - 5056 - 1265.20 + 13F34 + 6254 + 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSButton @@ -68,7 +68,7 @@ 134217728 OK - .LucidaGrandeUI + YES 13 1044 @@ -160,6 +160,7 @@ -2147483648 0 + clear cancel @@ -212,7 +213,7 @@ 2048 Database - .LucidaGrandeUI + YES 11 3100 @@ -343,7 +344,7 @@ NO - + cancelButton @@ -614,25 +615,6 @@ SPGotoDatabaseController NSWindowController - - id - id - id - - - - cancelClicked: - id - - - okClicked: - id - - - searchChanged: - id - - NSButton NSTableView @@ -659,7 +641,33 @@ IBProjectSource - ./Classes/SPGotoDatabaseController.h + ../Source/SPGotoDatabaseController.h + + + + SPGotoDatabaseController + + id + id + id + + + + cancelClicked: + id + + + okClicked: + id + + + searchChanged: + id + + + + IBProjectSource + ../Source/SPGotoDatabaseController.m @@ -667,10 +675,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ImportAccessory.xib b/Interfaces/English.lproj/ImportAccessory.xib index 7f3ccac0..2ddd8d6b 100644 --- a/Interfaces/English.lproj/ImportAccessory.xib +++ b/Interfaces/English.lproj/ImportAccessory.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -51,7 +51,7 @@ NSApplication - + 274 @@ -59,6 +59,7 @@ 266 {{-7, -9}, {464, 96}} + 1 @@ -71,6 +72,7 @@ 264 {{28, 47}, {411, 18}} + YES @@ -78,7 +80,7 @@ 131072 First line contains field names - .LucidaGrandeUI + YES 11 3100 @@ -100,6 +102,7 @@ 268 {{175, -5}, {54, 22}} + YES @@ -222,6 +225,7 @@ 268 {{8, 0}, {162, 14}} + YES @@ -246,6 +250,7 @@ 265 {{386, 20}, {54, 22}} + YES @@ -333,6 +338,7 @@ 265 {{238, 25}, {143, 14}} + YES @@ -352,6 +358,7 @@ 265 {{386, -5}, {54, 22}} + YES @@ -439,6 +446,7 @@ 265 {{238, 0}, {143, 14}} + YES @@ -458,6 +466,7 @@ 268 {{175, 20}, {54, 22}} + YES @@ -546,6 +555,7 @@ 268 {{8, 25}, {162, 14}} + YES @@ -563,6 +573,7 @@ {{10, 7}, {444, 70}} + CSV @@ -586,7 +597,7 @@ 71304192 On SQL Error: - .LucidaGrandeUI + YES 13 1044 @@ -669,7 +680,7 @@ - .LucidaGrandeUI + YES 9 3614 @@ -684,6 +695,7 @@ 264 {{208, 85}, {206, 26}} + YES -2076180416 @@ -727,6 +739,7 @@ 264 {{36, 91}, {170, 17}} + YES @@ -746,6 +759,7 @@ 264 {{208, 113}, {206, 26}} + YES @@ -801,6 +815,7 @@ 264 {{36, 119}, {170, 17}} + YES @@ -817,6 +832,8 @@ {450, 144} + + NSView @@ -872,7 +889,7 @@ 1 - 67111169 + 2305 0 @@ -1083,7 +1100,7 @@ NO - + importFieldsEscapedField @@ -1839,14 +1856,427 @@ - + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPDataImport + NSObject + + id + id + id + + + + cancelProgressBar: + id + + + changeFormat: + id + + + closeSheet: + id + + + + id + id + id + id + id + id + id + id + NSPopUpButton + id + NSButton + id + id + id + NSPopUpButton + id + id + NSTextView + id + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addCreateTableSwitch + id + + + addDropTableSwitch + id + + + addErrorsSwitch + id + + + addTableContentSwitch + id + + + csvFullStreamingSwitch + id + + + customQueryInstance + id + + + errorsSheet + id + + + errorsView + id + + + importEncodingPopup + NSPopUpButton + + + importFieldMapperSheetWindow + id + + + importFieldNamesSwitch + NSButton + + + importFieldsEnclosedField + id + + + importFieldsEscapedField + id + + + importFieldsTerminatedField + id + + + importFormatPopup + NSPopUpButton + + + importFromClipboardAccessoryView + id + + + importFromClipboardSheet + id + + + importFromClipboardTextView + NSTextView + + + importLinesTerminatedField + id + + + importSQLErrorHandlingPopup + NSPopUpButton + + + importTabView + id + + + importView + id + + + multiCSVFullStreamingSwitch + id + + + multiXMLFullStreamingSwitch + id + + + singleProgressBar + id + + + singleProgressSheet + id + + + singleProgressText + id + + + singleProgressTitle + id + + + sqlCompressionSwitch + id + + + sqlFullStreamingSwitch + id + + + tableContentInstance + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPDataImport.h + + + + SPDataImport + + id + id + id + + + + cancelProgressBar: + id + + + changeFormat: + id + + + closeSheet: + id + + + + IBProjectSource + ../Source/SPDataImport.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/IndexesView.xib b/Interfaces/English.lproj/IndexesView.xib index 264e8e4f..38edda7f 100644 --- a/Interfaces/English.lproj/IndexesView.xib +++ b/Interfaces/English.lproj/IndexesView.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -78,7 +78,7 @@ -2076180416 132096 - .LucidaGrandeUI + YES 11 3100 @@ -264,10 +264,12 @@ - - + + -2147483392 {{224, 0}, {16, 17}} + + @@ -306,7 +308,7 @@ 274 - {13, 0} + {15, 0} YES @@ -314,7 +316,7 @@ YES - 10 + 12 10 1000 @@ -365,7 +367,7 @@ 16 tableViewAction: - -765427712 + -767524864 1 @@ -478,6 +480,20 @@ 4 + + + 2338 + + + + {{1, 0}, {330, 17}} + + + + + + 4 + -2147483392 @@ -501,20 +517,7 @@ _doScroller: 0.99557524919509888 - - - 2338 - - - - {{1, 0}, {330, 17}} - - - - - - 4 - + {{-1, 97}, {332, 98}} @@ -525,6 +528,7 @@ + QSAAAEEgAABBgAAAQYAAAA 0.25 4 @@ -632,7 +636,7 @@ - .LucidaGrandeUI + YES 13 1044 @@ -1032,7 +1036,7 @@ NO - + window @@ -1949,7 +1953,98 @@ IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m @@ -1968,7 +2063,25 @@ IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m @@ -2379,111 +2492,265 @@ IBProjectSource - ./Classes/SPCustomQuery.h + ../Source/SPCustomQuery.h - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h - - - - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id - - addConnectionToFavorites: + + chooseQueryFavorite: id - - addDatabase: + + chooseQueryHistory: id - - alterDatabase: + + clearQueryHistory: id - - analyzeTable: + + closeSheet: id - - backForwardInHistory: + + copyQueryHistory: id - - cancelTask: + + filterQueryFavorites: id - - checkTable: + + filterQueryHistory: id - - checksumTable: + + gearMenuItemSelected: id - - chooseDatabase: + + helpSearchFindNextInPage: id - - chooseEncoding: - id + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id closePanelSheet: @@ -2589,6 +2856,10 @@ showFilterTable: id + + showGotoDatabase: + id + showMySQLHelp: id @@ -2617,30 +2888,6 @@ validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -2970,30 +3217,361 @@ taskDescriptionText id - - taskProgressIndicator + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: id - - taskProgressLayer - NSBox + + viewRelations: + id - - titleAccessoryView + + viewStatus: id - - titleImageView + + viewStructure: id - - titleStringView + + viewTriggers: id IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m @@ -3144,7 +3722,48 @@ IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m @@ -3177,7 +3796,25 @@ IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -3343,7 +3980,53 @@ IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -3376,7 +4059,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -3500,6 +4201,7 @@ id id NSButton + NSBox NSButton NSButton NSButton @@ -3507,6 +4209,7 @@ NSStepper NSButton NSView + NSViewController id id id @@ -3631,6 +4334,10 @@ multipleLineEditingButton NSButton + + paginationBox + NSBox + paginationButton NSButton @@ -3639,70 +4346,170 @@ paginationGoButton NSButton - - paginationNextButton - NSButton + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id - - paginationPageField - NSTextField + + duplicateRow: + id - - paginationPageStepper - NSStepper + + filterTable: + id - - paginationPreviousButton - NSButton + + navigatePaginationFromButton: + id - - paginationView - NSView + + reloadTable: + id - - reloadButton + + removeRow: id - - removeButton + + setCompareTypes: id - - secondBetweenField + + setDefaultOperator: id - - spHistoryControllerInstance - SPHistoryController + + showDefaultOperaterHelp: + id - - tableContentView - SPCopyTable + + showFilterTable: + id - - tableDataInstance - SPTableData + + tableFilterClear: + id - - tableDocumentInstance - SPDatabaseDocument + + toggleDistinctSelect: + id - - tableInfoInstance - SPTableInfo + + toggleFilterField: + id - - tableSourceInstance + + toggleLookAllFieldsMode: id - - tablesListInstance + + toggleNegateClause: id + + togglePagination: + NSButton + IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.m @@ -3724,7 +4531,7 @@ IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -3771,7 +4578,7 @@ IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -3781,7 +4588,6 @@ id id id - id id id id @@ -3801,10 +4607,6 @@ duplicateField: id - - reloadTable: - id - removeField: id @@ -3967,7 +4769,94 @@ IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m @@ -3975,7 +4864,7 @@ NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -3986,6 +4875,7 @@ id id id + id id id id @@ -4010,6 +4900,10 @@ openTableInNewTab: id + + openTableInNewWindow: + id + removeTable: id @@ -4052,6 +4946,8 @@ NSSearchField NSMenuItem NSMenuItem + NSMenuItem + NSMenuItem NSMenuItem NSMenuItem NSMenuItem @@ -4151,6 +5047,14 @@ openTableInNewTabMenuItem NSMenuItem + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + removeTableContextMenuItem NSMenuItem @@ -4286,7 +5190,78 @@ IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m @@ -4329,25 +5304,28 @@ IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h - WebView - - reloadFromOrigin: - id - - - reloadFromOrigin: - - reloadFromOrigin: + SPTextView + + id + id + + + + printDocument: id - + + showMySQLHelpForCurrentWord: + id + + IBProjectSource - ./Classes/WebView.h + ../Source/SPTextView.m @@ -4355,10 +5333,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index a8639839..f7f90893 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -2,13 +2,13 @@ 1060 - 13E28 - 5056 + 13F34 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSCustomObject @@ -2152,7 +2152,7 @@ NO - + delegate @@ -5500,7 +5500,98 @@ IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m @@ -5527,7 +5618,7 @@ IBProjectSource - ./Classes/PSMTabBarControl.h + ../Frameworks/PSMTabBar/PSMTabBarControl.h @@ -5536,10 +5627,7 @@ id id - id id - id - id id id id @@ -5561,22 +5649,10 @@ donate: id - - duplicateTab: - id - executeBundleItemForApp: id - - newTab: - id - - - newWindow: - id - openAboutPanel: id @@ -5635,144 +5711,279 @@ IBProjectSource - ./Classes/SPAppController.h - - - - SPBundleCommandTextView - NSTextView - - id - id - id - id - - - - cut: - id - - - paste: - id - - - redo: - id - - - undo: - id - - - - commandScrollView - NSScrollView - - - commandScrollView - - commandScrollView - NSScrollView - - - - IBProjectSource - ./Classes/SPBundleCommandTextView.h + ../Source/SPAppController.h - SPBundleEditorController - NSWindowController + SPAppController - id - id - id - id - id - id - id - id - id + id + id + id + id + id + id + id + id + id id - id - id - id - id - id - id - id - id - id - id + id + id + id + id - - addCommandBundle: + + bundleCommandDispatcher: id - - closeSheet: + + donate: id - - closeUndeleteDefaultBundlesSheet: + + executeBundleItemForApp: id - - displayBundleMetaInfo: + + openAboutPanel: id - - duplicateCommandBundle: + + openBundleEditor: id - - inputFallbackPopupButtonChanged: + + openConnectionSheet: id - - inputPopupButtonChanged: + + openPreferences: id - - outputPopupButtonChanged: + + provideFeedback: id - - performClose: + + provideTranslationFeedback: id reloadBundles: id - - removeCommandBundle: + + viewKeyboardShortcuts: id - - revealCommandBundleInFinder: + + visitFAQWebsite: id - - saveAndCloseWindow: + + visitHelpWebsite: id - - saveBundle: + + visitWebsite: id - - scopeButtonChanged: + + + IBProjectSource + ../Source/SPAppController.m + + + + SPAppController + + id + id + id + + + + duplicateTab: id - - showHelp: + + newTab: id - - showWindow: + + newWindow: + id + + + + IBProjectSource + ../Source/SPWindowManagement.h + + + + SPAppController + + id + id + id + + + + duplicateTab: + id + + + newTab: + id + + + newWindow: + id + + + + IBProjectSource + ../Source/SPWindowManagement.m + + + + SPBundleCommandTextView + NSTextView + + commandScrollView + NSScrollView + + + commandScrollView + + commandScrollView + NSScrollView + + + + IBProjectSource + ../Source/SPBundleCommandTextView.h + + + + SPBundleCommandTextView + + id + id + id + id + + + + cut: + id + + + paste: + id + + + redo: + id + + + undo: + id + + + + IBProjectSource + ../Source/SPBundleCommandTextView.m + + + + SPBundleEditorController + NSWindowController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addCommandBundle: + id + + + closeSheet: + id + + + closeUndeleteDefaultBundlesSheet: + id + + + displayBundleMetaInfo: + id + + + duplicateCommandBundle: + id + + + inputFallbackPopupButtonChanged: + id + + + inputPopupButtonChanged: + id + + + outputPopupButtonChanged: + id + + + performClose: + id + + + reloadBundles: + id + + + removeCommandBundle: + id + + + revealCommandBundleInFinder: + id + + + saveAndCloseWindow: + id + + + saveBundle: + id + + + scopeButtonChanged: + id + + + showHelp: id @@ -5964,72 +6175,201 @@ IBProjectSource - ./Classes/SPBundleEditorController.h + ../Source/SPBundleEditorController.h - SPBundleHTMLOutputController - NSWindowController - - printDocument: - id - - - printDocument: - - printDocument: + SPBundleEditorController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addCommandBundle: id - - - webView - WebView - - - webView - - webView - WebView + + closeSheet: + id - - - IBProjectSource - ./Classes/SPBundleHTMLOutputController.h - - - - SPColorSelectorView - NSView - - delegate - id - - - delegate - - delegate + + closeUndeleteDefaultBundlesSheet: id - - - IBProjectSource - ./Classes/SPColorSelectorView.h - - - - SPConnectionController - NSViewController - - id - id - id - id - NSButton - id - id - id - id - id + + displayBundleMetaInfo: + id + + + duplicateCommandBundle: + id + + + inputFallbackPopupButtonChanged: + id + + + inputPopupButtonChanged: + id + + + outputPopupButtonChanged: + id + + + performClose: + id + + + reloadBundles: + id + + + removeCommandBundle: + id + + + revealCommandBundleInFinder: + id + + + saveAndCloseWindow: + id + + + saveBundle: + id + + + scopeButtonChanged: + id + + + showHelp: + id + + + showWindow: + id + + + triggerButtonChanged: + id + + + undeleteDefaultBundles: + id + + + withBlobButtonChanged: + id + + + + IBProjectSource + ../Source/SPBundleEditorController.m + + + + SPBundleHTMLOutputController + NSWindowController + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + webView + WebView + + + webView + + webView + WebView + + + + IBProjectSource + ../Source/SPBundleHTMLOutputController.h + + + + SPBundleHTMLOutputController + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPBundleHTMLOutputController.m + + + + SPColorSelectorView + NSView + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + ../Source/SPColorSelectorView.h + + + + SPConnectionController + NSViewController + + id + id + id + id + id + id + id + id + id + id id id id @@ -6059,7 +6399,7 @@ chooseKeyLocation: - NSButton + id duplicateFavorite: @@ -6384,94 +6724,206 @@ IBProjectSource - ./Classes/SPConnectionController.h - - - - SPCopyTable - SPTableView - - executeBundleItemForDataTable: - id - - - executeBundleItemForDataTable: - - executeBundleItemForDataTable: - id - - - - IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPConnectionController.h - SPCustomQuery - NSObject + SPConnectionController - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id + id + NSButton + id + id + id + id + id + id + id + id + id + id + id + id - - chooseQueryFavorite: + + addFavorite: id - - chooseQueryHistory: + + addFavoriteUsingCurrentDetails: id - - clearQueryHistory: + + addGroup: id - - closeSheet: + + cancelConnection: id - - copyQueryHistory: + + chooseKeyLocation: + NSButton + + + duplicateFavorite: id - - filterQueryFavorites: + + exportFavorites: id - - filterQueryHistory: + + importFavorites: id - - gearMenuItemSelected: + + initiateConnection: id - - helpSearchFindNextInPage: + + makeSelectedFavoriteDefault: + id + + + nodeDoubleClicked: + id + + + removeNode: + id + + + renameNode: + id + + + saveFavorite: + id + + + showHelp: + id + + + updateKeyLocationFileVisibility: + id + + + updateSSLInterface: + id + + + + IBProjectSource + ../Source/SPConnectionController.m + + + + SPCopyTable + SPTableView + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m + + + + SPCustomQuery + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: id @@ -6518,10 +6970,6 @@ saveQueryHistory: id - - searchInDocForWebViewSelection: - id - showCompletionList: id @@ -6534,10 +6982,6 @@ showHelpForSearchString: id - - showHelpForWebViewSelection: - id - switchDefaultQueryAction: id @@ -6824,104 +7268,255 @@ IBProjectSource - ./Classes/SPCustomQuery.h - - - - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h + ../Source/SPCustomQuery.h - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id - - addConnectionToFavorites: + + chooseQueryFavorite: id - - addDatabase: + + chooseQueryHistory: id - - alterDatabase: + + clearQueryHistory: id - - analyzeTable: + + closeSheet: id - - backForwardInHistory: + + copyQueryHistory: id - - cancelTask: + + filterQueryFavorites: id - - checkTable: + + filterQueryHistory: id - + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + checksumTable: id @@ -6933,10 +7528,6 @@ chooseEncoding: id - - closeErrorConnectionSheet: - id - closePanelSheet: id @@ -7005,10 +7596,6 @@ optimizeTable: id - - printDocument: - id - refreshTables: id @@ -7077,30 +7664,6 @@ validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -7366,99 +7929,437 @@ saveConnectionSavePasswordAlert id - - spHistoryControllerInstance + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDumpInstance + id + + + tableInfoScrollView + NSScrollView + + + tableInfoTable + NSTableView + + + tableRelationsInstance + id + + + tableSourceInstance + SPTableStructure + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: id - - statusTableAccessoryView + + viewRelations: id - - statusTableCopyChecksum + + viewStatus: id - - statusTableView + + viewStructure: id - - tableContentInstance - SPTableContent - - - tableDataInstance - SPTableData - - - tableDumpInstance + + viewTriggers: id - - tableInfoScrollView - NSScrollView - - - tableInfoTable - NSTableView - - - tableRelationsInstance + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: id - - tableSourceInstance - SPTableStructure - - - tableTabView - NSTabView - - - tableTriggersInstance + + viewQuery: id - - tablesListInstance - SPTablesList - - - taskCancelButton - NSButton - - - taskDescriptionText + + viewRelations: id - - taskProgressIndicator + + viewStatus: id - - taskProgressLayer - NSBox - - - titleAccessoryView + + viewStructure: id - - titleImageView + + viewTriggers: id - - titleStringView + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: id - + IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPPrintController.m SPEditSheetTextView NSTextView + + IBProjectSource + ../Source/SPEditSheetTextView.h + + + + SPEditSheetTextView id id @@ -7485,7 +8386,7 @@ IBProjectSource - ./Classes/SPEditSheetTextView.h + ../Source/SPEditSheetTextView.m @@ -7861,7 +8762,98 @@ IBProjectSource - ./Classes/SPExportController.h + ../Source/SPExportController.h + + + + SPExportController + + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSButton + NSButton + NSButton + id + + + + cancelExport: + id + + + changeExportCompressionFormat: + id + + + changeExportOutputPath: + id + + + closeSheet: + id + + + export: + id + + + exportCustomQueryResultAsFormat: + id + + + refreshTableList: + id + + + selectDeselectAllTables: + id + + + switchInput: + id + + + toggleAdvancedExportOptionsView: + id + + + toggleCustomFilenameFormatView: + id + + + toggleNewFilePerTable: + NSButton + + + toggleSQLIncludeContent: + NSButton + + + toggleSQLIncludeDropSyntax: + NSButton + + + toggleSQLIncludeStructure: + NSButton + + + toggleXMLOutputFormat: + id + + + + IBProjectSource + ../Source/SPExportController.m @@ -7997,22 +8989,63 @@ tableSourceInstance id - - tableTypePopUpButton - NSPopUpButton + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id - - tableUpdatedAt - NSTextField + + updateTableEncoding: + id - - tablesListInstance - SPTablesList + + updateTableType: + id IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.m @@ -8020,7 +9053,7 @@ NSOutlineView IBProjectSource - ./Classes/SPFavoritesOutlineView.h + ../Source/SPFavoritesOutlineView.h @@ -8053,7 +9086,25 @@ IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -8219,7 +9270,53 @@ IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -8227,7 +9324,7 @@ NSOutlineView IBProjectSource - ./Classes/SPOutlineView.h + ../Source/SPOutlineView.h @@ -8353,7 +9450,73 @@ IBProjectSource - ./Classes/SPProcessListController.h + ../Source/SPProcessListController.h + + + + SPProcessListController + + id + id + id + id + id + id + id + id + NSMenuItem + NSButton + NSMenuItem + + + + closeSheet: + id + + + copy: + id + + + killProcessConnection: + id + + + killProcessQuery: + id + + + refreshProcessList: + id + + + saveServerProcesses: + id + + + setAutoRefreshInterval: + id + + + setCustomAutoRefreshInterval: + id + + + toggeleShowFullProcessList: + NSMenuItem + + + toggleProcessListAutoRefresh: + NSButton + + + toggleShowProcessID: + NSMenuItem + + + + IBProjectSource + ../Source/SPProcessListController.m @@ -8459,7 +9622,53 @@ IBProjectSource - ./Classes/SPQueryController.h + ../Source/SPQueryController.h + + + + SPQueryController + + id + id + id + id + id + id + id + + + + clearConsole: + id + + + saveConsoleAs: + id + + + toggleShowConnections: + id + + + toggleShowDatabases: + id + + + toggleShowHelpStatements: + id + + + toggleShowSelectShowStatements: + id + + + toggleShowTimeStamps: + id + + + + IBProjectSource + ../Source/SPQueryController.m @@ -8547,30 +9756,96 @@ favoriteQueryTextView SPTextView - - favoriteTabTriggerTextField - NSTextField + + favoriteTabTriggerTextField + NSTextField + + + favoritesArrayController + NSArrayController + + + favoritesSplitView + SPSplitView + + + favoritesTableView + NSTableView + + + removeButton + NSButton + + + + IBProjectSource + ../Source/SPQueryFavoriteManager.h + + + + SPQueryFavoriteManager + + id + id + id + id + id + id + id + id + id + id + id + + + + addQueryFavorite: + id + + + closeQueryManagerSheet: + id + + + duplicateQueryFavorite: + id + + + exportFavorites: + id + + + importFavoritesByAdding: + id + + + importFavoritesByReplacing: + id + + + insertPlaceholder: + id - - favoritesArrayController - NSArrayController + + removeAllQueryFavorites: + id - - favoritesSplitView - SPSplitView + + removeQueryFavorite: + id - - favoritesTableView - NSTableView + + saveFavoriteToFile: + id - - removeButton - NSButton + + showHelp: + id IBProjectSource - ./Classes/SPQueryFavoriteManager.h + ../Source/SPQueryFavoriteManager.m @@ -8631,7 +9906,43 @@ IBProjectSource - ./Classes/SPServerVariablesController.h + ../Source/SPServerVariablesController.h + + + + SPServerVariablesController + + id + id + id + id + id + + + + closeSheet: + id + + + copy: + id + + + copyServerVariableName: + id + + + copyServerVariableValue: + id + + + saveServerVariables: + id + + + + IBProjectSource + ../Source/SPServerVariablesController.m @@ -8664,7 +9975,25 @@ IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -8788,6 +10117,7 @@ id id NSButton + NSBox NSButton NSButton NSButton @@ -8795,6 +10125,7 @@ NSStepper NSButton NSView + NSViewController id id id @@ -8919,6 +10250,10 @@ multipleLineEditingButton NSButton + + paginationBox + NSBox + paginationButton NSButton @@ -8947,6 +10282,10 @@ paginationView NSView + + paginationViewController + NSViewController + reloadButton id @@ -8990,7 +10329,103 @@ IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + IBProjectSource + ../Source/SPTableContent.m @@ -9012,7 +10447,7 @@ IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -9059,7 +10494,7 @@ IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -9069,7 +10504,6 @@ id id id - id id id id @@ -9089,10 +10523,6 @@ duplicateField: id - - reloadTable: - id - removeField: id @@ -9204,58 +10634,145 @@ removeFieldButton id - - removeIndexButton + + removeIndexButton + id + + + resetAutoIncrementLine + id + + + resetAutoIncrementSheet + id + + + resetAutoIncrementValue + id + + + structureGrabber + id + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceView + SPTableView + + + tablesIndexesSplitView + NSSplitView + + + tablesListInstance + SPTablesList + + + viewColumnsMenu + id + + + + IBProjectSource + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: id - - resetAutoIncrementLine + + duplicateField: id - - resetAutoIncrementSheet + + removeField: id - - resetAutoIncrementValue + + resetAutoIncrement: id - - structureGrabber + + showOptimizedFieldType: id - - tableDataInstance - SPTableData - - - tableDocumentInstance - SPDatabaseDocument - - - tableInfoInstance - SPTableInfo - - - tableSourceView - SPTableView + + toggleColumnView: + NSMenuItem - - tablesIndexesSplitView - NSSplitView + + unhideIndexesView: + id - - tablesListInstance - SPTablesList + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id - - viewColumnsMenu + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: id - + IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructureLoading.m @@ -9263,7 +10780,7 @@ NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -9274,9 +10791,9 @@ id id id + id id id - id id id id @@ -9299,6 +10816,10 @@ openTableInNewTab: id + + openTableInNewWindow: + id + removeTable: id @@ -9307,10 +10828,6 @@ renameTable: id - - tableEncodingButtonChanged: - id - togglePaneCollapse: id @@ -9345,6 +10862,8 @@ NSSearchField NSMenuItem NSMenuItem + NSMenuItem + NSMenuItem NSMenuItem NSMenuItem NSMenuItem @@ -9444,6 +10963,14 @@ openTableInNewTabMenuItem NSMenuItem + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + removeTableContextMenuItem NSMenuItem @@ -9579,26 +11106,94 @@ IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h - SPTextView - NSTextView + SPTablesList - id - id + id + id + id + id + id + id + id + id + id + id + id + id - - printDocument: + + addTable: id - - showMySQLHelpForCurrentWord: + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: id + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + SPCustomQuery NSScrollView @@ -9625,7 +11220,28 @@ IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m @@ -9681,7 +11297,77 @@ IBProjectSource - ./Classes/SPWindowController.h + ../Source/SPWindowController.h + + + + SPWindowController + + id + id + id + id + id + id + + + + addNewConnection: + id + + + closeTab: + id + + + moveSelectedTabInNewWindow: + id + + + selectNextDocumentTab: + id + + + selectPreviousDocumentTab: + id + + + toggleTabBarShown: + id + + + + IBProjectSource + ../Source/SPWindowController.m + + + + + + PSMTabBarControl + NSControl + + id + id + NSTabView + + + + delegate + id + + + partnerView + id + + + tabView + NSTabView + + + + IBFrameworkSource + PSMTabBar.framework/Headers/PSMTabBarControl.h @@ -9699,8 +11385,8 @@ - IBProjectSource - ./Classes/SRRecorderControl.h + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderControl.h @@ -9729,8 +11415,8 @@ - IBProjectSource - ./Classes/SUUpdater.h + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h @@ -9738,10 +11424,6 @@ 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/MainWindow.xib b/Interfaces/English.lproj/MainWindow.xib index a111273c..89dce7c2 100644 --- a/Interfaces/English.lproj/MainWindow.xib +++ b/Interfaces/English.lproj/MainWindow.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSCustomObject @@ -45,7 +45,7 @@ {705, 400} - + 256 @@ -53,6 +53,7 @@ 266 {{0, 533}, {948, 22}} + PSMTabBarControl @@ -60,9 +61,10 @@ 274 {948, 533} + - .LucidaGrandeUI + YES 13 1044 @@ -71,6 +73,8 @@ {948, 555} + + {{0, 0}, {1440, 878}} {705, 422} @@ -80,7 +84,7 @@ NO - + tabBar @@ -210,14 +214,174 @@ - + + + + PSMTabBarControl + NSControl + + id + id + NSTabView + + + + delegate + id + + + partnerView + id + + + tabView + NSTabView + + + + IBProjectSource + ../Frameworks/PSMTabBar/PSMTabBarControl.h + + + + SPWindow + NSWindow + + IBProjectSource + ../Source/SPWindow.h + + + + SPWindowController + NSWindowController + + id + id + id + id + id + id + + + + addNewConnection: + id + + + closeTab: + id + + + moveSelectedTabInNewWindow: + id + + + selectNextDocumentTab: + id + + + selectPreviousDocumentTab: + id + + + toggleTabBarShown: + id + + + + PSMTabBarControl + NSTabView + + + + tabBar + PSMTabBarControl + + + tabView + NSTabView + + + + IBProjectSource + ../Source/SPWindowController.h + + + + SPWindowController + + id + id + id + id + id + id + + + + addNewConnection: + id + + + closeTab: + id + + + moveSelectedTabInNewWindow: + id + + + selectNextDocumentTab: + id + + + selectPreviousDocumentTab: + id + + + toggleTabBarShown: + id + + + + IBProjectSource + ../Source/SPWindowController.m + + + + + + PSMTabBarControl + NSControl + + id + id + NSTabView + + + + delegate + id + + + partnerView + id + + + tabView + NSTabView + + + + IBFrameworkSource + PSMTabBar.framework/Headers/PSMTabBarControl.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/Navigator.xib b/Interfaces/English.lproj/Navigator.xib index 250c4621..0ae61c2c 100644 --- a/Interfaces/English.lproj/Navigator.xib +++ b/Interfaces/English.lproj/Navigator.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -55,7 +55,7 @@ {200, 200} - + 256 @@ -63,13 +63,14 @@ 268 {{149, 163}, {96, 32}} + YES 67108864 134217728 Button - .LucidaGrandeUI + YES 13 1044 @@ -88,13 +89,14 @@ 270 {{20, 336}, {174, 19}} + YES 342884416 268600320 - .LucidaGrandeUI + YES 11 3100 @@ -177,6 +179,7 @@ 256 {394, 215} + YES YES NO @@ -186,12 +189,15 @@ 256 {394, 17} + - - + + -2147483392 {{224, 0}, {16, 17}} + + @@ -307,16 +313,32 @@ {{1, 17}, {394, 215}} + 4 + + + 2338 + + + + {{1, 0}, {394, 17}} + + + + + + 4 + -2147483392 {{224, 17}, {11, 102}} + NO 256 @@ -328,34 +350,25 @@ -2147483392 {{1, 65}, {120, 11}} + NO 257 _doScroller: 0.99746835231781006 - - - 2338 - - - - {{1, 0}, {394, 17}} - - - - - 4 - + {396, 233} + 133682 + QSAAAEEgAABBYAAAQWAAAA 0.25 4 @@ -364,6 +377,7 @@ {395, 233} + YES @@ -383,6 +397,7 @@ 274 {394, 82} + YES NO YES @@ -391,12 +406,15 @@ 256 {394, 17} + - - + + -2147483392 {{224, 0}, {16, 17}} + + @@ -452,16 +470,32 @@ {{1, 17}, {394, 82}} + 4 + + + 2338 + + + + {{1, 0}, {394, 17}} + + + + + + 4 + -2147483392 {{224, 17}, {11, 102}} + NO 256 @@ -473,34 +507,25 @@ -2147483392 {{1, 38}, {393, 11}} + NO 257 _doScroller: 0.99746191501617432 - - - 2338 - - - - {{1, 0}, {394, 17}} - - - - - 4 - + {396, 100} + 133682 + QSAAAEEgAABBoAAAQaAAAA 0.25 4 @@ -509,11 +534,13 @@ {{0, 234}, {395, 100}} + YES {395, 334} + 2 SPNavigatorSchemaStatus @@ -522,6 +549,7 @@ 265 {{354.99999942450683, 337}, {20, 20}} + YES -2080374784 @@ -547,13 +575,14 @@ 265 {{252, 337}, {95, 17}} + YES 67108864 134348800 sync - .LucidaGrandeUI-Bold + YES 12 2072 @@ -569,6 +598,8 @@ {395, 359} + + {{0, 0}, {1440, 878}} {200, 222} @@ -579,7 +610,7 @@ NO - + window @@ -1042,14 +1073,190 @@ - + + + + ImageAndTextCell + NSTextFieldCell + + IBProjectSource + ../Source/ImageAndTextCell.h + + + + SPNavigatorController + NSWindowController + + id + id + id + id + + + + filterTree: + id + + + outlineViewAction: + id + + + reloadAllStructures: + id + + + syncButtonAction: + id + + + + id + id + SPNavigatorOutlineView + id + SPSplitView + id + NSButton + + + + infoTable + id + + + navigatorWindow + id + + + outlineSchema2 + SPNavigatorOutlineView + + + schema12SplitView + id + + + schemaStatusSplitView + SPSplitView + + + searchField + id + + + syncButton + NSButton + + + + IBProjectSource + ../Source/SPNavigatorController.h + + + + SPNavigatorController + + id + id + id + id + + + + filterTree: + id + + + outlineViewAction: + id + + + reloadAllStructures: + id + + + syncButtonAction: + id + + + + IBProjectSource + ../Source/SPNavigatorController.m + + + + SPNavigatorOutlineView + NSOutlineView + + IBProjectSource + ../Source/SPNavigatorOutlineView.h + + + + SPSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + NSView + NSButton + + + + additionalDragHandleView + NSView + + + collapseToggleButton + NSButton + + + + IBProjectSource + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m + + + + SPTableTextFieldCell + ImageAndTextCell + + IBProjectSource + ../Source/SPTableTextFieldCell.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 1af9ce1a..e55bd02e 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -2,13 +2,13 @@ 1060 - 13E28 - 5056 + 13F34 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSBox @@ -88,9 +88,11 @@ {580, 50} - + 256 {580, 172} + + {{0, 0}, {2560, 1418}} {580, 72} @@ -125,7 +127,7 @@ 4195328 Name: - .LucidaGrandeUI + YES 11 3100 @@ -163,7 +165,7 @@ 4457472 Already exists and will be overwritten! - .LucidaGrandeUI + YES 9 3614 @@ -350,7 +352,7 @@ 2048 Text Cell - .LucidaGrandeUI + YES 13 1044 @@ -560,7 +562,7 @@ YES - + 268 @@ -568,6 +570,7 @@ 268 {{201, 121}, {254, 26}} + YES -2076180416 @@ -587,29 +590,28 @@ 400 75 - - - Autodetect - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - + YES OtherViews - + + + Autodetect + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + YES @@ -913,6 +915,7 @@ + -1 3 YES YES @@ -925,6 +928,7 @@ 268 {{202, 214}, {362, 18}} + YES 67108864 @@ -953,6 +957,7 @@ 268 {{11, 242}, {187, 17}} + YES 68157504 @@ -971,6 +976,7 @@ 268 {{201, 236}, {254, 26}} + YES -2076180416 @@ -1003,6 +1009,7 @@ 268 {{17, 85}, {182, 17}} + YES 68157504 @@ -1021,6 +1028,7 @@ 268 {{17, 127}, {182, 17}} + YES 68157504 @@ -1039,6 +1047,7 @@ 268 {{202, 84}, {360, 18}} + YES 67108864 @@ -1062,6 +1071,7 @@ 268 {{202, 62}, {360, 18}} + YES 67108864 @@ -1085,6 +1095,7 @@ 1036 {{202, 156}, {360, 5}} + {0, 0} 67108864 @@ -1107,6 +1118,7 @@ 12 {{204, 108}, {358, 5}} + {0, 0} 67108864 @@ -1129,6 +1141,7 @@ 12 {{204, 53}, {357, 5}} + {0, 0} 67108864 @@ -1151,6 +1164,7 @@ 268 {{17, 23}, {181, 17}} + YES 68157504 @@ -1169,6 +1183,7 @@ 268 {{203, 20}, {38, 22}} + YES -1804599231 @@ -1223,6 +1238,7 @@ 268 {{247, 23}, {316, 17}} + YES 68157504 @@ -1241,6 +1257,7 @@ 268 {{201, 169}, {254, 26}} + YES -2076180416 @@ -1364,6 +1381,7 @@ 268 {{17, 175}, {182, 17}} + YES 68157504 @@ -1382,6 +1400,7 @@ 12 {{202, 204}, {360, 5}} + {0, 0} 67108864 @@ -1401,6 +1420,8 @@ {580, 280} + + NSView @@ -2292,7 +2313,7 @@ AQAAAAA - EEEE, d MMMM y h:mm:ss a + EEEE, d. MMMM y HH:mm:ss NO @@ -2557,7 +2578,7 @@ AQAAAAA NSView - + 268 @@ -2565,7 +2586,6 @@ AQAAAAA 268 {{469, 291}, {15, 22}} - YES @@ -2586,7 +2606,6 @@ AQAAAAA 268 {{439, 293}, {23, 19}} - YES @@ -2644,7 +2663,6 @@ AQAAAAA 268 {{270, 294}, {162, 18}} - YES @@ -2669,7 +2687,6 @@ AQAAAAA 268 {{144, 24}, {101, 14}} - YES @@ -2689,7 +2706,6 @@ AQAAAAA 268 {{49, 24}, {93, 14}} - YES @@ -2717,8 +2733,7 @@ AQAAAAA 256 {220, 286} - - + YES NO YES @@ -2803,7 +2818,6 @@ AQAAAAA {{1, 1}, {220, 286}} - @@ -2814,7 +2828,6 @@ AQAAAAA -2147483392 {{-100, -100}, {15, 102}} - NO @@ -2826,7 +2839,6 @@ AQAAAAA -2147483392 {{-100, -100}, {223, 15}} - NO 1 @@ -2837,8 +2849,7 @@ AQAAAAA {{20, 50}, {222, 288}} - - + 133122 @@ -2853,7 +2864,6 @@ AQAAAAA 268 {{20, 19}, {24, 24}} - YES @@ -2978,7 +2988,6 @@ AQAAAAA 268 {{439, 20}, {23, 19}} - YES @@ -3037,7 +3046,6 @@ AQAAAAA 268 {{269, 22}, {164, 16}} - YES @@ -3057,8 +3065,6 @@ AQAAAAA 268 {{469, 18}, {15, 22}} - - YES 67895328 @@ -3078,7 +3084,6 @@ AQAAAAA 268 {{17, 362}, {182, 17}} - YES @@ -3098,7 +3103,6 @@ AQAAAAA 268 {{433, 353}, {133, 32}} - YES @@ -3121,7 +3125,6 @@ AQAAAAA 268 {{204, 360}, {207, 22}} - YES @@ -3142,7 +3145,6 @@ AQAAAAA 268 {{270, 322}, {292, 18}} - YES @@ -3167,7 +3169,6 @@ AQAAAAA 268 {{270, 267}, {292, 18}} - YES @@ -3192,7 +3193,6 @@ AQAAAAA 268 {{270, 209}, {292, 18}} - YES @@ -3217,7 +3217,6 @@ AQAAAAA 268 {{270, 238}, {292, 18}} - YES @@ -3242,7 +3241,6 @@ AQAAAAA 268 {{270, 162}, {292, 18}} - YES @@ -3267,7 +3265,6 @@ AQAAAAA 268 {{270, 51}, {292, 18}} - YES @@ -3292,7 +3289,6 @@ AQAAAAA 268 {{270, 79}, {292, 18}} - YES @@ -3317,7 +3313,6 @@ AQAAAAA 268 {{270, 134}, {292, 18}} - YES @@ -3342,7 +3337,6 @@ AQAAAAA 268 {{370, 109}, {29, 19}} - YES @@ -3401,7 +3395,6 @@ AQAAAAA 268 {{269, 111}, {96, 14}} - YES @@ -3421,7 +3414,6 @@ AQAAAAA 268 {{405, 107}, {15, 22}} - YES @@ -3442,7 +3434,6 @@ AQAAAAA 268 {{423, 111}, {140, 14}} - YES @@ -3462,7 +3453,6 @@ AQAAAAA -2147483380 {{269, 1}, {292, 18}} - YES @@ -3487,7 +3477,6 @@ AQAAAAA 268 {{370, 184}, {29, 19}} - YES @@ -3546,7 +3535,6 @@ AQAAAAA 268 {{269, 186}, {96, 14}} - YES @@ -3566,7 +3554,6 @@ AQAAAAA 268 {{405, 182}, {15, 22}} - YES @@ -3587,7 +3574,6 @@ AQAAAAA 268 {{423, 186}, {140, 14}} - YES @@ -3607,7 +3593,6 @@ AQAAAAA 12 {{204, 349}, {356, 5}} - {0, 0} @@ -3628,8 +3613,6 @@ AQAAAAA {580, 400} - - NSView @@ -3871,7 +3854,7 @@ AQAAAAA NO - + window @@ -8136,7 +8119,7 @@ AQAAAAA SPPreferencePane IBProjectSource - ./Classes/SPAutoUpdatePreferencePane.h + ../Source/SPAutoUpdatePreferencePane.h @@ -8277,7 +8260,68 @@ AQAAAAA IBProjectSource - ./Classes/SPEditorPreferencePane.h + ../Source/SPEditorPreferencePane.h + + + + SPEditorPreferencePane + + id + id + id + id + id + id + id + id + id + id + + + + closePanelSheet: + id + + + duplicateTheme: + id + + + editThemeList: + id + + + exportColorScheme: + id + + + importColorScheme: + id + + + loadColorScheme: + id + + + removeTheme: + id + + + saveAsColorScheme: + id + + + setDefaultColors: + id + + + showCustomQueryFontPanel: + id + + + + IBProjectSource + ../Source/SPEditorPreferencePane.m @@ -8285,7 +8329,7 @@ AQAAAAA NSTextField IBProjectSource - ./Classes/SPFontPreviewTextField.h + ../Source/SPFontPreviewTextField.h @@ -8315,7 +8359,25 @@ AQAAAAA IBProjectSource - ./Classes/SPGeneralPreferencePane.h + ../Source/SPGeneralPreferencePane.h + + + + SPGeneralPreferencePane + + updateDefaultFavorite: + id + + + updateDefaultFavorite: + + updateDefaultFavorite: + id + + + + IBProjectSource + ../Source/SPGeneralPreferencePane.m @@ -8323,7 +8385,7 @@ AQAAAAA SPPreferencePane IBProjectSource - ./Classes/SPNetworkPreferencePane.h + ../Source/SPNetworkPreferencePane.h @@ -8331,7 +8393,7 @@ AQAAAAA SPPreferencePane IBProjectSource - ./Classes/SPNotificationsPreferencePane.h + ../Source/SPNotificationsPreferencePane.h @@ -8392,7 +8454,33 @@ AQAAAAA IBProjectSource - ./Classes/SPPreferenceController.h + ../Source/SPPreferenceController.h + + + + SPPreferenceController + + id + id + id + + + + displayEditorPreferences: + id + + + displayPreferencePane: + id + + + displayTablePreferences: + id + + + + IBProjectSource + ../Source/SPPreferenceController.m @@ -8400,7 +8488,7 @@ AQAAAAA NSViewController IBProjectSource - ./Classes/SPPreferencePane.h + ../Source/SPPreferencePane.h @@ -8430,9 +8518,29 @@ AQAAAAA IBProjectSource - ./Classes/SPTablesPreferencePane.h + ../Source/SPTablesPreferencePane.h + + SPTablesPreferencePane + + showGlobalResultTableFontPanel: + id + + + showGlobalResultTableFontPanel: + + showGlobalResultTableFontPanel: + id + + + + IBProjectSource + ../Source/SPTablesPreferencePane.m + + + + SUUpdater NSObject @@ -8459,8 +8567,8 @@ AQAAAAA - IBProjectSource - ./Classes/SUUpdater.h + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h @@ -8468,10 +8576,6 @@ AQAAAAA 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/PrintAccessory.xib b/Interfaces/English.lproj/PrintAccessory.xib index d19f411c..8093eee0 100644 --- a/Interfaces/English.lproj/PrintAccessory.xib +++ b/Interfaces/English.lproj/PrintAccessory.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -35,7 +35,7 @@ NSApplication - + 268 @@ -43,13 +43,14 @@ 268 {{158, 18}, {226, 18}} + YES -2080374784 0 Print Backgrounds - .LucidaGrandeUI + YES 13 1044 @@ -72,6 +73,8 @@ {400, 54} + + NSView @@ -80,7 +83,7 @@ NO - + printAccessoryView @@ -186,14 +189,35 @@ - + + + + SPPrintAccessory + NSViewController + + NSUserDefaultsController + NSView + + + + defaultsController + NSUserDefaultsController + + + printAccessoryView + NSView + + + + IBProjectSource + ../Source/SPPrintAccessory.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/ProgressIndicatorLayer.xib b/Interfaces/English.lproj/ProgressIndicatorLayer.xib index c2f830ad..fd813367 100644 --- a/Interfaces/English.lproj/ProgressIndicatorLayer.xib +++ b/Interfaces/English.lproj/ProgressIndicatorLayer.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSBox @@ -37,7 +37,7 @@ NSApplication - + 301 @@ -61,13 +61,14 @@ 290 {{97, 30}, {326, 49}} + YES 67108864 4460544 Multiline Label - .LucidaGrandeUI-Bold + YES 13 2072 @@ -89,6 +90,7 @@ 268 {{251, 10}, {175, 19}} + _NS:2444 YES @@ -96,9 +98,9 @@ 134217728 Cancel - .LucidaGrandeUI + YES 12 - 4883 + 787 _NS:2444 @@ -119,17 +121,19 @@ {436, 90} + {{0, 70}, {436, 90}} + {0, 0} 67108864 0 Box - .LucidaGrandeUI + YES 11 3100 @@ -160,15 +164,18 @@ 274 {{13, 79}, {73, 73}} + YRKSpinningProgressIndicator {437, 160} + {{0, -70}, {437, 160}} + {0, 0} 67108864 @@ -196,12 +203,14 @@ {437, 90} + + NSView NO - + taskProgressIndicator @@ -362,14 +371,3492 @@ - + + + + BGHUDButtonCell + NSButtonCell + + IBProjectSource + ../Source/BGHUDButtonCell.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPCopyTable + SPTableView + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m + + + + SPCustomQuery + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + switchDefaultQueryAction: + id + + + + id + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSScrollView + SPCopyTable + NSMenuItem + NSPopUpButton + id + NSScrollView + NSTextField + NSSegmentedControl + NSSearchField + NSSearchFieldCell + NSSegmentedControl + WebView + NSWindow + NSMenuItem + NSMenuItem + SPSplitView + NSTextField + id + NSMenuItem + NSMenuItem + NSSearchField + id + NSMenuItem + NSWindow + id + NSSearchField + id + NSMenuItem + NSButton + SPSplitView + id + id + id + NSMenuItem + NSMenuItem + NSMenuItem + NSButton + NSButton + NSMenuItem + NSMenuItem + id + id + SPTextView + id + id + + + + affectedRowsText + id + + + autohelpMenuItem + NSMenuItem + + + autoindentMenuItem + NSMenuItem + + + autopairMenuItem + NSMenuItem + + + autouppercaseKeywordsMenuItem + NSMenuItem + + + clearHistoryMenuItem + NSMenuItem + + + commentCurrentQueryMenuItem + NSMenuItem + + + commentLineOrSelectionMenuItem + NSMenuItem + + + completionListMenuItem + NSMenuItem + + + copyHistoryMenuItem + NSMenuItem + + + customQueryScrollView + NSScrollView + + + customQueryView + SPCopyTable + + + editorFontMenuItem + NSMenuItem + + + encodingPopUp + NSPopUpButton + + + errorText + id + + + errorTextScrollView + NSScrollView + + + errorTextTitle + NSTextField + + + helpNavigator + NSSegmentedControl + + + helpSearchField + NSSearchField + + + helpSearchFieldCell + NSSearchFieldCell + + + helpTargetSelector + NSSegmentedControl + + + helpWebView + WebView + + + helpWebViewWindow + NSWindow + + + nextHistoryMenuItem + NSMenuItem + + + previousHistoryMenuItem + NSMenuItem + + + queryEditorSplitView + SPSplitView + + + queryFavoriteNameTextField + NSTextField + + + queryFavoritesButton + id + + + queryFavoritesSaveAllMenuItem + NSMenuItem + + + queryFavoritesSaveAsMenuItem + NSMenuItem + + + queryFavoritesSearchField + NSSearchField + + + queryFavoritesSearchFieldView + id + + + queryFavoritesSearchMenuItem + NSMenuItem + + + queryFavoritesSheet + NSWindow + + + queryHistoryButton + id + + + queryHistorySearchField + NSSearchField + + + queryHistorySearchFieldView + id + + + queryHistorySearchMenuItem + NSMenuItem + + + queryInfoButton + NSButton + + + queryInfoPaneSplitView + SPSplitView + + + runAllButton + id + + + runPrimaryActionButton + id + + + runPrimaryActionButtonAsSelection + id + + + runPrimaryActionMenuItem + NSMenuItem + + + runSecondaryActionMenuItem + NSMenuItem + + + saveHistoryMenuItem + NSMenuItem + + + saveQueryFavoriteButton + NSButton + + + saveQueryFavoriteGlobal + NSButton + + + shiftLeftMenuItem + NSMenuItem + + + shiftRightMenuItem + NSMenuItem + + + tableDocumentInstance + id + + + tablesListInstance + id + + + textView + SPTextView + + + valueSheet + id + + + valueTextField + id + + + + IBProjectSource + ../Source/SPCustomQuery.h + + + + SPCustomQuery + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + id + id + NSWindow + SPSplitView + id + NSButton + id + NSTextField + NSTextView + NSWindow + id + NSTextView + NSPopUpButton + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + NSTableView + NSScrollView + NSPopUpButton + id + id + id + id + id + id + id + id + NSSearchField + NSView + NSProgressIndicator + id + id + id + NSButton + NSButton + NSSecureTextField + NSButton + NSButton + NSButton + id + id + id + id + id + SPTableContent + SPTableData + id + NSScrollView + NSTableView + id + SPTableStructure + NSTabView + id + SPTablesList + NSButton + id + id + NSBox + id + id + id + + + + addDatabaseButton + id + + + chooseDatabaseButton + id + + + connectionErrorDialog + NSWindow + + + contentViewSplitter + SPSplitView + + + copyDatabaseButton + id + + + copyDatabaseDataButton + NSButton + + + copyDatabaseMessageField + id + + + createTableSyntaxTextField + NSTextField + + + createTableSyntaxTextView + NSTextView + + + createTableSyntaxWindow + NSWindow + + + customQueryInstance + id + + + customQueryTextView + NSTextView + + + databaseAlterCollationButton + NSPopUpButton + + + databaseAlterEncodingButton + NSPopUpButton + + + databaseAlterSheet + id + + + databaseCollationButton + id + + + databaseCopyNameField + id + + + databaseCopySheet + id + + + databaseDataInstance + id + + + databaseEncodingButton + id + + + databaseNameField + id + + + databaseRenameNameField + id + + + databaseRenameSheet + id + + + databaseSheet + id + + + dbTablesTableView + NSTableView + + + documentActivityScrollView + NSScrollView + + + encodingPopUp + NSPopUpButton + + + exportControllerInstance + id + + + extendedTableInfoInstance + id + + + favoritesButton + id + + + historyControl + id + + + inputTextWindow + id + + + inputTextWindowHeader + id + + + inputTextWindowMessage + id + + + inputTextWindowSecureTextField + id + + + listFilterField + NSSearchField + + + parentView + NSView + + + queryProgressBar + NSProgressIndicator + + + renameDatabaseButton + id + + + renameDatabaseMessageField + id + + + saveConnectionAccessory + id + + + saveConnectionAutoConnect + NSButton + + + saveConnectionEncrypt + NSButton + + + saveConnectionEncryptString + NSSecureTextField + + + saveConnectionIncludeData + NSButton + + + saveConnectionIncludeQuery + NSButton + + + saveConnectionSavePassword + NSButton + + + saveConnectionSavePasswordAlert + id + + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDumpInstance + id + + + tableInfoScrollView + NSScrollView + + + tableInfoTable + NSTableView + + + tableRelationsInstance + id + + + tableSourceInstance + SPTableStructure + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + SPDatabaseData + id + NSPopUpButton + NSTextView + NSTextView + NSTextField + SPTableData + NSTextField + id + NSPopUpButton + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + id + NSPopUpButton + NSTextField + SPTablesList + + + + databaseDataInstance + SPDatabaseData + + + resetAutoIncrementResetButton + id + + + tableCollationPopUpButton + NSPopUpButton + + + tableCommentsTextView + NSTextView + + + tableCreateSyntaxTextView + NSTextView + + + tableCreatedAt + NSTextField + + + tableDataInstance + SPTableData + + + tableDataSize + NSTextField + + + tableDocumentInstance + id + + + tableEncodingPopUpButton + NSPopUpButton + + + tableIndexSize + NSTextField + + + tableMaxDataSize + NSTextField + + + tableRowAutoIncrement + NSTextField + + + tableRowAvgLength + NSTextField + + + tableRowFormat + NSTextField + + + tableRowNumber + NSTextField + + + tableSizeFree + NSTextField + + + tableSourceInstance + id + + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m + + + + SPHistoryController + NSObject + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + NSSegmentedControl + SPDatabaseDocument + + + + historyControl + NSSegmentedControl + + + theDocument + SPDatabaseDocument + + + + IBProjectSource + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m + + + + SPIndexesController + NSWindowController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + NSButton + NSButton + NSBox + NSButton + SPDatabaseDocument + NSView + NSButton + NSButton + NSTextField + NSTextField + NSTextField + NSTableColumn + NSPopUpButton + NSTextField + NSPopUpButton + NSScrollView + NSTableView + SPTableView + NSButton + NSButton + SPTableData + SPTableStructure + SPTablesList + + + + addIndexButton + NSButton + + + addIndexedColumnButton + NSButton + + + anchoredButtonBar + NSBox + + + confirmAddIndexButton + NSButton + + + dbDocument + SPDatabaseDocument + + + indexAdvancedOptionsView + NSView + + + indexAdvancedOptionsViewButton + NSButton + + + indexAdvancedOptionsViewLabelButton + NSButton + + + indexKeyBlockSizeTextField + NSTextField + + + indexNameLabel + NSTextField + + + indexNameTextField + NSTextField + + + indexSizeTableColumn + NSTableColumn + + + indexStorageTypePopUpButton + NSPopUpButton + + + indexTypeLabel + NSTextField + + + indexTypePopUpButton + NSPopUpButton + + + indexedColumnsScrollView + NSScrollView + + + indexedColumnsTableView + NSTableView + + + indexesTableView + SPTableView + + + removeIndexButton + NSButton + + + removeIndexedColumnButton + NSButton + + + tableData + SPTableData + + + tableStructure + SPTableStructure + + + tablesList + SPTablesList + + + + IBProjectSource + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m + + + + SPSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + NSView + NSButton + + + + additionalDragHandleView + NSView + + + collapseToggleButton + NSButton + + + + IBProjectSource + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m + + + + SPTableContent + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + id + id + id + id + SPSplitView + NSView + id + id + NSPopUpButton + id + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSButton + NSPanel + NSComboBox + SPSplitView + SPCopyTable + SPTextView + NSPanel + id + id + id + id + NSButton + NSBox + NSButton + NSButton + NSButton + NSTextField + NSStepper + NSButton + NSView + NSViewController + id + id + id + SPHistoryController + SPCopyTable + SPTableData + SPDatabaseDocument + SPTableInfo + id + id + + + + addButton + id + + + argumentField + id + + + betweenTextField + id + + + compareField + id + + + contentSplitView + SPSplitView + + + contentViewPane + NSView + + + countText + id + + + duplicateButton + id + + + fieldField + NSPopUpButton + + + filterButton + id + + + filterTableClearButton + NSButton + + + filterTableDistinctCheckbox + NSButton + + + filterTableFilterButton + NSButton + + + filterTableLiveSearchCheckbox + NSButton + + + filterTableNegateCheckbox + NSButton + + + filterTableQueryTitle + NSTextField + + + filterTableSearchAllFields + NSButton + + + filterTableSetDefaultOperatorSheet + NSPanel + + + filterTableSetDefaultOperatorValue + NSComboBox + + + filterTableSplitView + SPSplitView + + + filterTableView + SPCopyTable + + + filterTableWhereClause + SPTextView + + + filterTableWindow + NSPanel + + + firstBetweenField + id + + + limitRowsButton + id + + + limitRowsField + id + + + limitRowsStepper + id + + + multipleLineEditingButton + NSButton + + + paginationBox + NSBox + + + paginationButton + NSButton + + + paginationGoButton + NSButton + + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + IBProjectSource + ../Source/SPTableContent.m + + + + SPTableData + NSObject + + SPDatabaseDocument + SPTablesList + + + + tableDocumentInstance + SPDatabaseDocument + + + tableListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableData.h + + + + SPTableInfo + NSObject + + NSTableView + id + id + id + NSScrollView + id + id + + + + activitiesTable + NSTableView + + + infoTable + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableInfoScrollView + NSScrollView + + + tableList + id + + + tableListInstance + id + + + + IBProjectSource + ../Source/SPTableInfo.h + + + + SPTableStructure + NSObject + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + id + id + id + SPDatabaseData + id + id + NSPopUpButtonCell + SPExtendedTableInfo + SPIndexesController + NSButton + SPTableView + id + id + id + id + id + id + id + id + id + SPTableData + SPDatabaseDocument + SPTableInfo + SPTableView + NSSplitView + SPTablesList + id + + + + addFieldButton + id + + + addIndexButton + id + + + chooseKeyButton + id + + + databaseDataInstance + SPDatabaseData + + + duplicateFieldButton + id + + + editTableButton + id + + + encodingPopupCell + NSPopUpButtonCell + + + extendedTableInfoInstance + SPExtendedTableInfo + + + indexesController + SPIndexesController + + + indexesShowButton + NSButton + + + indexesTableView + SPTableView + + + keySheet + id + + + refreshIndexesButton + id + + + reloadFieldsButton + id + + + removeFieldButton + id + + + removeIndexButton + id + + + resetAutoIncrementLine + id + + + resetAutoIncrementSheet + id + + + resetAutoIncrementValue + id + + + structureGrabber + id + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceView + SPTableView + + + tablesIndexesSplitView + NSSplitView + + + tablesListInstance + SPTablesList + + + viewColumnsMenu + id + + + + IBProjectSource + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m + + + + SPTableView + NSTableView + + IBProjectSource + ../Source/SPTableView.h + + + + SPTablesList + NSObject + + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + id + NSMenuItem + NSMenuItem + id + NSButton + id + id + id + id + SPDatabaseData + NSMenuItem + NSMenuItem + id + NSSearchField + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + SPHistoryController + id + SPTableContent + id + SPDatabaseDocument + id + id + id + SPSplitView + SPSplitView + id + id + SPTableStructure + id + id + SPTableView + id + id + id + id + NSMenuItem + + + + addTableButton + id + + + copyCreateSyntaxContextMenuItem + NSMenuItem + + + copyCreateSyntaxMenuItem + NSMenuItem + + + copyTableButton + id + + + copyTableContentSwitch + NSButton + + + copyTableMessageField + id + + + copyTableNameField + id + + + copyTableSheet + id + + + customQueryInstance + id + + + databaseDataInstance + SPDatabaseData + + + duplicateTableContextMenuItem + NSMenuItem + + + duplicateTableMenuItem + NSMenuItem + + + extendedTableInfoInstance + id + + + listFilterField + NSSearchField + + + openTableInNewTabContextMenuItem + NSMenuItem + + + openTableInNewTabMenuItem + NSMenuItem + + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + + + removeTableContextMenuItem + NSMenuItem + + + removeTableMenuItem + NSMenuItem + + + renameTableContextMenuItem + NSMenuItem + + + renameTableMenuItem + NSMenuItem + + + separatorTableContextMenuItem + NSMenuItem + + + separatorTableContextMenuItem2 + NSMenuItem + + + separatorTableContextMenuItem3 + NSMenuItem + + + separatorTableMenuItem + NSMenuItem + + + separatorTableMenuItem2 + NSMenuItem + + + separatorTableMenuItem3 + NSMenuItem + + + showCreateSyntaxContextMenuItem + NSMenuItem + + + showCreateSyntaxMenuItem + NSMenuItem + + + spHistoryControllerInstance + SPHistoryController + + + tableCollationButton + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + id + + + tableDocumentInstance + SPDatabaseDocument + + + tableDumpInstance + id + + + tableEncodingButton + id + + + tableInfoInstance + id + + + tableListFilterSplitView + SPSplitView + + + tableListSplitView + SPSplitView + + + tableNameField + id + + + tableSheet + id + + + tableSourceInstance + SPTableStructure + + + tableTriggersInstance + id + + + tableTypeButton + id + + + tablesListView + SPTableView + + + toolbarActionsButton + id + + + toolbarAddButton + id + + + toolbarReloadButton + id + + + truncateTableButton + id + + + truncateTableContextMenuItem + NSMenuItem + + + + IBProjectSource + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + + + SPCustomQuery + NSScrollView + SPDatabaseDocument + SPTablesList + + + + customQueryInstance + SPCustomQuery + + + scrollView + NSScrollView + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m + + + + YRKSpinningProgressIndicator + NSView + + IBProjectSource + ../Source/YRKSpinningProgressIndicator.h + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/QueryFavoriteManager.xib b/Interfaces/English.lproj/QueryFavoriteManager.xib index 36ec44e0..336aaad1 100644 --- a/Interfaces/English.lproj/QueryFavoriteManager.xib +++ b/Interfaces/English.lproj/QueryFavoriteManager.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSArrayController @@ -78,7 +78,7 @@ 0 Box - .LucidaGrandeUI + YES 13 1044 @@ -182,7 +182,7 @@ 2048 Favorites - .LucidaGrandeUI + YES 11 3100 @@ -1288,7 +1288,7 @@ NO - + window @@ -2600,7 +2600,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA NSTextFieldCell IBProjectSource - ./Classes/ImageAndTextCell.h + ../Source/ImageAndTextCell.h @@ -2691,7 +2691,98 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m @@ -2703,7 +2794,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA id id id - id id id id @@ -2729,10 +2819,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA importContentFilterByAdding: id - - importFavoritesByReplacing: - id - insertPlaceholder: id @@ -2822,7 +2908,63 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPContentFilterManager.h + ../Source/SPContentFilterManager.h + + + + SPContentFilterManager + + id + id + id + id + id + id + id + id + id + + + + addContentFilter: + id + + + closeContentFilterManagerSheet: + id + + + duplicateContentFilter: + id + + + exportContentFilter: + id + + + importContentFilterByAdding: + id + + + importFavoritesByReplacing: + id + + + insertPlaceholder: + id + + + removeContentFilter: + id + + + suppressLeadingFiledPlaceholderWasChanged: + id + + + + IBProjectSource + ../Source/SPContentFilterManager.m @@ -2841,7 +2983,25 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPCopyTable.h + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m @@ -2868,11 +3028,9 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA id id id - id id id id - id id @@ -2956,10 +3114,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA saveQueryHistory: id - - searchInDocForWebViewSelection: - id - showCompletionList: id @@ -2972,10 +3126,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA showHelpForSearchString: id - - showHelpForWebViewSelection: - id - switchDefaultQueryAction: id @@ -3262,89 +3412,240 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPCustomQuery.h - - - - SPDatabaseData - NSObject - - IBProjectSource - ./Classes/SPDatabaseData.h + ../Source/SPCustomQuery.h - SPDatabaseDocument - NSObject + SPCustomQuery - id - id - id - id - id - id - id - id - id - id - id - id - id + id + id + id id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - - - - addConnectionToFavorites: - id - - - addDatabase: - id - - - alterDatabase: - id - - - analyzeTable: + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: id @@ -3371,10 +3672,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA chooseEncoding: id - - closeErrorConnectionSheet: - id - closePanelSheet: id @@ -3443,10 +3740,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA optimizeTable: id - - printDocument: - id - refreshTables: id @@ -3515,30 +3808,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA validateSaveConnectionAccessory: id - - viewContent: - id - - - viewQuery: - id - - - viewRelations: - id - - - viewStatus: - id - - - viewStructure: - id - - - viewTriggers: - id - id @@ -3891,16 +4160,347 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPDatabaseDocument.h + ../Source/SPDatabaseDocument.h - SPExtendedTableInfo - NSObject + SPDatabaseDocument - id - id - id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id id id id @@ -4027,22 +4627,63 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA tableSourceInstance id - - tableTypePopUpButton - NSPopUpButton + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id - - tableUpdatedAt - NSTextField + + updateTableEncoding: + id - - tablesListInstance - SPTablesList + + updateTableType: + id IBProjectSource - ./Classes/SPExtendedTableInfo.h + ../Source/SPExtendedTableInfo.m @@ -4075,7 +4716,25 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPHistoryController.h + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m @@ -4241,7 +4900,53 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPIndexesController.h + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m @@ -4352,7 +5057,73 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPQueryFavoriteManager.h + ../Source/SPQueryFavoriteManager.h + + + + SPQueryFavoriteManager + + id + id + id + id + id + id + id + id + id + id + id + + + + addQueryFavorite: + id + + + closeQueryManagerSheet: + id + + + duplicateQueryFavorite: + id + + + exportFavorites: + id + + + importFavoritesByAdding: + id + + + importFavoritesByReplacing: + id + + + insertPlaceholder: + id + + + removeAllQueryFavorites: + id + + + removeQueryFavorite: + id + + + saveFavoriteToFile: + id + + + showHelp: + id + + + + IBProjectSource + ../Source/SPQueryFavoriteManager.m @@ -4385,7 +5156,25 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -4509,6 +5298,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA id id NSButton + NSBox NSButton NSButton NSButton @@ -4516,6 +5306,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA NSStepper NSButton NSView + NSViewController id id id @@ -4640,6 +5431,10 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA multipleLineEditingButton NSButton + + paginationBox + NSBox + paginationButton NSButton @@ -4664,54 +5459,154 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA paginationPreviousButton NSButton - - paginationView - NSView + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id - - reloadButton + + removeRow: id - - removeButton + + setCompareTypes: id - - secondBetweenField + + setDefaultOperator: id - - spHistoryControllerInstance - SPHistoryController + + showDefaultOperaterHelp: + id - - tableContentView - SPCopyTable + + showFilterTable: + id - - tableDataInstance - SPTableData + + tableFilterClear: + id - - tableDocumentInstance - SPDatabaseDocument + + toggleDistinctSelect: + id - - tableInfoInstance - SPTableInfo + + toggleFilterField: + id - - tableSourceInstance + + toggleLookAllFieldsMode: id - - tablesListInstance + + toggleNegateClause: id + + togglePagination: + NSButton + IBProjectSource - ./Classes/SPTableContent.h + ../Source/SPTableContent.m @@ -4733,7 +5628,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPTableData.h + ../Source/SPTableData.h @@ -4780,7 +5675,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPTableInfo.h + ../Source/SPTableInfo.h @@ -4790,7 +5685,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA id id id - id id id id @@ -4810,10 +5704,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA duplicateField: id - - reloadTable: - id - removeField: id @@ -4976,7 +5866,94 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPTableStructure.h + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m @@ -4984,7 +5961,7 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA NSTableView IBProjectSource - ./Classes/SPTableView.h + ../Source/SPTableView.h @@ -4995,9 +5972,9 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA id id id + id id id - id id id id @@ -5020,6 +5997,10 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA openTableInNewTab: id + + openTableInNewWindow: + id + removeTable: id @@ -5028,10 +6009,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA renameTable: id - - tableEncodingButtonChanged: - id - togglePaneCollapse: id @@ -5066,6 +6043,8 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA NSSearchField NSMenuItem NSMenuItem + NSMenuItem + NSMenuItem NSMenuItem NSMenuItem NSMenuItem @@ -5165,6 +6144,14 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA openTableInNewTabMenuItem NSMenuItem + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + removeTableContextMenuItem NSMenuItem @@ -5300,26 +6287,94 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPTablesList.h + ../Source/SPTablesList.h - SPTextView - NSTextView + SPTablesList - id - id + id + id + id + id + id + id + id + id + id + id + id + id - - printDocument: + + addTable: id - - showMySQLHelpForCurrentWord: + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: id + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + SPCustomQuery NSScrollView @@ -5346,7 +6401,28 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA IBProjectSource - ./Classes/SPTextView.h + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m @@ -5354,10 +6430,6 @@ IG5vdCBiZSB1c2VkIGluc2lkZSBvZiBhIHRhYiBzbmlwcGV0XeKAqA 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/SSHQuestionDialog.xib b/Interfaces/English.lproj/SSHQuestionDialog.xib index d3b5c881..f02f07dc 100644 --- a/Interfaces/English.lproj/SSHQuestionDialog.xib +++ b/Interfaces/English.lproj/SSHQuestionDialog.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -50,7 +50,7 @@ - + 256 @@ -58,13 +58,14 @@ 274 {{126, 60}, {477, 129}} + YES 67108864 272891904 - .LucidaGrandeUI + YES 13 1044 @@ -96,6 +97,7 @@ 289 {{510, 12}, {96, 32}} + 1 YES @@ -126,6 +128,7 @@ {{20, 115}, {75, 74}} + YES 134217728 @@ -147,6 +150,7 @@ 289 {{414, 12}, {96, 32}} + YES 67108864 @@ -176,6 +180,7 @@ {{68, 113}, {32, 32}} + YES 134217728 @@ -194,6 +199,8 @@ {620, 209} + + {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} @@ -223,7 +230,7 @@ 272891904 - .LucidaGrandeUI-Bold + YES 13 2072 @@ -420,7 +427,7 @@ NO - + sshQuestionText @@ -850,14 +857,90 @@ - + + + + SPSSHTunnel + NSObject + + id + id + + + + closeSSHPasswordSheet: + id + + + closeSSHQuestionSheet: + id + + + + NSWindow + NSSecureTextField + NSButton + NSTextField + NSWindow + NSTextField + + + + sshPasswordDialog + NSWindow + + + sshPasswordField + NSSecureTextField + + + sshPasswordKeychainCheckbox + NSButton + + + sshPasswordText + NSTextField + + + sshQuestionDialog + NSWindow + + + sshQuestionText + NSTextField + + + + IBProjectSource + ../Source/SPSSHTunnel.h + + + + SPSSHTunnel + + id + id + + + + closeSSHPasswordSheet: + id + + + closeSSHQuestionSheet: + id + + + + IBProjectSource + ../Source/SPSSHTunnel.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/SaveSPFAccessory.xib b/Interfaces/English.lproj/SaveSPFAccessory.xib index 6d8069fc..f9150a70 100644 --- a/Interfaces/English.lproj/SaveSPFAccessory.xib +++ b/Interfaces/English.lproj/SaveSPFAccessory.xib @@ -2,13 +2,13 @@ 1060 - 13B3116 - 4514 - 1265 - 696.00 + 13F34 + 6254 + 1265.21 + 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 4514 + 6254 NSButton @@ -39,7 +39,7 @@ NSApplication - + 268 @@ -47,13 +47,14 @@ 268 {{18, 33}, {394, 18}} + YES -2080374784 0 Remember window state - .LucidaGrandeUI + YES 13 1044 @@ -79,6 +80,7 @@ 268 {{18, 7}, {394, 18}} + YES 67108864 @@ -102,6 +104,7 @@ 268 {{18, 111}, {189, 18}} + YES 67108864 @@ -125,6 +128,7 @@ 268 {{18, 85}, {209, 18}} + YES 67108864 @@ -148,13 +152,14 @@ 268 {{233, 84}, {157, 19}} + YES 342884416 272761856 - .LucidaGrandeUI + YES 11 3100 @@ -190,6 +195,7 @@ 268 {{18, 59}, {394, 18}} + YES -2080374784 @@ -213,6 +219,7 @@ 268 {{210, 106}, {203, 28}} + YES 67108864 @@ -241,6 +248,8 @@ {432, 138} + + NSView @@ -249,7 +258,7 @@ NO - + saveConnectionAccessory @@ -567,14 +576,3476 @@ - + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + IBProjectSource + ../Source/SPTextViewAdditions.m + + + + SPCopyTable + SPTableView + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.h + + + + SPCopyTable + + executeBundleItemForDataTable: + id + + + executeBundleItemForDataTable: + + executeBundleItemForDataTable: + id + + + + IBProjectSource + ../Source/SPCopyTable.m + + + + SPCustomQuery + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + switchDefaultQueryAction: + id + + + + id + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSScrollView + SPCopyTable + NSMenuItem + NSPopUpButton + id + NSScrollView + NSTextField + NSSegmentedControl + NSSearchField + NSSearchFieldCell + NSSegmentedControl + WebView + NSWindow + NSMenuItem + NSMenuItem + SPSplitView + NSTextField + id + NSMenuItem + NSMenuItem + NSSearchField + id + NSMenuItem + NSWindow + id + NSSearchField + id + NSMenuItem + NSButton + SPSplitView + id + id + id + NSMenuItem + NSMenuItem + NSMenuItem + NSButton + NSButton + NSMenuItem + NSMenuItem + id + id + SPTextView + id + id + + + + affectedRowsText + id + + + autohelpMenuItem + NSMenuItem + + + autoindentMenuItem + NSMenuItem + + + autopairMenuItem + NSMenuItem + + + autouppercaseKeywordsMenuItem + NSMenuItem + + + clearHistoryMenuItem + NSMenuItem + + + commentCurrentQueryMenuItem + NSMenuItem + + + commentLineOrSelectionMenuItem + NSMenuItem + + + completionListMenuItem + NSMenuItem + + + copyHistoryMenuItem + NSMenuItem + + + customQueryScrollView + NSScrollView + + + customQueryView + SPCopyTable + + + editorFontMenuItem + NSMenuItem + + + encodingPopUp + NSPopUpButton + + + errorText + id + + + errorTextScrollView + NSScrollView + + + errorTextTitle + NSTextField + + + helpNavigator + NSSegmentedControl + + + helpSearchField + NSSearchField + + + helpSearchFieldCell + NSSearchFieldCell + + + helpTargetSelector + NSSegmentedControl + + + helpWebView + WebView + + + helpWebViewWindow + NSWindow + + + nextHistoryMenuItem + NSMenuItem + + + previousHistoryMenuItem + NSMenuItem + + + queryEditorSplitView + SPSplitView + + + queryFavoriteNameTextField + NSTextField + + + queryFavoritesButton + id + + + queryFavoritesSaveAllMenuItem + NSMenuItem + + + queryFavoritesSaveAsMenuItem + NSMenuItem + + + queryFavoritesSearchField + NSSearchField + + + queryFavoritesSearchFieldView + id + + + queryFavoritesSearchMenuItem + NSMenuItem + + + queryFavoritesSheet + NSWindow + + + queryHistoryButton + id + + + queryHistorySearchField + NSSearchField + + + queryHistorySearchFieldView + id + + + queryHistorySearchMenuItem + NSMenuItem + + + queryInfoButton + NSButton + + + queryInfoPaneSplitView + SPSplitView + + + runAllButton + id + + + runPrimaryActionButton + id + + + runPrimaryActionButtonAsSelection + id + + + runPrimaryActionMenuItem + NSMenuItem + + + runSecondaryActionMenuItem + NSMenuItem + + + saveHistoryMenuItem + NSMenuItem + + + saveQueryFavoriteButton + NSButton + + + saveQueryFavoriteGlobal + NSButton + + + shiftLeftMenuItem + NSMenuItem + + + shiftRightMenuItem + NSMenuItem + + + tableDocumentInstance + id + + + tablesListInstance + id + + + textView + SPTextView + + + valueSheet + id + + + valueTextField + id + + + + IBProjectSource + ../Source/SPCustomQuery.h + + + + SPCustomQuery + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + chooseQueryFavorite: + id + + + chooseQueryHistory: + id + + + clearQueryHistory: + id + + + closeSheet: + id + + + copyQueryHistory: + id + + + filterQueryFavorites: + id + + + filterQueryHistory: + id + + + gearMenuItemSelected: + id + + + helpSearchFindNextInPage: + id + + + helpSearchFindPreviousInPage: + id + + + helpSegmentDispatcher: + id + + + helpSelectHelpTargetMySQL: + id + + + helpSelectHelpTargetPage: + id + + + helpSelectHelpTargetWeb: + id + + + helpTargetDispatcher: + id + + + runAllQueries: + id + + + runPrimaryQueryAction: + id + + + runSecondaryQueryAction: + id + + + runSelectedQueries: + id + + + saveQueryHistory: + id + + + searchInDocForWebViewSelection: + id + + + showCompletionList: + id + + + showHelpForCurrentWord: + id + + + showHelpForSearchString: + id + + + showHelpForWebViewSelection: + id + + + switchDefaultQueryAction: + id + + + + IBProjectSource + ../Source/SPCustomQuery.m + + + + SPDatabaseData + NSObject + + IBProjectSource + ../Source/SPDatabaseData.h + + + + SPDatabaseDocument + + closeErrorConnectionSheet: + id + + + closeErrorConnectionSheet: + + closeErrorConnectionSheet: + id + + + + IBProjectSource + ../Source/SPConnectionDelegate.m + + + + SPDatabaseDocument + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + id + id + NSWindow + SPSplitView + id + NSButton + id + NSTextField + NSTextView + NSWindow + id + NSTextView + NSPopUpButton + NSPopUpButton + id + id + id + id + id + id + id + id + id + id + NSTableView + NSScrollView + NSPopUpButton + id + id + id + id + id + id + id + id + NSSearchField + NSView + NSProgressIndicator + id + id + id + NSButton + NSButton + NSSecureTextField + NSButton + NSButton + NSButton + id + id + id + id + id + SPTableContent + SPTableData + id + NSScrollView + NSTableView + id + SPTableStructure + NSTabView + id + SPTablesList + NSButton + id + id + NSBox + id + id + id + + + + addDatabaseButton + id + + + chooseDatabaseButton + id + + + connectionErrorDialog + NSWindow + + + contentViewSplitter + SPSplitView + + + copyDatabaseButton + id + + + copyDatabaseDataButton + NSButton + + + copyDatabaseMessageField + id + + + createTableSyntaxTextField + NSTextField + + + createTableSyntaxTextView + NSTextView + + + createTableSyntaxWindow + NSWindow + + + customQueryInstance + id + + + customQueryTextView + NSTextView + + + databaseAlterCollationButton + NSPopUpButton + + + databaseAlterEncodingButton + NSPopUpButton + + + databaseAlterSheet + id + + + databaseCollationButton + id + + + databaseCopyNameField + id + + + databaseCopySheet + id + + + databaseDataInstance + id + + + databaseEncodingButton + id + + + databaseNameField + id + + + databaseRenameNameField + id + + + databaseRenameSheet + id + + + databaseSheet + id + + + dbTablesTableView + NSTableView + + + documentActivityScrollView + NSScrollView + + + encodingPopUp + NSPopUpButton + + + exportControllerInstance + id + + + extendedTableInfoInstance + id + + + favoritesButton + id + + + historyControl + id + + + inputTextWindow + id + + + inputTextWindowHeader + id + + + inputTextWindowMessage + id + + + inputTextWindowSecureTextField + id + + + listFilterField + NSSearchField + + + parentView + NSView + + + queryProgressBar + NSProgressIndicator + + + renameDatabaseButton + id + + + renameDatabaseMessageField + id + + + saveConnectionAccessory + id + + + saveConnectionAutoConnect + NSButton + + + saveConnectionEncrypt + NSButton + + + saveConnectionEncryptString + NSSecureTextField + + + saveConnectionIncludeData + NSButton + + + saveConnectionIncludeQuery + NSButton + + + saveConnectionSavePassword + NSButton + + + saveConnectionSavePasswordAlert + id + + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + SPTableData + + + tableDumpInstance + id + + + tableInfoScrollView + NSScrollView + + + tableInfoTable + NSTableView + + + tableRelationsInstance + id + + + tableSourceInstance + SPTableStructure + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + SPTablesList + + + taskCancelButton + NSButton + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addConnectionToFavorites: + id + + + addDatabase: + id + + + alterDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + import: + id + + + importFromClipboard: + id + + + makeTableListFilterHaveFocus: + id + + + openCurrentConnectionInNewWindow: + id + + + openDatabaseInNewTab: + id + + + optimizeTable: + id + + + refreshTables: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showCreateTableSyntax: + id + + + showFilterTable: + id + + + showGotoDatabase: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + validateSaveConnectionAccessory: + id + + + + IBProjectSource + ../Source/SPDatabaseDocument.m + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.h + + + + SPDatabaseDocument + + id + id + id + id + id + id + + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + + + + IBProjectSource + ../Source/SPDatabaseViewController.m + + + + SPDatabaseDocument + + printDocument: + id + + + printDocument: + + printDocument: + id + + + + IBProjectSource + ../Source/SPPrintController.m + + + + SPExtendedTableInfo + NSObject + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + SPDatabaseData + id + NSPopUpButton + NSTextView + NSTextView + NSTextField + SPTableData + NSTextField + id + NSPopUpButton + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + id + NSPopUpButton + NSTextField + SPTablesList + + + + databaseDataInstance + SPDatabaseData + + + resetAutoIncrementResetButton + id + + + tableCollationPopUpButton + NSPopUpButton + + + tableCommentsTextView + NSTextView + + + tableCreateSyntaxTextView + NSTextView + + + tableCreatedAt + NSTextField + + + tableDataInstance + SPTableData + + + tableDataSize + NSTextField + + + tableDocumentInstance + id + + + tableEncodingPopUpButton + NSPopUpButton + + + tableIndexSize + NSTextField + + + tableMaxDataSize + NSTextField + + + tableRowAutoIncrement + NSTextField + + + tableRowAvgLength + NSTextField + + + tableRowFormat + NSTextField + + + tableRowNumber + NSTextField + + + tableSizeFree + NSTextField + + + tableSourceInstance + id + + + tableTypePopUpButton + NSPopUpButton + + + tableUpdatedAt + NSTextField + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPExtendedTableInfo.h + + + + SPExtendedTableInfo + + id + id + id + id + id + id + + + + reloadTable: + id + + + resetAutoIncrement: + id + + + resetAutoIncrementValueWasEdited: + id + + + updateTableCollation: + id + + + updateTableEncoding: + id + + + updateTableType: + id + + + + IBProjectSource + ../Source/SPExtendedTableInfo.m + + + + SPHistoryController + NSObject + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + NSSegmentedControl + SPDatabaseDocument + + + + historyControl + NSSegmentedControl + + + theDocument + SPDatabaseDocument + + + + IBProjectSource + ../Source/SPHistoryController.h + + + + SPHistoryController + + historyControlClicked: + NSSegmentedControl + + + historyControlClicked: + + historyControlClicked: + NSSegmentedControl + + + + IBProjectSource + ../Source/SPHistoryController.m + + + + SPIndexesController + NSWindowController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + NSButton + NSButton + NSBox + NSButton + SPDatabaseDocument + NSView + NSButton + NSButton + NSTextField + NSTextField + NSTextField + NSTableColumn + NSPopUpButton + NSTextField + NSPopUpButton + NSScrollView + NSTableView + SPTableView + NSButton + NSButton + SPTableData + SPTableStructure + SPTablesList + + + + addIndexButton + NSButton + + + addIndexedColumnButton + NSButton + + + anchoredButtonBar + NSBox + + + confirmAddIndexButton + NSButton + + + dbDocument + SPDatabaseDocument + + + indexAdvancedOptionsView + NSView + + + indexAdvancedOptionsViewButton + NSButton + + + indexAdvancedOptionsViewLabelButton + NSButton + + + indexKeyBlockSizeTextField + NSTextField + + + indexNameLabel + NSTextField + + + indexNameTextField + NSTextField + + + indexSizeTableColumn + NSTableColumn + + + indexStorageTypePopUpButton + NSPopUpButton + + + indexTypeLabel + NSTextField + + + indexTypePopUpButton + NSPopUpButton + + + indexedColumnsScrollView + NSScrollView + + + indexedColumnsTableView + NSTableView + + + indexesTableView + SPTableView + + + removeIndexButton + NSButton + + + removeIndexedColumnButton + NSButton + + + tableData + SPTableData + + + tableStructure + SPTableStructure + + + tablesList + SPTablesList + + + + IBProjectSource + ../Source/SPIndexesController.h + + + + SPIndexesController + + id + id + id + id + id + id + id + + + + addIndex: + id + + + addIndexedField: + id + + + chooseIndexType: + id + + + closeSheet: + id + + + removeIndex: + id + + + removeIndexedField: + id + + + toggleAdvancedIndexOptionsView: + id + + + + IBProjectSource + ../Source/SPIndexesController.m + + + + SPSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + NSView + NSButton + + + + additionalDragHandleView + NSView + + + collapseToggleButton + NSButton + + + + IBProjectSource + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m + + + + SPTableContent + NSObject + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + id + id + id + id + SPSplitView + NSView + id + id + NSPopUpButton + id + NSButton + NSButton + NSButton + NSButton + NSButton + NSTextField + NSButton + NSPanel + NSComboBox + SPSplitView + SPCopyTable + SPTextView + NSPanel + id + id + id + id + NSButton + NSBox + NSButton + NSButton + NSButton + NSTextField + NSStepper + NSButton + NSView + NSViewController + id + id + id + SPHistoryController + SPCopyTable + SPTableData + SPDatabaseDocument + SPTableInfo + id + id + + + + addButton + id + + + argumentField + id + + + betweenTextField + id + + + compareField + id + + + contentSplitView + SPSplitView + + + contentViewPane + NSView + + + countText + id + + + duplicateButton + id + + + fieldField + NSPopUpButton + + + filterButton + id + + + filterTableClearButton + NSButton + + + filterTableDistinctCheckbox + NSButton + + + filterTableFilterButton + NSButton + + + filterTableLiveSearchCheckbox + NSButton + + + filterTableNegateCheckbox + NSButton + + + filterTableQueryTitle + NSTextField + + + filterTableSearchAllFields + NSButton + + + filterTableSetDefaultOperatorSheet + NSPanel + + + filterTableSetDefaultOperatorValue + NSComboBox + + + filterTableSplitView + SPSplitView + + + filterTableView + SPCopyTable + + + filterTableWhereClause + SPTextView + + + filterTableWindow + NSPanel + + + firstBetweenField + id + + + limitRowsButton + id + + + limitRowsField + id + + + limitRowsStepper + id + + + multipleLineEditingButton + NSButton + + + paginationBox + NSBox + + + paginationButton + NSButton + + + paginationGoButton + NSButton + + + paginationNextButton + NSButton + + + paginationPageField + NSTextField + + + paginationPageStepper + NSStepper + + + paginationPreviousButton + NSButton + + + paginationView + NSView + + + paginationViewController + NSViewController + + + reloadButton + id + + + removeButton + id + + + secondBetweenField + id + + + spHistoryControllerInstance + SPHistoryController + + + tableContentView + SPCopyTable + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceInstance + id + + + tablesListInstance + id + + + + IBProjectSource + ../Source/SPTableContent.h + + + + SPTableContent + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + + + + addRow: + id + + + closeSheet: + id + + + duplicateRow: + id + + + filterTable: + id + + + navigatePaginationFromButton: + id + + + reloadTable: + id + + + removeRow: + id + + + setCompareTypes: + id + + + setDefaultOperator: + id + + + showDefaultOperaterHelp: + id + + + showFilterTable: + id + + + tableFilterClear: + id + + + toggleDistinctSelect: + id + + + toggleFilterField: + id + + + toggleLookAllFieldsMode: + id + + + toggleNegateClause: + id + + + togglePagination: + NSButton + + + + IBProjectSource + ../Source/SPTableContent.m + + + + SPTableData + NSObject + + SPDatabaseDocument + SPTablesList + + + + tableDocumentInstance + SPDatabaseDocument + + + tableListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableData.h + + + + SPTableInfo + NSObject + + NSTableView + id + id + id + NSScrollView + id + id + + + + activitiesTable + NSTableView + + + infoTable + id + + + tableDataInstance + id + + + tableDocumentInstance + id + + + tableInfoScrollView + NSScrollView + + + tableList + id + + + tableListInstance + id + + + + IBProjectSource + ../Source/SPTableInfo.h + + + + SPTableStructure + NSObject + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + id + id + id + SPDatabaseData + id + id + NSPopUpButtonCell + SPExtendedTableInfo + SPIndexesController + NSButton + SPTableView + id + id + id + id + id + id + id + id + id + SPTableData + SPDatabaseDocument + SPTableInfo + SPTableView + NSSplitView + SPTablesList + id + + + + addFieldButton + id + + + addIndexButton + id + + + chooseKeyButton + id + + + databaseDataInstance + SPDatabaseData + + + duplicateFieldButton + id + + + editTableButton + id + + + encodingPopupCell + NSPopUpButtonCell + + + extendedTableInfoInstance + SPExtendedTableInfo + + + indexesController + SPIndexesController + + + indexesShowButton + NSButton + + + indexesTableView + SPTableView + + + keySheet + id + + + refreshIndexesButton + id + + + reloadFieldsButton + id + + + removeFieldButton + id + + + removeIndexButton + id + + + resetAutoIncrementLine + id + + + resetAutoIncrementSheet + id + + + resetAutoIncrementValue + id + + + structureGrabber + id + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tableInfoInstance + SPTableInfo + + + tableSourceView + SPTableView + + + tablesIndexesSplitView + NSSplitView + + + tablesListInstance + SPTablesList + + + viewColumnsMenu + id + + + + IBProjectSource + ../Source/SPTableStructure.h + + + + SPTableStructure + + id + id + id + id + id + id + NSMenuItem + id + + + + addField: + id + + + closeSheet: + id + + + duplicateField: + id + + + removeField: + id + + + resetAutoIncrement: + id + + + showOptimizedFieldType: + id + + + toggleColumnView: + NSMenuItem + + + unhideIndexesView: + id + + + + IBProjectSource + ../Source/SPTableStructure.m + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.h + + + + SPTableStructure + + reloadTable: + id + + + reloadTable: + + reloadTable: + id + + + + IBProjectSource + ../Source/SPTableStructureLoading.m + + + + SPTableView + NSTableView + + IBProjectSource + ../Source/SPTableView.h + + + + SPTablesList + NSObject + + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + id + NSMenuItem + NSMenuItem + id + NSButton + id + id + id + id + SPDatabaseData + NSMenuItem + NSMenuItem + id + NSSearchField + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + SPHistoryController + id + SPTableContent + id + SPDatabaseDocument + id + id + id + SPSplitView + SPSplitView + id + id + SPTableStructure + id + id + SPTableView + id + id + id + id + NSMenuItem + + + + addTableButton + id + + + copyCreateSyntaxContextMenuItem + NSMenuItem + + + copyCreateSyntaxMenuItem + NSMenuItem + + + copyTableButton + id + + + copyTableContentSwitch + NSButton + + + copyTableMessageField + id + + + copyTableNameField + id + + + copyTableSheet + id + + + customQueryInstance + id + + + databaseDataInstance + SPDatabaseData + + + duplicateTableContextMenuItem + NSMenuItem + + + duplicateTableMenuItem + NSMenuItem + + + extendedTableInfoInstance + id + + + listFilterField + NSSearchField + + + openTableInNewTabContextMenuItem + NSMenuItem + + + openTableInNewTabMenuItem + NSMenuItem + + + openTableInNewWindowContextMenuItem + NSMenuItem + + + openTableInNewWindowMenuItem + NSMenuItem + + + removeTableContextMenuItem + NSMenuItem + + + removeTableMenuItem + NSMenuItem + + + renameTableContextMenuItem + NSMenuItem + + + renameTableMenuItem + NSMenuItem + + + separatorTableContextMenuItem + NSMenuItem + + + separatorTableContextMenuItem2 + NSMenuItem + + + separatorTableContextMenuItem3 + NSMenuItem + + + separatorTableMenuItem + NSMenuItem + + + separatorTableMenuItem2 + NSMenuItem + + + separatorTableMenuItem3 + NSMenuItem + + + showCreateSyntaxContextMenuItem + NSMenuItem + + + showCreateSyntaxMenuItem + NSMenuItem + + + spHistoryControllerInstance + SPHistoryController + + + tableCollationButton + id + + + tableContentInstance + SPTableContent + + + tableDataInstance + id + + + tableDocumentInstance + SPDatabaseDocument + + + tableDumpInstance + id + + + tableEncodingButton + id + + + tableInfoInstance + id + + + tableListFilterSplitView + SPSplitView + + + tableListSplitView + SPSplitView + + + tableNameField + id + + + tableSheet + id + + + tableSourceInstance + SPTableStructure + + + tableTriggersInstance + id + + + tableTypeButton + id + + + tablesListView + SPTableView + + + toolbarActionsButton + id + + + toolbarAddButton + id + + + toolbarReloadButton + id + + + truncateTableButton + id + + + truncateTableContextMenuItem + NSMenuItem + + + + IBProjectSource + ../Source/SPTablesList.h + + + + SPTablesList + + id + id + id + id + id + id + id + id + id + id + id + id + + + + addTable: + id + + + closeSheet: + id + + + copyTable: + id + + + openTableInNewTab: + id + + + openTableInNewWindow: + id + + + removeTable: + id + + + renameTable: + id + + + tableEncodingButtonChanged: + id + + + togglePaneCollapse: + id + + + truncateTable: + id + + + updateFilter: + id + + + updateTables: + id + + + + IBProjectSource + ../Source/SPTablesList.m + + + + SPTextView + NSTextView + + showMySQLHelpForCurrentWord: + id + + + showMySQLHelpForCurrentWord: + + showMySQLHelpForCurrentWord: + id + + + + SPCustomQuery + NSScrollView + SPDatabaseDocument + SPTablesList + + + + customQueryInstance + SPCustomQuery + + + scrollView + NSScrollView + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTextView.h + + + + SPTextView + + id + id + + + + printDocument: + id + + + showMySQLHelpForCurrentWord: + id + + + + IBProjectSource + ../Source/SPTextView.m + + + + 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/Interfaces/English.lproj/UserManagerView.xib b/Interfaces/English.lproj/UserManagerView.xib index 7f0e0d6a..9939ae49 100644 --- a/Interfaces/English.lproj/UserManagerView.xib +++ b/Interfaces/English.lproj/UserManagerView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 5056 + 6254 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 5056 + 6254 NSArrayController @@ -123,7 +123,7 @@ 134217728 - .LucidaGrandeUI + YES 13 1044 @@ -178,7 +178,7 @@ 67108928 134350848 - .LucidaGrandeUI + YES 11 3100 @@ -2728,7 +2728,7 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 NO - + treeController @@ -5901,11 +5901,9 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 id id id - id id id id - id @@ -5960,10 +5958,6 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 moveSelectionLineUp: id - - orderFrontSharingServicePicker: - id - selectCurrentLine: id @@ -5976,14 +5970,101 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 selectEnclosingBrackets: id - - toggleQuickLookPreviewPanel: + + + IBProjectSource + ../Source/SPTextViewAdditions.h + + + + NSTextView + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: id IBProjectSource - ./Classes/NSTextView.h + ../Source/SPTextViewAdditions.m @@ -5991,7 +6072,7 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 NSOutlineView IBProjectSource - ./Classes/SPOutlineView.h + ../Source/SPOutlineView.h @@ -6024,7 +6105,25 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 IBProjectSource - ./Classes/SPSplitView.h + ../Source/SPSplitView.h + + + + SPSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBProjectSource + ../Source/SPSplitView.m @@ -6195,7 +6294,83 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 IBProjectSource - ./Classes/SPUserManager.h + ../Source/SPUserManager.h + + + + SPUserManager + + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addHost: + id + + + addSchemaPriv: + id + + + addUser: + id + + + checkAllPrivileges: + id + + + closeErrorsSheet: + id + + + doApply: + id + + + doCancel: + id + + + doubleClickSchemaPriv: + id + + + refresh: + id + + + removeHost: + id + + + removeSchemaPriv: + id + + + removeUser: + id + + + uncheckAllPrivileges: + id + + + + IBProjectSource + ../Source/SPUserManager.m @@ -6203,10 +6378,6 @@ IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4 0 IBCocoaFramework YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 -- cgit v1.2.3 From 420c213ed173f27d5cb09e207e9087fd4396dfd7 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 19 Dec 2014 17:59:01 +0100 Subject: Add GUI option for utf8mb4 connection encoding --- Interfaces/English.lproj/MainMenu.xib | 25 +++++++++ Interfaces/English.lproj/Preferences.xib | 94 ++++++++++++++++++++++++++++++-- 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index f7f90893..73c3505d 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -1420,6 +1420,16 @@ 20 + + + 4-Byte UTF-8 Unicode (utf8mb4) + + 1048576 + 2147483647 + + + 190 + UTF-8 Unicode via Latin 1 @@ -3177,6 +3187,14 @@ jS0-aP-Y7o + + + chooseEncoding: + + + + KxK-Oo-Rsq + delegate @@ -4288,6 +4306,7 @@ + @@ -4772,6 +4791,11 @@ + + JtW-Ko-SuZ + + + @@ -5402,6 +5426,7 @@ com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index e55bd02e..cc925927 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -93,8 +93,9 @@ {580, 172} + - {{0, 0}, {2560, 1418}} + {{0, 0}, {1920, 1178}} {580, 72} {10000000000000, 10000000000000} YES @@ -261,7 +262,7 @@ {227, 114} - {{0, 0}, {2560, 1418}} + {{0, 0}, {1920, 1178}} {227, 136} {247, 146} YES @@ -556,7 +557,7 @@ {264, 225} - {{0, 0}, {2560, 1418}} + {{0, 0}, {1920, 1178}} {264, 247} {264, 296} YES @@ -571,6 +572,7 @@ {{201, 121}, {254, 26}} + YES -2076180416 @@ -650,6 +652,18 @@ 20 + + + 4-Byte UTF-8 Unicode (utf8mb4) + + 1048576 + 2147483647 + + + _popUpItemAction: + 190 + + YES @@ -929,6 +943,7 @@ {{202, 214}, {362, 18}} + YES 67108864 @@ -958,6 +973,7 @@ {{11, 242}, {187, 17}} + YES 68157504 @@ -977,6 +993,7 @@ {{201, 236}, {254, 26}} + YES -2076180416 @@ -1010,6 +1027,7 @@ {{17, 85}, {182, 17}} + YES 68157504 @@ -1029,6 +1047,7 @@ {{17, 127}, {182, 17}} + YES 68157504 @@ -1048,6 +1067,7 @@ {{202, 84}, {360, 18}} + YES 67108864 @@ -1072,6 +1092,7 @@ {{202, 62}, {360, 18}} + YES 67108864 @@ -1096,6 +1117,7 @@ {{202, 156}, {360, 5}} + {0, 0} 67108864 @@ -1119,6 +1141,7 @@ {{204, 108}, {358, 5}} + {0, 0} 67108864 @@ -1142,6 +1165,7 @@ {{204, 53}, {357, 5}} + {0, 0} 67108864 @@ -1165,6 +1189,7 @@ {{17, 23}, {181, 17}} + YES 68157504 @@ -1184,6 +1209,7 @@ {{203, 20}, {38, 22}} + YES -1804599231 @@ -1239,6 +1265,7 @@ {{247, 23}, {316, 17}} + YES 68157504 @@ -1258,6 +1285,7 @@ {{201, 169}, {254, 26}} + YES -2076180416 @@ -1382,6 +1410,7 @@ {{17, 175}, {182, 17}} + YES 68157504 @@ -1401,6 +1430,7 @@ {{202, 204}, {360, 5}} + {0, 0} 67108864 @@ -1422,10 +1452,11 @@ {580, 280} + NSView - + 268 @@ -1433,6 +1464,8 @@ 268 {{422, 14}, {144, 32}} + + YES 67108864 @@ -1454,6 +1487,8 @@ 268 {{205, 20}, {194, 22}} + + YES -2076180416 @@ -1473,6 +1508,8 @@ 268 {{202, 59}, {361, 26}} + + YES -2076180416 @@ -1542,6 +1579,8 @@ 268 {{17, 25}, {181, 17}} + + YES 68157504 @@ -1560,6 +1599,8 @@ 268 {{17, 65}, {182, 17}} + + YES 68157504 @@ -1578,6 +1619,8 @@ 12 {{205, 89}, {355, 5}} + + {0, 0} 67108864 @@ -1600,6 +1643,8 @@ 268 {{203, 241}, {359, 18}} + + YES 67108864 @@ -1623,6 +1668,8 @@ 268 {{17, 280}, {183, 17}} + + YES 67108928 @@ -1641,6 +1688,8 @@ 268 {{499, 147}, {64, 17}} + + YES 67108928 @@ -1659,6 +1708,8 @@ 268 {{203, 281}, {359, 18}} + + YES -2080374784 @@ -1682,6 +1733,8 @@ 268 {{203, 146}, {189, 18}} + + YES 67108864 @@ -1705,6 +1758,8 @@ 268 {{203, 261}, {359, 18}} + + YES -2080374784 @@ -1728,6 +1783,8 @@ 268 {{478, 141}, {19, 27}} + + YES 786464 @@ -1747,6 +1804,8 @@ 268 {{398, 144}, {75, 22}} + + YES -1804599232 @@ -1803,6 +1862,8 @@ 268 {{17, 102}, {182, 17}} + + YES 68157504 @@ -1821,6 +1882,8 @@ 268 {{205, 100}, {75, 22}} + + YES -1804599231 @@ -1841,6 +1904,8 @@ 268 {{203, 201}, {359, 18}} + + YES 67108864 @@ -1864,6 +1929,8 @@ 12 {{205, 48}, {355, 5}} + + {0, 0} 67108864 @@ -1886,6 +1953,8 @@ 12 {{205, 227}, {355, 5}} + + {0, 0} 67108864 @@ -1908,6 +1977,8 @@ 12 {{205, 172}, {355, 5}} + + {0, 0} 67108864 @@ -1930,6 +2001,8 @@ 12 {{205, 133}, {355, 5}} + + {0, 0} 67108864 @@ -1952,6 +2025,8 @@ 268 {{203, 181}, {359, 18}} + + YES -2080374784 @@ -1972,6 +2047,9 @@ {580, 319} + + + NSView @@ -5580,6 +5658,7 @@ AQAAAAA + Default Encoding Dropdown 25 @@ -5618,6 +5697,7 @@ AQAAAAA + @@ -7653,6 +7733,11 @@ AQAAAAA + + 7W6-DM-PG1 + + + @@ -8080,6 +8165,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin -- cgit v1.2.3 From 6a9ec56f2b12c7269589471e9a116a4515524520 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Dec 2014 06:14:17 +0100 Subject: Change CSV field mapper table highlight style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Purely guessing here…) --- Interfaces/English.lproj/DataMigrationDialog.xib | 1 - 1 file changed, 1 deletion(-) diff --git a/Interfaces/English.lproj/DataMigrationDialog.xib b/Interfaces/English.lproj/DataMigrationDialog.xib index 09e05118..c6afb178 100644 --- a/Interfaces/English.lproj/DataMigrationDialog.xib +++ b/Interfaces/English.lproj/DataMigrationDialog.xib @@ -533,7 +533,6 @@ 15 0 YES - 1 1 1 -- cgit v1.2.3 From 21ced682547ef855ac6d83a00ad7fda1b8225af3 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Dec 2014 13:14:06 +0100 Subject: Fix two threading issues * A call of setString: from background thread which could cause a "deleted thread with uncommitted CATransaction" warning * SPFieldMapperController was allocated from a background thread with an own autoreleasepool, while it contains UI objects. This could cause a crash when the autoreleasepool was drained and the field mapper forcefully released, while other UI objects still had it retained. --- Source/SPDataImport.m | 54 +++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index b0355b05..5859b75d 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -754,7 +754,7 @@ if ([csvFileHandle compressionFormat] == SPBzip2Compression) useIndeterminate = YES; // Reset progress interface - [errorsView setString:@""]; + [[errorsView onMainThread] setString:@""]; [[singleProgressTitle onMainThread] setStringValue:NSLocalizedString(@"Importing CSV", @"text showing that the application is importing CSV")]; [[singleProgressText onMainThread] setStringValue:NSLocalizedString(@"Reading...", @"text showing that app is reading dump")]; [[singleProgressBar onMainThread] setIndeterminate:YES]; @@ -1240,29 +1240,33 @@ fieldMapperSheetStatus = SPFieldMapperInProgress; fieldMappingArrayHasGlobalVariables = NO; - // Init the field mapper controller - fieldMapperController = [(SPFieldMapperController *)[SPFieldMapperController alloc] initWithDelegate:self]; - [fieldMapperController setConnection:mySQLConnection]; - [fieldMapperController setSourcePath:filename]; - [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state] isPreview:fieldMappingImportArrayIsPreview]; - - // Show field mapper sheet and set the focus to it - [[NSApp onMainThread] beginSheet:[fieldMapperController window] - modalForWindow:[tableDocumentInstance parentWindow] - modalDelegate:self - didEndSelector:@selector(fieldMapperDidEndSheet:returnCode:contextInfo:) - contextInfo:nil]; - - [[[fieldMapperController window] onMainThread] makeKeyWindow]; + //the field mapper is an UI object and must not be caught in the background thread's autoreleasepool + dispatch_async(dispatch_get_main_queue(), ^{ + // Init the field mapper controller + fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self]; + [fieldMapperController setConnection:mySQLConnection]; + [fieldMapperController setSourcePath:filename]; + [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state] isPreview:fieldMappingImportArrayIsPreview]; + + // 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]; + + [[fieldMapperController window] makeKeyWindow]; + }); // Wait for field mapper sheet while (fieldMapperSheetStatus == SPFieldMapperInProgress) usleep(100000); + + BOOL success = NO; // If the mapping was cancelled, abort the import if (fieldMapperSheetStatus == SPFieldMapperCancelled) { - if (fieldMapperController) [fieldMapperController release]; - return NO; + goto cleanup; } // Get mapping settings and preset some global variables @@ -1288,9 +1292,8 @@ || ![selectedTableTarget length] || ![csvImportHeaderString length]) { - if(fieldMapperController) [fieldMapperController release]; NSBeep(); - return NO; + goto cleanup; } // Store target table definitions @@ -1312,13 +1315,14 @@ [importFieldNamesSwitch setState:[fieldMapperController importFieldNamesHeader]]; [prefs setBool:[importFieldNamesSwitch state] forKey:SPCSVImportFirstLineIsHeader]; + success = YES; + +cleanup: + dispatch_async(dispatch_get_main_queue(), ^{ + if(fieldMapperController) [fieldMapperController release], fieldMapperController = nil; + }); - if(fieldMapperController) [fieldMapperController release]; - - if(fieldMapperSheetStatus == SPFieldMapperCompleted) - return YES; - else - return NO; + return success; } /** -- cgit v1.2.3 From 03d11e5d82a7c2a0c5db624020632a7d10b5a13a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Dec 2014 15:05:58 +0100 Subject: Add some more stub code (as the nib loader on 10.10 is even whinier) --- Source/SPTableContent.h | 3 +++ Source/SPTableContentFilterController.h | 13 ++++++++++++- Source/SPTableRelations.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h index fdb434e8..15266d4e 100644 --- a/Source/SPTableContent.h +++ b/Source/SPTableContent.h @@ -48,6 +48,7 @@ #ifndef SP_CODA @class SPSplitView; #endif +@class SPTableContentFilterController; #import "SPDatabaseContentViewDelegate.h" @@ -116,6 +117,8 @@ // Temporary to avoid nib conflicts during WIP IBOutlet SPSplitView *contentSplitView; + + IBOutlet SPTableContentFilterController *filterControllerInstance; #endif SPMySQLConnection *mySQLConnection; diff --git a/Source/SPTableContentFilterController.h b/Source/SPTableContentFilterController.h index 15880416..542f4bad 100644 --- a/Source/SPTableContentFilterController.h +++ b/Source/SPTableContentFilterController.h @@ -5,6 +5,17 @@ #import -@interface SPTableContentFilterController : NSObject +@class SPSplitView; +@class SPTableData; +@class SPDatabaseDocument; +@class SPTablesList; + +@interface SPTableContentFilterController : NSObject { + IBOutlet SPSplitView *contentSplitView; + IBOutlet NSRuleEditor *filterRuleEditor; + IBOutlet SPTableData *tableDataInstance; + IBOutlet SPDatabaseDocument *tableDocumentInstance; + IBOutlet SPTablesList *tablesListInstance; +} @end diff --git a/Source/SPTableRelations.h b/Source/SPTableRelations.h index e1620007..4bb998c9 100644 --- a/Source/SPTableRelations.h +++ b/Source/SPTableRelations.h @@ -39,6 +39,7 @@ IBOutlet SPDatabaseDocument *tableDocumentInstance; IBOutlet SPTablesList *tablesListInstance; IBOutlet SPTableData *tableDataInstance; + IBOutlet SPTableView *tableList; IBOutlet NSButton *addRelationButton; IBOutlet NSButton *removeRelationButton; -- cgit v1.2.3 From c7362cc8c6d3c02d8e9b5f5a31735bb3fbbf0b02 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 26 Dec 2014 20:37:39 +0100 Subject: ************** IMPORTANT: SEE BELOW ************** MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change should fix the "slow CSV import dialog" issue on 10.10 (details below). To accomplish that, some major changes had to be made to the CSV import code. PLEASE VERIFY THE CORRECTNESS OF THE NEXT FEW CSV IMPORTS YOU DO! * Renamed some variables for better search visibility * Changed some instances where NSNumbers were being compared using "==" instead of "isEqual…" (does not work with object literals!) * The CSV import dialog would recreate the popup menus on *every* call to "tableView:objectValueFor…". However Instruments suggests that [NSMenu removeAllItems] and [NSMenu addItemsWithTitles:] are **really** expensive, esp. when called multiple times per second (e.g. when scrolling in the table view). This commit moves the popup menu setup into its own method and only calls it when the data actually changes. * The 'destination table column' was for some reason a NSPopupButtonCell which only ever had one item and sometimes got changed to a NSTextFieldCell in code. I didn't see any need to keep the popup cell and replaced it with a simple text cell. --- Interfaces/English.lproj/DataMigrationDialog.xib | 220 +++++++++++++-------- Source/SPFieldMapperController.h | 9 +- Source/SPFieldMapperController.m | 234 ++++++++++++----------- 3 files changed, 268 insertions(+), 195 deletions(-) diff --git a/Interfaces/English.lproj/DataMigrationDialog.xib b/Interfaces/English.lproj/DataMigrationDialog.xib index c6afb178..740dedcb 100644 --- a/Interfaces/English.lproj/DataMigrationDialog.xib +++ b/Interfaces/English.lproj/DataMigrationDialog.xib @@ -78,11 +78,13 @@ {{1, 1}, {656, 0}} + {{-12, 53}, {658, 2}} + {0, 0} 67108864 @@ -131,6 +133,7 @@ {{14, 12}, {604, 17}} + YES 68157504 @@ -170,6 +173,7 @@ {{512, 51}, {226, 32}} + YES 67108864 @@ -192,6 +196,7 @@ {{664, 1}, {226, 32}} + YES 67108864 @@ -214,6 +219,7 @@ {{668, 1}, {226, 32}} + YES 67108864 @@ -234,11 +240,13 @@ {{1, 1}, {634, 39}} + {{-1, 308}, {636, 41}} + {0, 0} 67108864 @@ -275,6 +283,7 @@ {634, 126} + YES NO YES @@ -284,6 +293,7 @@ {634, 17} + @@ -292,6 +302,7 @@ {{-22, 0}, {12, 17}} + @@ -326,32 +337,32 @@ 400 75 - - - Pop Up - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - + YES OtherViews - + + + Pop Up + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + -1 3 YES YES @@ -429,42 +440,15 @@ - - -2076180416 - 133120 + + 337641537 + 272762880 + Text + _NS:9 - 100679680 - 129 - - - 400 - 75 - - - YES - Pop Up - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - - - - - YES - 3 - YES - YES + + 3 YES @@ -570,6 +554,7 @@ {{413, 18}, {11, 140}} + NO 256 @@ -582,6 +567,7 @@ {{-100, -100}, {227, 11}} + NO 257 @@ -594,7 +580,7 @@ {{-1, 129}, {636, 144}} - + 133650 @@ -612,6 +598,7 @@ {{415, 12}, {102, 32}} + YES 67108864 @@ -664,6 +651,7 @@ {{20, 19}, {32, 24}} + YES 603979776 @@ -690,6 +678,7 @@ {{51, 19}, {32, 24}} + 1 YES @@ -718,6 +707,7 @@ {{88, 23}, {195, 14}} + YES 67108928 @@ -737,6 +727,7 @@ {{361, 278}, {200, 22}} + YES -2076180416 @@ -769,6 +760,7 @@ {{484, 97}, {133, 22}} + YES -2076180416 @@ -834,6 +826,7 @@ {{302, 102}, {180, 14}} + YES 68157504 @@ -857,6 +850,7 @@ {{5, 280}, {316, 20}} + YES 69206081 @@ -879,6 +873,7 @@ {{17, 100}, {275, 18}} + YES -2080374784 @@ -908,6 +903,7 @@ {{484, 73}, {133, 22}} + YES -2076180416 @@ -991,6 +987,7 @@ {{302, 79}, {180, 14}} + YES 68157504 @@ -1010,6 +1007,7 @@ {{326, 12}, {82, 32}} + YES 67108864 @@ -1032,6 +1030,7 @@ {{11, 56}, {29, 26}} + YES 67108864 @@ -1059,6 +1058,7 @@ {{17, 8}, {100, 18}} + YES 67108864 @@ -1083,6 +1083,7 @@ {{132, 8}, {80, 18}} + 1 YES @@ -1106,6 +1107,7 @@ {{200, 20}, {230, 44}} + NSView @@ -1118,6 +1120,7 @@ {{227, 62}, {335, 18}} + YES -2080374784 @@ -1169,6 +1172,7 @@ {400, 37} + @@ -1257,6 +1261,7 @@ {{386, 1}, {15, 37}} + NO 512 @@ -1270,6 +1275,7 @@ {{-100, -100}, {87, 15}} + NO 513 @@ -1281,7 +1287,7 @@ {{20, 20}, {402, 39}} - + 133650 @@ -1296,6 +1302,7 @@ {{227, 85}, {104, 18}} + YES 67108864 @@ -1320,6 +1327,7 @@ {{17, 85}, {100, 18}} + YES 67108864 @@ -1344,6 +1352,7 @@ {{17, 62}, {181, 18}} + 2 YES @@ -1369,6 +1378,7 @@ {{137, 85}, {80, 18}} + 1 YES @@ -1394,6 +1404,7 @@ {{354, 85}, {70, 18}} + YES 67108864 @@ -1416,6 +1427,7 @@ {{93, -57}, {442, 121}} + NSView @@ -1428,6 +1440,7 @@ {{212, 8}, {335, 18}} + YES 67108864 @@ -1452,6 +1465,7 @@ {{17, 8}, {100, 18}} + YES 67108864 @@ -1476,6 +1490,7 @@ {{132, 8}, {70, 18}} + YES 67108864 @@ -1498,6 +1513,7 @@ {{110, 20}, {390, 44}} + NSView @@ -1506,6 +1522,7 @@ {{34, 58}, {58, 23}} + YES -2080374784 @@ -1528,6 +1545,7 @@ {{487, 280}, {106, 19}} + YES -1804599231 @@ -1553,6 +1571,7 @@ {{402, 283}, {80, 14}} + YES 68157504 @@ -1572,6 +1591,7 @@ {{599, 280}, {20, 20}} + YES 67108864 @@ -1598,6 +1618,7 @@ {{566, 281}, {61, 17}} + YES -2080374784 @@ -1618,8 +1639,9 @@ {634, 348} + - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {634, 370} {10000000000000, 10000000000000} SPCSVFieldMappingSheet @@ -2031,7 +2053,7 @@ {311, 210} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {311, 208} {10000000000000, 10000000000000} @@ -2339,7 +2361,7 @@ {269, 120} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {269, 142} {269, 142} YES @@ -3068,6 +3090,14 @@ 427 + + + delegate + + + + 9Jp-DU-vql + delegate @@ -4156,7 +4186,7 @@ 48 - + @@ -4173,27 +4203,6 @@ - - 92 - - - - - - - - 93 - - - - - - - - 94 - - - 89 @@ -4290,6 +4299,11 @@ + + 1SY-mK-knt + + + @@ -4405,6 +4419,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -4600,9 +4615,6 @@ 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 @@ -7445,6 +7457,7 @@ id NSPopUpButton id + SPTableContentFilterController NSButton NSButton NSButton @@ -7524,6 +7537,10 @@ filterButton id + + filterControllerInstance + SPTableContentFilterController + filterTableClearButton NSButton @@ -7774,6 +7791,43 @@ ../Source/SPTableContent.m + + SPTableContentFilterController + NSObject + + SPSplitView + NSRuleEditor + SPTableData + SPDatabaseDocument + SPTablesList + + + + contentSplitView + SPSplitView + + + filterRuleEditor + NSRuleEditor + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableContentFilterController.h + + SPTableData NSObject diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h index a12adcb8..76b65c49 100644 --- a/Source/SPFieldMapperController.h +++ b/Source/SPFieldMapperController.h @@ -33,7 +33,7 @@ @class SPTablesList; @class SPMySQLConnection; -@interface SPFieldMapperController : NSWindowController +@interface SPFieldMapperController : NSWindowController { IBOutlet SPTableView *fieldMapperTableView; IBOutlet NSScrollView *fieldMapperTableScrollView; @@ -110,9 +110,9 @@ NSMutableArray *fieldMappingTableDefaultValues; NSMutableArray *defaultFieldTypesForComboBox; - NSNumber *doImport; - NSNumber *doNotImport; - NSNumber *isEqual; + NSNumber *doImportKey; + NSNumber *doNotImportKey; + NSNumber *isEqualKey; NSString *doImportString; NSString *doNotImportString; NSString *isEqualString; @@ -135,6 +135,7 @@ NSUInteger windowMinHeigth; NSInteger numberOfImportColumns; NSInteger fieldMappingCurrentRow; + NSInteger firstDefaultItemOffset; BOOL fieldMappingImportArrayIsPreview; BOOL importFieldNamesHeader; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index a79c8a40..2fcf4c9e 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -53,6 +53,10 @@ static NSString *SPTableViewSqlColumnID = @"sql"; static NSUInteger SPSourceColumnTypeText = 0; static NSUInteger SPSourceColumnTypeInteger = 1; +@interface SPFieldMapperController (Private) +- (void)_setupFieldMappingPopUpMenus; +@end + @implementation SPFieldMapperController @synthesize sourcePath; @@ -85,9 +89,9 @@ static NSUInteger SPSourceColumnTypeInteger = 1; lastDisabledCSVFieldcolumn = @0; - doImport = @0; - doNotImport = @1; - isEqual = @2; + doImportKey = @0; + doNotImportKey = @1; + isEqualKey = @2; doImportString = @"―"; doNotImportString = @" "; isEqualString = @"="; @@ -215,20 +219,20 @@ static NSUInteger SPSourceColumnTypeInteger = 1; - (void)dealloc { - if (mySQLConnection) [mySQLConnection release]; - if (sourcePath) [sourcePath release]; - if (fieldMappingTableColumnNames) [fieldMappingTableColumnNames release]; - if (defaultFieldTypesForComboBox) [defaultFieldTypesForComboBox release]; - if (fieldMappingTableTypes) [fieldMappingTableTypes release]; - if (fieldMappingArray) [fieldMappingArray release]; - if (fieldMappingButtonOptions) [fieldMappingButtonOptions release]; - if (fieldMappingOperatorOptions) [fieldMappingOperatorOptions release]; - if (fieldMappingOperatorArray) [fieldMappingOperatorArray release]; - if (fieldMappingGlobalValues) [fieldMappingGlobalValues release]; - if (fieldMappingGlobalValuesSQLMarked) [fieldMappingGlobalValuesSQLMarked release]; - if (fieldMappingTableDefaultValues) [fieldMappingTableDefaultValues release]; - if (primaryKeyFields) [primaryKeyFields release]; - if (toBeEditedRowIndexes) [toBeEditedRowIndexes release]; + if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil; + if (sourcePath) [sourcePath release], sourcePath = nil; + if (fieldMappingTableColumnNames) [fieldMappingTableColumnNames release], fieldMappingTableColumnNames = nil; + if (defaultFieldTypesForComboBox) [defaultFieldTypesForComboBox release], defaultFieldTypesForComboBox = nil; + if (fieldMappingTableTypes) [fieldMappingTableTypes release], fieldMappingTableTypes = nil; + if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; + if (fieldMappingButtonOptions) [fieldMappingButtonOptions release], fieldMappingButtonOptions = nil; + if (fieldMappingOperatorOptions) [fieldMappingOperatorOptions release], fieldMappingOperatorOptions = nil; + if (fieldMappingOperatorArray) [fieldMappingOperatorArray release], fieldMappingOperatorArray = nil; + if (fieldMappingGlobalValues) [fieldMappingGlobalValues release], fieldMappingGlobalValues = nil; + if (fieldMappingGlobalValuesSQLMarked) [fieldMappingGlobalValuesSQLMarked release], fieldMappingGlobalValuesSQLMarked = nil; + if (fieldMappingTableDefaultValues) [fieldMappingTableDefaultValues release], fieldMappingTableDefaultValues = nil; + if (primaryKeyFields) [primaryKeyFields release], primaryKeyFields = nil; + if (toBeEditedRowIndexes) [toBeEditedRowIndexes release], toBeEditedRowIndexes = nil; [super dealloc]; } @@ -309,7 +313,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; { NSInteger i = 0; for(id item in fieldMappingArray) { - if([item intValue] >= numberOfImportColumns && NSArrayObjectAtIndex(fieldMappingOperatorArray, i) != doNotImport) + if([item intValue] >= numberOfImportColumns && ![doNotImportKey isEqualToNumber:NSArrayObjectAtIndex(fieldMappingOperatorArray, i)]) return YES; i++; } @@ -455,7 +459,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; for(columnIndex = 0; columnIndex < numberOfColumns; columnIndex++) { // Skip fields which aren't marked as imported - if ([fieldMappingOperatorArray objectAtIndex:columnIndex] != doImport) { + if (![doImportKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:columnIndex]]) { continue; } @@ -610,16 +614,16 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [self updateFieldMappingButtonCell]; [self updateFieldMappingOperatorOptions]; - // Set all operators to doNotImport + // Set all operators to doNotImportKey [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) - [fieldMappingOperatorArray addObject:doNotImport]; + [fieldMappingOperatorArray addObject:doNotImportKey]; // Set the first n operators to doImport if([fieldMappingImportArray count]) { NSUInteger possibleImports = ([NSArrayObjectAtIndex(fieldMappingImportArray, 0) count] > [fieldMappingTableColumnNames count]) ? [fieldMappingTableColumnNames count] : [NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]; for(i=0; i < possibleImports; i++) - [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doImport]; + [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doImportKey]; } // Disable Import button if no fields are available @@ -638,6 +642,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [self updateFieldNameAlignment]; + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; } @@ -686,12 +691,12 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [advancedBox setHidden:YES]; } - // If operator is set to = for UPDATE method replace it by doNotImport + // If operator is set to = for UPDATE method replace it by doNotImportKey if(![[importMethodPopup titleOfSelectedItem] isEqualToString:@"UPDATE"]) { [advancedButton setEnabled:YES]; for(i=0; i<[fieldMappingTableColumnNames count]; i++) { - if([fieldMappingOperatorArray objectAtIndex:i] == isEqual) { - [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doNotImport]; + if([isEqualKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:i]]) { + [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doNotImportKey]; } } } else { @@ -701,6 +706,8 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [self validateImportButton]; [self updateFieldMappingOperatorOptions]; + + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; } @@ -715,23 +722,23 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if(possibleImports < 1) return; - // Set all operators to doNotImport + // Set all operators to doNotImportKey [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) - [fieldMappingOperatorArray addObject:doNotImport]; + [fieldMappingOperatorArray addObject:doNotImportKey]; switch([[alignByPopup selectedItem] tag]) { case 0: // file order for(j=0; j=0; j--) { [fieldMappingArray replaceObjectAtIndex:possibleImports-j withObject:[NSNumber numberWithInteger:j]]; - [fieldMappingOperatorArray replaceObjectAtIndex:possibleImports-j withObject:doImport]; + [fieldMappingOperatorArray replaceObjectAtIndex:possibleImports - j withObject:doImportKey]; } break; case 2: // try to align header and table target field names via Levenshtein distance @@ -914,11 +921,12 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [self updateFieldMappingButtonCell]; [self updateFieldMappingOperatorOptions]; - // Set all operators to doNotImport + // Set all operators to doNotImportKey [fieldMappingOperatorArray removeAllObjects]; for (i=0; i < [fieldMappingTableColumnNames count]; i++) - [fieldMappingOperatorArray addObject:doImport]; + [fieldMappingOperatorArray addObject:doImportKey]; + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; [self validateImportButton]; } @@ -929,7 +937,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; - (IBAction)addNewColumn:(id)sender { - [fieldMappingOperatorArray addObject:doNotImport]; + [fieldMappingOperatorArray addObject:doNotImportKey]; [fieldMappingTableColumnNames addObject:NSLocalizedString(@"New Column Name", @"new column name placeholder string")]; [fieldMappingTableTypes addObject:@"VARCHAR(255)"]; [fieldMappingTableDefaultValues addObject:@""]; @@ -939,6 +947,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [fieldMappingArray addObject:[NSNumber numberWithInteger:newIndex]]; [toBeEditedRowIndexes addIndex:newIndex]; + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; [fieldMapperTableView editColumn:2 row:newIndex withEvent:nil select:YES]; @@ -977,6 +986,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; currentIndex = [toBeEditedRowIndexes indexGreaterThanIndex:currentIndex]; } + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; } @@ -1175,9 +1185,9 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [fieldMappingArray replaceObjectAtIndex:[fieldMapperTableView selectedRow] withObject:[NSNumber numberWithInteger:[globalValuesTableView selectedRow]+numberOfImportColumns]]; - // Set corresponding operator to doImport if not set to isEqual - if([fieldMappingOperatorArray objectAtIndex:[fieldMapperTableView selectedRow]] != isEqual) - [fieldMappingOperatorArray replaceObjectAtIndex:[fieldMapperTableView selectedRow] withObject:doImport]; + // Set corresponding operator to doImport if not set to isEqualKey + if(![isEqualKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:[fieldMapperTableView selectedRow]]]) + [fieldMappingOperatorArray replaceObjectAtIndex:[fieldMapperTableView selectedRow] withObject:doImportKey]; [fieldMapperTableView reloadData]; @@ -1444,7 +1454,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Set best match [fieldMappingArray replaceObjectAtIndex:match.location withObject:[NSNumber numberWithInteger:match.length]]; - [fieldMappingOperatorArray replaceObjectAtIndex:match.location withObject:doImport]; + [fieldMappingOperatorArray replaceObjectAtIndex:match.location withObject:doImportKey]; // Remember matched pair [matchedTable addObject:[m objectForKey:@"table"]]; @@ -1508,6 +1518,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. %@", (long)i+1, NSArrayObjectAtIndex(fieldMappingGlobalValues, i)]]; } + [self _setupFieldMappingPopUpMenus]; [fieldMapperTableView reloadData]; } @@ -1562,7 +1573,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; return; } for (NSUInteger i = 0; i < [fieldMappingTableColumnNames count]; i++) { - if (![[fieldMappingTableColumnNames objectAtIndex:i] length] && [fieldMappingOperatorArray objectAtIndex:i] == doImport) { + if (![[fieldMappingTableColumnNames objectAtIndex:i] length] && [doImportKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:i]]) { [importButton setEnabled:NO]; return; } @@ -1578,7 +1589,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if ([[self selectedImportMethod] isEqualToString:@"UPDATE"]) { enableImportButton = NO; for(id op in fieldMappingOperatorArray) { - if(op == isEqual) { + if([isEqualKey isEqualToNumber:op]) { enableImportButton = YES; break; } @@ -1654,9 +1665,9 @@ static NSUInteger SPSourceColumnTypeInteger = 1; && [fieldMappingOperatorArray count] && [fieldMappingTableColumnNames count]) { NSUInteger i; - NSNumber *globalValue = doImport; - if([fieldMappingOperatorArray objectAtIndex:0] == doImport) - globalValue = doNotImport; + NSNumber *globalValue = doImportKey; + if([doImportKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:0]]) + globalValue = doNotImportKey; [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) [fieldMappingOperatorArray addObject:globalValue]; @@ -1671,7 +1682,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if(aTableView == fieldMapperTableView) { - if ([fieldMappingOperatorArray objectAtIndex:rowIndex] == doNotImport) return [NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]; + if ([doNotImportKey isEqual:[fieldMappingOperatorArray objectAtIndex:rowIndex]]) return [NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]; if([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID] && [importFieldNamesHeaderSwitch state] == NSOnState) { @@ -1695,11 +1706,11 @@ static NSUInteger SPSourceColumnTypeInteger = 1; } else if([[aTableColumn identifier] isEqualToString:SPTableViewOperatorColumnID]) { - if([aCell objectValue] == doImport) + if([doImportKey isEqual:[aCell objectValue]]) return NSLocalizedString(@"Import field", @"import field operator tooltip"); - else if([aCell objectValue] == doNotImport) + else if([doNotImportKey isEqual:[aCell objectValue]]) return NSLocalizedString(@"Ignore field", @"ignore field label"); - else if([aCell objectValue] == isEqual) + else if([isEqualKey isEqual:[aCell objectValue]]) return NSLocalizedString(@"Do UPDATE where field contents match", @"do update operator tooltip"); else return @""; @@ -1715,32 +1726,64 @@ static NSUInteger SPSourceColumnTypeInteger = 1; return @""; } +- (void)menuNeedsUpdate:(NSMenu *)aMenu +{ + // Note: matching aMenu with "==" will most likely not work, as NSTableView copies it. + // This technique is based on: http://www.corbinstreehouse.com/blog/2005/07/dynamically-populating-an-nspopupbuttoncell-in-an-nstableview/ + + NSInteger rowIndex = [fieldMapperTableView selectedRow]; + if(rowIndex < 0) + return; + + NSInteger rowIndexInMenu = firstDefaultItemOffset + rowIndex; + for (NSInteger i = firstDefaultItemOffset; i < [aMenu numberOfItems]; i++) { + [[aMenu itemAtIndex:i] setHidden:(i != rowIndexInMenu)]; + } +} + +- (void)_setupFieldMappingPopUpMenus +{ + NSPopUpButtonCell *c = [[fieldMapperTableView tableColumnWithIdentifier:SPTableViewImportValueColumnID] dataCell]; + NSMenu *m = [c menu]; + [m setAutoenablesItems:NO]; + [c removeAllItems]; + [c addItemsWithTitles:fieldMappingButtonOptions]; + + [m addItem:[NSMenuItem separatorItem]]; + + [c addItemWithTitle:NSLocalizedString(@"Ignore Field", @"ignore field label")]; + [c addItemWithTitle:NSLocalizedString(@"Ignore all Fields", @"ignore all fields menu item")]; + [c addItemWithTitle:NSLocalizedString(@"Import all Fields", @"import all fields menu item")]; + if([[self selectedImportMethod] isEqualToString:@"UPDATE"]) + [c addItemWithTitle:NSLocalizedString(@"Match Field", @"match field menu item")]; + + [m addItem:[NSMenuItem separatorItem]]; + + NSMenuItem *menuItem = [m addItemWithTitle:NSLocalizedString(@"Add Value or Expression…", @"add global value or expression menu item") action:@selector(addGlobalSourceVariable:) keyEquivalent:@"g"]; + [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; + + //create all menu items for the "DEFAULT" rows. We will use menuNeedsUpdate: to hide all items that are not needed. + //This works because NSTableView will copy the menu before showing it, so menuNeedsUpdate: will work on a disposable copy + //while the full menu is never shown (but it's items are displayed in the table view) + firstDefaultItemOffset = [m numberOfItems]; + for (id item in fieldMappingTableDefaultValues) { + NSString *label = [NSString stringWithFormat:NSLocalizedString(@"Default: %@",@"import : csv field mapping : field default value"), item]; + NSMenuItem *defaultItem = [m addItemWithTitle:label action:NULL keyEquivalent:@""]; + [defaultItem setEnabled:NO]; + } + + NSPopUpButtonCell *optsCell = [[fieldMapperTableView tableColumnWithIdentifier:SPTableViewOperatorColumnID] dataCell]; + [optsCell removeAllItems]; + [optsCell addItemsWithTitles:fieldMappingOperatorOptions]; +} + - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { if(aTableView == fieldMapperTableView) { if ([[aTableColumn identifier] isEqualToString:SPTableViewTargetFieldColumnID]) { - if([toBeEditedRowIndexes containsIndex:rowIndex]) { - NSTextFieldCell *b = [[[NSTextFieldCell alloc] initTextCell:[fieldMappingTableColumnNames objectAtIndex:rowIndex]] autorelease]; - [b setEditable:YES]; - [b setFont:[NSFont systemFontOfSize:12]]; - [aTableColumn setDataCell:b]; - return b; - } - if(newTableMode) { - NSTextFieldCell *b = [[[NSTextFieldCell alloc] initTextCell:[fieldMappingTableColumnNames objectAtIndex:rowIndex]] autorelease]; - [b setEditable:YES]; - [b setFont:[NSFont systemFontOfSize:12]]; - [aTableColumn setDataCell:b]; - return b; - } else { - if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) { - [(NSPopUpButton *)[aTableColumn dataCell] removeAllItems]; - [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemWithTitle:[fieldMappingTableColumnNames objectAtIndex:rowIndex]]; - } - return [fieldMappingTableColumnNames objectAtIndex:rowIndex]; - } + return [fieldMappingTableColumnNames objectAtIndex:rowIndex]; } else if ([[aTableColumn identifier] isEqualToString:SPTableViewTypeColumnID]) { @@ -1765,45 +1808,20 @@ static NSUInteger SPSourceColumnTypeInteger = 1; else if ([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID]) { - // Check if all global value was deleted, if so set assigned field as doNotImport + // Check if all global value was deleted, if so set assigned field as doNotImportKey if([[fieldMappingArray objectAtIndex:rowIndex] unsignedIntegerValue] >= [fieldMappingButtonOptions count]) { - [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doNotImport]; + [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doNotImportKey]; } - if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) { - - NSPopUpButtonCell *c = [aTableColumn dataCell]; - NSMenu *m = [c menu]; - [m setAutoenablesItems:NO]; - [c removeAllItems]; - [c addItemsWithTitles:fieldMappingButtonOptions]; - [m addItem:[NSMenuItem separatorItem]]; - [c addItemWithTitle:NSLocalizedString(@"Ignore Field", @"ignore field label")]; - [c addItemWithTitle:NSLocalizedString(@"Ignore all Fields", @"ignore all fields menu item")]; - [c addItemWithTitle:NSLocalizedString(@"Import all Fields", @"import all fields menu item")]; - if([[self selectedImportMethod] isEqualToString:@"UPDATE"]) - [c addItemWithTitle:NSLocalizedString(@"Match Field", @"match field menu item")]; - [m addItem:[NSMenuItem separatorItem]]; - NSMenuItem *menuItem = [m addItemWithTitle:NSLocalizedString(@"Add Value or Expression…", @"add global value or expression menu item") action:@selector(addGlobalSourceVariable:) keyEquivalent:@"g"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - [c addItemWithTitle:[NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]]; - [[m itemAtIndex:[c numberOfItems]-1] setEnabled:NO]; - - // If user doesn't want to import it show its DEFAULT value if not - // UPDATE was chosen otherwise hide it. - if([fieldMappingOperatorArray objectAtIndex:rowIndex] != doNotImport) - return [fieldMappingArray objectAtIndex:rowIndex]; - else if(![[self selectedImportMethod] isEqualToString:@"UPDATE"]) - return [NSNumber numberWithInteger:[c numberOfItems]-1]; - - } + // If user doesn't want to import it show its DEFAULT value if not + // UPDATE was chosen otherwise hide it. + if(![doNotImportKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:rowIndex]]) + return [fieldMappingArray objectAtIndex:rowIndex]; + else if(![[self selectedImportMethod] isEqualToString:@"UPDATE"]) + return [NSNumber numberWithInteger:firstDefaultItemOffset+rowIndex]; } else if ([[aTableColumn identifier] isEqualToString:SPTableViewOperatorColumnID]) { - if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) { - [(NSPopUpButtonCell *)[aTableColumn dataCell] removeAllItems]; - [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemsWithTitles:fieldMappingOperatorOptions]; - } return [fieldMappingOperatorArray objectAtIndex:rowIndex]; } } @@ -1845,16 +1863,16 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if(aTableView == fieldMapperTableView) { if ([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID]) { if([anObject integerValue] > (NSInteger)[fieldMappingButtonOptions count]) { - // Ignore field - set operator to doNotImport + // Ignore field - set operator to doNotImportKey if([anObject integerValue] == (NSInteger)[fieldMappingButtonOptions count]+1) { lastDisabledCSVFieldcolumn = [fieldMappingArray objectAtIndex:rowIndex]; - [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doNotImport]; + [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doNotImportKey]; [aTableView performSelector:@selector(reloadData) withObject:nil afterDelay:0.0]; } - // Ignore all field - set all operator to doNotImport + // Ignore all field - set all operator to doNotImportKey else if([anObject integerValue] == (NSInteger)[fieldMappingButtonOptions count]+2) { NSUInteger i; - NSNumber *globalValue = doNotImport; + NSNumber *globalValue = doNotImportKey; [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) [fieldMappingOperatorArray addObject:globalValue]; @@ -1863,14 +1881,14 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Import all field - set all operator to doImport else if([anObject integerValue] == (NSInteger)[fieldMappingButtonOptions count]+3) { NSUInteger i; - NSNumber *globalValue = doImport; + NSNumber *globalValue = doImportKey; [fieldMappingOperatorArray removeAllObjects]; for(i=0; i < [fieldMappingTableColumnNames count]; i++) [fieldMappingOperatorArray addObject:globalValue]; [aTableView performSelector:@selector(reloadData) withObject:nil afterDelay:0.0]; } else if([[self selectedImportMethod] isEqualToString:@"UPDATE"] && [anObject integerValue] == (NSInteger)[fieldMappingButtonOptions count]+4) { - [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:isEqual]; + [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:isEqualKey]; [aTableView performSelector:@selector(reloadData) withObject:nil afterDelay:0.0]; } // Add global value @@ -1890,8 +1908,8 @@ static NSUInteger SPSourceColumnTypeInteger = 1; [fieldMappingArray replaceObjectAtIndex:rowIndex withObject:anObject]; // If user _changed_ the csv file column set the operator to doImport if not set to = - if([(NSNumber*)anObject integerValue] > -1 && NSArrayObjectAtIndex(fieldMappingOperatorArray, rowIndex) != isEqual) - [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doImport]; + if([(NSNumber*)anObject integerValue] > -1 && ![isEqualKey isEqualToNumber:NSArrayObjectAtIndex(fieldMappingOperatorArray, rowIndex)]) + [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:doImportKey]; [self validateImportButton]; @@ -1918,11 +1936,11 @@ static NSUInteger SPSourceColumnTypeInteger = 1; } else if ([[aTableColumn identifier] isEqualToString:SPTableViewOperatorColumnID]) { - if([fieldMappingOperatorArray objectAtIndex:rowIndex] == doNotImport) { + if([doNotImportKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:rowIndex]]) { [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:anObject]; [fieldMappingArray replaceObjectAtIndex:rowIndex withObject:lastDisabledCSVFieldcolumn]; } else { - if(anObject == doNotImport) lastDisabledCSVFieldcolumn = [fieldMappingArray objectAtIndex:rowIndex]; + if([doNotImportKey isEqual:anObject]) lastDisabledCSVFieldcolumn = [fieldMappingArray objectAtIndex:rowIndex]; [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:anObject]; } [self validateImportButton]; -- cgit v1.2.3 From 19226617658f7452d8f02a68c52556aca6810c36 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 26 Dec 2014 22:54:24 +0100 Subject: Fix two minor CSV import dialog issues * Tooltips were somewhat broken for non-imported fields (issue exists in 1.0.2) * Newly added expressions would cause the field to switch to "do not import" instead of the added expression --- Source/SPFieldMapperController.m | 46 +++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 2fcf4c9e..418a255f 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -1189,13 +1189,15 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if(![isEqualKey isEqualToNumber:[fieldMappingOperatorArray objectAtIndex:[fieldMapperTableView selectedRow]]]) [fieldMappingOperatorArray replaceObjectAtIndex:[fieldMapperTableView selectedRow] withObject:doImportKey]; - [fieldMapperTableView reloadData]; - // Set alignment popup to "custom order" [alignByPopup selectItemWithTag:3]; } + // This must happen before orderOut:nil as that might cause the tableview to redraw which would in turn invalidate + // a newly added globalValue when updateFieldMappingButtonCell has not been run before. + [self updateFieldMappingButtonCell]; + [NSApp endSheet:globalValuesSheet returnCode:[sender tag]]; } @@ -1378,7 +1380,6 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if (sheet == globalValuesSheet) { addGlobalSheetIsOpen = NO; - [self updateFieldMappingButtonCell]; } } @@ -1682,27 +1683,29 @@ static NSUInteger SPSourceColumnTypeInteger = 1; if(aTableView == fieldMapperTableView) { - if ([doNotImportKey isEqual:[fieldMappingOperatorArray objectAtIndex:rowIndex]]) return [NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]; + if([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID]) { - if([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID] && [importFieldNamesHeaderSwitch state] == NSOnState) { + if ([doNotImportKey isEqual:[fieldMappingOperatorArray objectAtIndex:rowIndex]]) return [NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]; - if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]) - return [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"User-defined value", @"user-defined value"), NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue])]; + if([importFieldNamesHeaderSwitch state] == NSOnState) { + if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]) + return [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"User-defined value", @"user-defined value"), NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue])]; - if(fieldMappingCurrentRow) - return [NSString stringWithFormat:@"%@: %@", - [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description], - [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description]]; - else - return [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description]; + if(fieldMappingCurrentRow) + return [NSString stringWithFormat:@"%@: %@", + [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description], + [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description]]; + else + return [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description]; - } + } + else if([importFieldNamesHeaderSwitch state] == NSOffState) { + if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]) + return NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]); + else + return NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]); - else if([[aTableColumn identifier] isEqualToString:SPTableViewImportValueColumnID] && [importFieldNamesHeaderSwitch state] == NSOffState) { - if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]) - return NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]); - else - return NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]); + } } else if([[aTableColumn identifier] isEqualToString:SPTableViewOperatorColumnID]) { @@ -1712,12 +1715,11 @@ static NSUInteger SPSourceColumnTypeInteger = 1; return NSLocalizedString(@"Ignore field", @"ignore field label"); else if([isEqualKey isEqual:[aCell objectValue]]) return NSLocalizedString(@"Do UPDATE where field contents match", @"do update operator tooltip"); - else - return @""; } - else if([[aTableColumn identifier] isEqualToString:SPTableViewTargetFieldColumnID]) + else if([[aTableColumn identifier] isEqualToString:SPTableViewTargetFieldColumnID]) { return [fieldMappingTableColumnNames objectAtIndex:rowIndex]; + } } else if(aTableView == globalValuesTableView) { if ([[aTableColumn identifier] isEqualToString:SPTableViewGlobalValueColumnID]) -- cgit v1.2.3 From ae8a9465306eaee5bb1478b74057e1bdf540b1db Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 30 Dec 2014 02:29:26 +0100 Subject: =?UTF-8?q?+[NSThread=20detachNewThreadWithName:=E2=80=A6]=20chang?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method never did the one extra thing it should do, because… see comment in the code. Let's see how this works out :) --- Source/SPThreadAdditions.m | 60 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/Source/SPThreadAdditions.m b/Source/SPThreadAdditions.m index c1f0a52b..74476888 100644 --- a/Source/SPThreadAdditions.m +++ b/Source/SPThreadAdditions.m @@ -29,17 +29,69 @@ // More info at #import "SPThreadAdditions.h" +#import + +//this is a "private" class only needed by the +detachNewThreadWithName:… method below. +@interface SPNamedThread : NSObject { + @private + NSString *name; + id object; + SEL selector; +} +- (id)initWithTarget:(id)aObject selector:(SEL)aSelector name:(NSString *)aName; +- (void)run:(id)argument; +@end @implementation NSThread (SPThreadAdditions) + (void)detachNewThreadWithName:(NSString *)aName target:(id)aTarget selector:(SEL)aSelector object:(id)anArgument { - NSThread *newThread = [[NSThread alloc] initWithTarget:aTarget selector:aSelector object:anArgument]; - if (aName) { - [newThread setName:aName]; - } + // -[NSThread setName:] has two limitations when it comes to visibility in Xcode: + // a) Xcode only updates the thread name in UI once (on the first time the thread is shown in the debugger). + // b) Internally this method calls + // int pthread_setname_np(const char*); + // which, as can be seen, does not allow to specify a thread id. Therefore it is skipped if . + // Unfortunately this (and not the property of the NSThread) seems to be the actual name shown in Xcode. + // The consequence is, we can only set a thread's name from within the thread, so let's add a proxy object to do that. + SPNamedThread *namedThread = [[SPNamedThread alloc] initWithTarget:aTarget selector:aSelector name:aName]; + + NSThread *newThread = [[NSThread alloc] initWithTarget:namedThread selector:@selector(run:) object:anArgument]; [newThread start]; [newThread autorelease]; + [namedThread autorelease]; +} + +@end + +#pragma mark - + +@implementation SPNamedThread + +- (id)initWithTarget:(id)aObject selector:(SEL)aSelector name:(NSString *)aName +{ + if(self = [super init]) { + name = [aName copy]; + object = [aObject retain]; + selector = aSelector; + } + return self; +} + +- (void)run:(id)argument +{ + [[NSThread currentThread] setName:name]; + + void (*msgsend)(id, SEL, id) = (void (*)(id, SEL, id)) objc_msgSend; //hint for the compiler + + msgsend(object,selector,argument); +} + +- (void)dealloc +{ + [object release], object = nil; + selector = NULL; + [name release], name = nil; + [super dealloc]; } @end -- cgit v1.2.3 From 2d8fd9c8eff0afca2cab9b8bbb791a0cdf1c583a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 30 Dec 2014 02:30:30 +0100 Subject: Fix a minor case of "bg thread updating UI" --- Source/SPCustomQuery.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 216cafa8..8b201776 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -916,7 +916,7 @@ return; } - [customQueryView reloadData]; + [[customQueryView onMainThread] reloadData]; // Restore the result view origin if appropriate if (!NSEqualRects(selectionViewportToRestore, NSZeroRect)) { -- cgit v1.2.3 From f12b95bb7b3dda011dea4bb3e0edff1428a38209 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 31 Dec 2014 03:00:10 +0100 Subject: Remove some duplicate code by adding abstraction --- Source/SPEditorPreferencePane.m | 8 ++++++++ Source/SPPreferenceController.h | 2 -- Source/SPPreferenceController.m | 39 ++++----------------------------------- Source/SPPreferencePane.h | 2 +- Source/SPPreferencePane.m | 5 +++++ Source/SPPreferencePaneProtocol.h | 5 +++++ Source/SPTablesPreferencePane.m | 5 +++++ 7 files changed, 28 insertions(+), 38 deletions(-) diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index d5127e65..08a833c2 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -732,6 +732,14 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; return NO; } +- (void)preferencePaneWillBeShown +{ + [self updateColorSchemeSelectionMenu]; + [self updateDisplayColorThemeName]; + + [self updateDisplayedEditorFontName]; +} + #pragma mark - #pragma mark Private API diff --git a/Source/SPPreferenceController.h b/Source/SPPreferenceController.h index a001b60c..c34f8542 100644 --- a/Source/SPPreferenceController.h +++ b/Source/SPPreferenceController.h @@ -84,8 +84,6 @@ // Toolbar item IBAction methods - (IBAction)displayPreferencePane:(id)sender; -- (IBAction)displayTablePreferences:(id)sender; -- (IBAction)displayEditorPreferences:(id)sender; - (void)changeFont:(id)sender; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 3a67ae80..d28dfcb9 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -105,40 +105,9 @@ [toolbar setSelectedItemIdentifier:[preferencePane preferencePaneIdentifier]]; - [self _resizeWindowForContentView:[preferencePane preferencePaneView]]; -} - -/** - * Displays the table preferences pane. - */ -- (IBAction)displayTablePreferences:(id)sender -{ - [[self window] setMinSize:NSMakeSize(0, 0)]; - [[self window] setShowsResizeIndicator:[tablesPreferencePane preferencePaneAllowsResizing]]; - - [toolbar setSelectedItemIdentifier:[tablesPreferencePane preferencePaneIdentifier]]; - - [(SPTablesPreferencePane *)tablesPreferencePane updateDisplayedTableFontName]; - - [self _resizeWindowForContentView:[tablesPreferencePane preferencePaneView]]; -} - -/** - * Displays the editor preferences pane. - */ -- (IBAction)displayEditorPreferences:(id)sender -{ - [(SPEditorPreferencePane *)editorPreferencePane updateColorSchemeSelectionMenu]; - [(SPEditorPreferencePane *)editorPreferencePane updateDisplayColorThemeName]; + [preferencePane preferencePaneWillBeShown]; - [[self window] setMinSize:NSMakeSize(0, 0)]; - [[self window] setShowsResizeIndicator:[editorPreferencePane preferencePaneAllowsResizing]]; - - [toolbar setSelectedItemIdentifier:[editorPreferencePane preferencePaneIdentifier]]; - - [(SPEditorPreferencePane *)editorPreferencePane updateDisplayedEditorFontName]; - - [self _resizeWindowForContentView:[editorPreferencePane preferencePaneView]]; + [self _resizeWindowForContentView:[preferencePane preferencePaneView]]; } #pragma mark - @@ -198,7 +167,7 @@ [tablesItem setLabel:[tablesPreferencePane preferencePaneName]]; [tablesItem setImage:[tablesPreferencePane preferencePaneIcon]]; [tablesItem setTarget:self]; - [tablesItem setAction:@selector(displayTablePreferences:)]; + [tablesItem setAction:@selector(displayPreferencePane:)]; // Notification preferences notificationsItem = [[NSToolbarItem alloc] initWithItemIdentifier:[notificationsPreferencePane preferencePaneIdentifier]]; @@ -214,7 +183,7 @@ [editorItem setLabel:[editorPreferencePane preferencePaneName]]; [editorItem setImage:[editorPreferencePane preferencePaneIcon]]; [editorItem setTarget:self]; - [editorItem setAction:@selector(displayEditorPreferences:)]; + [editorItem setAction:@selector(displayPreferencePane:)]; // AutoUpdate preferences autoUpdateItem = [[NSToolbarItem alloc] initWithItemIdentifier:[autoUpdatePreferencePane preferencePaneIdentifier]]; diff --git a/Source/SPPreferencePane.h b/Source/SPPreferencePane.h index 39d239c8..19e0436b 100644 --- a/Source/SPPreferencePane.h +++ b/Source/SPPreferencePane.h @@ -42,5 +42,5 @@ { NSUserDefaults *prefs; } - +- (void)preferencePaneWillBeShown; @end diff --git a/Source/SPPreferencePane.m b/Source/SPPreferencePane.m index a1b85ed7..39a870c7 100644 --- a/Source/SPPreferencePane.m +++ b/Source/SPPreferencePane.m @@ -47,4 +47,9 @@ return self; } +- (void)preferencePaneWillBeShown +{ + // Default: do nothing. Override in subclass. +} + @end diff --git a/Source/SPPreferencePaneProtocol.h b/Source/SPPreferencePaneProtocol.h index a9d67598..e00e12ec 100644 --- a/Source/SPPreferencePaneProtocol.h +++ b/Source/SPPreferencePaneProtocol.h @@ -79,4 +79,9 @@ */ - (BOOL)preferencePaneAllowsResizing; +/** + * Called shortly before the preference pane will be made visible + */ +- (void)preferencePaneWillBeShown; + @end diff --git a/Source/SPTablesPreferencePane.m b/Source/SPTablesPreferencePane.m index 5c55af94..f89849ec 100644 --- a/Source/SPTablesPreferencePane.m +++ b/Source/SPTablesPreferencePane.m @@ -93,4 +93,9 @@ return NO; } +- (void)preferencePaneWillBeShown +{ + [self updateDisplayedTableFontName]; +} + @end -- cgit v1.2.3 From 42593525e55ad5daa01b3edde3c4cce653559f72 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 31 Dec 2014 05:23:07 +0100 Subject: Update Growl.framework to 2.0.1 As per https://code.google.com/p/growl/wiki/SystemRequirements this should not break compatibility with Sequel Pro and the API stays the same. This change gives us Notification Center support for free, though. --- Frameworks/Growl.framework/Versions/A/Growl | Bin 259544 -> 1093888 bytes .../Growl.framework/Versions/A/Headers/Growl.h | 5 +- .../A/Headers/GrowlApplicationBridge-Carbon.h | 780 --------------------- .../Versions/A/Headers/GrowlApplicationBridge.h | 152 ++-- .../Versions/A/Headers/GrowlDefines.h | 102 ++- .../Versions/A/Resources/Info.plist | 20 +- .../Versions/A/_CodeSignature/CodeResources | 34 + 7 files changed, 188 insertions(+), 905 deletions(-) delete mode 100644 Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h create mode 100644 Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources diff --git a/Frameworks/Growl.framework/Versions/A/Growl b/Frameworks/Growl.framework/Versions/A/Growl index ee84bef2..e3567301 100755 Binary files a/Frameworks/Growl.framework/Versions/A/Growl and b/Frameworks/Growl.framework/Versions/A/Growl differ diff --git a/Frameworks/Growl.framework/Versions/A/Headers/Growl.h b/Frameworks/Growl.framework/Versions/A/Headers/Growl.h index e2a44255..7b1a3247 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/Growl.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/Growl.h @@ -1,6 +1,5 @@ -#include "GrowlDefines.h" +#include #ifdef __OBJC__ -# include "GrowlApplicationBridge.h" +# include #endif -#include "GrowlApplicationBridge-Carbon.h" diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h deleted file mode 100644 index e7213dbe..00000000 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h +++ /dev/null @@ -1,780 +0,0 @@ -// -// GrowlApplicationBridge-Carbon.h -// Growl -// -// Created by Peter Hosey on Wed Jun 18 2004. -// Based on GrowlApplicationBridge.h by Evan Schoenberg. -// This source code is in the public domain. You may freely link it into any -// program. -// - -#ifndef _GROWLAPPLICATIONBRIDGE_CARBON_H_ -#define _GROWLAPPLICATIONBRIDGE_CARBON_H_ - -#include -#include - -#ifndef GROWL_EXPORT -#define GROWL_EXPORT __attribute__((visibility("default"))) DEPRECATED_ATTRIBUTE -#endif - -/*! @header GrowlApplicationBridge-Carbon.h - * @abstract Declares an API that Carbon applications can use to interact with Growl. - * @discussion GrowlApplicationBridge uses a delegate to provide information //XXX - * to Growl (such as your application's name and what notifications it may - * post) and to provide information to your application (such as that Growl - * is listening for notifications or that a notification has been clicked). - * - * You can set the Growldelegate with Growl_SetDelegate and find out the - * current delegate with Growl_GetDelegate. See struct Growl_Delegate for more - * information about the delegate. - */ - -__BEGIN_DECLS - -/*! @struct Growl_Delegate - * @abstract Delegate to supply GrowlApplicationBridge with information and respond to events. - * @discussion The Growl delegate provides your interface to - * GrowlApplicationBridge. When GrowlApplicationBridge needs information about - * your application, it looks for it in the delegate; when Growl or the user - * does something that you might be interested in, GrowlApplicationBridge - * looks for a callback in the delegate and calls it if present - * (meaning, if it is not NULL). - * XXX on all of that - * @field size The size of the delegate structure. - * @field applicationName The name of your application. - * @field registrationDictionary A dictionary describing your application and the notifications it can send out. - * @field applicationIconData Your application's icon. - * @field growlInstallationWindowTitle The title of the installation window. - * @field growlInstallationInformation Text to display in the installation window. - * @field growlUpdateWindowTitle The title of the update window. - * @field growlUpdateInformation Text to display in the update window. - * @field referenceCount A count of owners of the delegate. - * @field retain Called when GrowlApplicationBridge receives this delegate. - * @field release Called when GrowlApplicationBridge no longer needs this delegate. - * @field growlIsReady Called when GrowlHelperApp is listening for notifications. - * @field growlNotificationWasClicked Called when a Growl notification is clicked. - * @field growlNotificationTimedOut Called when a Growl notification timed out. - */ -struct Growl_Delegate { - /* @discussion This should be sizeof(struct Growl_Delegate). - */ - size_t size; - - /*All of these attributes are optional. - *Optional attributes can be NULL; required attributes that - * are NULL cause setting the Growl delegate to fail. - *XXX - move optional/required status into the discussion for each field - */ - - /* This name is used both internally and in the Growl preferences. - * - * This should remain stable between different versions and incarnations of - * your application. - * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and - * "SurfWriter Lite" are not. - * - * This can be NULL if it is provided elsewhere, namely in an - * auto-discoverable plist file in your app bundle - * (XXX refer to more information on that) or in registrationDictionary. - */ - CFStringRef applicationName; - - /* - * Must contain at least these keys: - * GROWL_NOTIFICATIONS_ALL (CFArray): - * Contains the names of all notifications your application may post. - * - * Can also contain these keys: - * GROWL_NOTIFICATIONS_DEFAULT (CFArray): - * Names of notifications that should be enabled by default. - * If omitted, GROWL_NOTIFICATIONS_ALL will be used. - * GROWL_APP_NAME (CFString): - * Same as the applicationName member of this structure. - * If both are present, the applicationName member shall prevail. - * If this key is present, you may omit applicationName (set it to NULL). - * GROWL_APP_ICON (CFData): - * Same as the iconData member of this structure. - * If both are present, the iconData member shall prevail. - * If this key is present, you may omit iconData (set it to NULL). - * - * If you change the contents of this dictionary after setting the delegate, - * be sure to call Growl_Reregister. - * - * This can be NULL if you have an auto-discoverable plist file in your app - * bundle. (XXX refer to more information on that) - */ - CFDictionaryRef registrationDictionary; - - /* The data can be in any format supported by NSImage. As of - * Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and - * PICT formats. - * - * If this is not supplied, Growl will look up your application's icon by - * its application name. - */ - CFDataRef applicationIconData; - - /* Installer display attributes - * - * These four attributes are used by the Growl installer, if this framework - * supports it. - * For any of these being NULL, a localised default will be - * supplied. - */ - - /* If this is NULL, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If Growl is not installed, it will - * be displayed to the user as an explanation of what Growl is and what - * it can do in your application. - * It should probably note that no download is required to install. - * - * If this is NULL, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationInformation; - /* If this is NULL, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If an older version of Growl is - * installed, it will be displayed to the user as an explanation that an - * updated version of Growl is included in your application and - * no download is required. - * - * If this is NULL, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateInformation; - - /* This member is provided for use by your retain and release - * callbacks (see below). - * - * GrowlApplicationBridge never directly uses this member. Instead, it - * calls your retain callback (if non-NULL) and your release - * callback (if non-NULL). - */ - unsigned referenceCount; - - //Functions. Currently all of these are optional (any of them can be NULL). - - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRetain and -[NSObject retain].) - * This member is optional (it can be NULL). - * For a delegate allocated with malloc, this member would be - * NULL. - * @result A delegate to which GrowlApplicationBridge holds a reference. - */ - void *(*retain)(void *); - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRelease and - * -[NSObject release].) - * This member is optional (it can be NULL). - * For a delegate allocated with malloc, this member might be - * free(3). - */ - void (*release)(void *); - - /* Informs the delegate that Growl (specifically, the GrowlHelperApp) was - * launched successfully (or was already running). The application can - * take actions with the knowledge that Growl is installed and functional. - */ - void (*growlIsReady)(void); - - /* Informs the delegate that a Growl notification was clicked. It is only - * sent for notifications sent with a non-NULL clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be NULL when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationWasClicked)(CFPropertyListRef clickContext); - - /* Informs the delegate that a Growl notification timed out. It is only - * sent for notifications sent with a non-NULL clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be NULL when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationTimedOut)(CFPropertyListRef clickContext); -}; - -/*! @struct Growl_Notification - * @abstract Structure describing a Growl notification. - * @discussion XXX - * @field size The size of the notification structure. - * @field name Identifies the notification. - * @field title Short synopsis of the notification. - * @field description Additional text. - * @field iconData An icon for the notification. - * @field priority An indicator of the notification's importance. - * @field reserved Bits reserved for future usage. - * @field isSticky Requests that a notification stay on-screen until dismissed explicitly. - * @field clickContext An identifier to be passed to your click callback when a notification is clicked. - * @field clickCallback A callback to call when the notification is clicked. - */ -struct Growl_Notification { - /* This should be sizeof(struct Growl_Notification). - */ - size_t size; - - /* The notification name distinguishes one type of - * notification from another. The name should be human-readable, as it - * will be displayed in the Growl preference pane. - * - * The name is used in the GROWL_NOTIFICATIONS_ALL and - * GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and - * in this member of the Growl_Notification structure. - */ - CFStringRef name; - - /* A notification's title describes the notification briefly. - * It should be easy to read quickly by the user. - */ - CFStringRef title; - - /* The description supplements the title with more - * information. It is usually longer and sometimes involves a list of - * subjects. For example, for a 'Download complete' notification, the - * description might have one filename per line. GrowlMail in Growl 0.6 - * uses a description of '%d new mail(s)' (formatted with the number of - * messages). - */ - CFStringRef description; - - /* The notification icon usually indicates either what - * happened (it may have the same icon as e.g. a toolbar item that - * started the process that led to the notification), or what it happened - * to (e.g. a document icon). - * - * The icon data is optional, so it can be NULL. In that - * case, the application icon is used alone. Not all displays support - * icons. - * - * The data can be in any format supported by NSImage. As of Mac OS X - * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form - * ats. - */ - CFDataRef iconData; - - /* Priority is new in Growl 0.6, and is represented as a - * signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low - * priority, and +2 is Very High priority. - * - * Not all displays support priority. If you do not wish to assign a - * priority to your notification, assign 0. - */ - signed int priority; - - /* These bits are not used in Growl 0.6. Set them to 0. - */ - unsigned reserved: 31; - - /* When the sticky bit is clear, in most displays, - * notifications disappear after a certain amount of time. Sticky - * notifications, however, remain on-screen until the user dismisses them - * explicitly, usually by clicking them. - * - * Sticky notifications were introduced in Growl 0.6. Most notifications - * should not be sticky. Not all displays support sticky notifications, - * and the user may choose in Growl's preference pane to force the - * notification to be sticky or non-sticky, in which case the sticky bit - * in the notification will be ignored. - */ - unsigned isSticky: 1; - - /* If this is not NULL, and your click callback - * is not NULL either, this will be passed to the callback - * when your notification is clicked by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - */ - CFPropertyListRef clickContext; - - /* If this is not NULL, it will be called instead - * of the Growl delegate's click callback when clickContext is - * non-NULL and the notification is clicked on by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - * - * The per-notification click callback is not yet supported as of Growl - * 0.7. - */ - void (*clickCallback)(CFPropertyListRef clickContext); - - CFStringRef identifier; -}; - -#pragma mark - -#pragma mark Easy initialisers - -/*! @defined InitGrowlDelegate - * @abstract Callable macro. Initializes a Growl delegate structure to defaults. - * @discussion Call with a pointer to a struct Growl_Delegate. All of the - * members of the structure will be set to 0 or NULL, except for - * size (which will be set to sizeof(struct Growl_Delegate)) and - * referenceCount (which will be set to 1). - */ -#define InitGrowlDelegate(delegate) \ - do { \ - if (delegate) { \ - (delegate)->size = sizeof(struct Growl_Delegate); \ - (delegate)->applicationName = NULL; \ - (delegate)->registrationDictionary = NULL; \ - (delegate)->applicationIconData = NULL; \ - (delegate)->growlInstallationWindowTitle = NULL; \ - (delegate)->growlInstallationInformation = NULL; \ - (delegate)->growlUpdateWindowTitle = NULL; \ - (delegate)->growlUpdateInformation = NULL; \ - (delegate)->referenceCount = 1U; \ - (delegate)->retain = NULL; \ - (delegate)->release = NULL; \ - (delegate)->growlIsReady = NULL; \ - (delegate)->growlNotificationWasClicked = NULL; \ - (delegate)->growlNotificationTimedOut = NULL; \ - } \ - } while(0) - -/*! @defined InitGrowlNotification - * @abstract Callable macro. Initializes a Growl notification structure to defaults. - * @discussion Call with a pointer to a struct Growl_Notification. All of - * the members of the structure will be set to 0 or NULL, except - * for size (which will be set to - * sizeof(struct Growl_Notification)). - */ -#define InitGrowlNotification(notification) \ - do { \ - if (notification) { \ - (notification)->size = sizeof(struct Growl_Notification); \ - (notification)->name = NULL; \ - (notification)->title = NULL; \ - (notification)->description = NULL; \ - (notification)->iconData = NULL; \ - (notification)->priority = 0; \ - (notification)->reserved = 0U; \ - (notification)->isSticky = false; \ - (notification)->clickContext = NULL; \ - (notification)->clickCallback = NULL; \ - (notification)->identifier = NULL; \ - } \ - } while(0) - -#pragma mark - -#pragma mark Public API - -// @functiongroup Managing the Growl delegate - -/*! @function Growl_SetDelegate - * @abstract Replaces the current Growl delegate with a new one, or removes - * the Growl delegate. - * @param newDelegate - * @result Returns false and does nothing else if a pointer that was passed in - * is unsatisfactory (because it is non-NULL, but at least one - * required member of it is NULL). Otherwise, sets or unsets the - * delegate and returns true. - * @discussion When newDelegate is non-NULL, sets - * the delegate to newDelegate. When it is NULL, - * the current delegate will be unset, and no delegate will be in place. - * - * It is legal for newDelegate to be the current delegate; - * nothing will happen, and Growl_SetDelegate will return true. It is also - * legal for it to be NULL, as described above; again, it will - * return true. - * - * If there was a delegate in place before the call, Growl_SetDelegate will - * call the old delegate's release member if it was non-NULL. If - * newDelegate is non-NULL, Growl_SetDelegate will - * call newDelegate->retain, and set the delegate to its return - * value. - * - * If you are using Growl-WithInstaller.framework, and an older version of - * Growl is installed on the user's system, the user will automatically be - * prompted to update. - * - * GrowlApplicationBridge currently does not copy this structure, nor does it - * retain any of the CF objects in the structure (it regards the structure as - * a container that retains the objects when they are added and releases them - * when they are removed or the structure is destroyed). Also, - * GrowlApplicationBridge currently does not modify any member of the - * structure, except possibly the referenceCount by calling the retain and - * release members. - */ -GROWL_EXPORT Boolean Growl_SetDelegate(struct Growl_Delegate *newDelegate); - -/*! @function Growl_GetDelegate - * @abstract Returns the current Growl delegate, if any. - * @result The current Growl delegate. - * @discussion Returns the last pointer passed into Growl_SetDelegate, or - * NULL if no such call has been made. - * - * This function follows standard Core Foundation reference-counting rules. - * Because it is a Get function, not a Copy function, it will not retain the - * delegate on your behalf. You are responsible for retaining and releasing - * the delegate as needed. - */ -GROWL_EXPORT struct Growl_Delegate *Growl_GetDelegate(void); - -#pragma mark - - -// @functiongroup Posting Growl notifications - -/*! @function Growl_PostNotification - * @abstract Posts a Growl notification. - * @param notification The notification to post. - * @discussion This is the preferred means for sending a Growl notification. - * The notification name and at least one of the title and description are - * required (all three are preferred). All other parameters may be - * NULL (or 0 or false as appropriate) to accept default values. - * - * If using the Growl-WithInstaller framework, if Growl is not installed the - * user will be prompted to install Growl. - * If the user cancels, this function will have no effect until the next - * application session, at which time when it is called the user will be - * prompted again. The user is also given the option to not be prompted again. - * If the user does choose to install Growl, the requested notification will - * be displayed once Growl is installed and running. - */ -GROWL_EXPORT void Growl_PostNotification(const struct Growl_Notification *notification); - -/*! @function Growl_PostNotificationWithDictionary -* @abstract Notifies using a userInfo dictionary suitable for passing to -* CFDistributedNotificationCenter. -* @param userInfo The dictionary to notify with. -* @discussion Before Growl 0.6, your application would have posted -* notifications using CFDistributedNotificationCenter by creating a userInfo -* dictionary with the notification data. This had the advantage of allowing -* you to add other data to the dictionary for programs besides Growl that -* might be listening. -* -* This function allows you to use such dictionaries without being restricted -* to using CFDistributedNotificationCenter. The keys for this dictionary - * can be found in GrowlDefines.h. -*/ -GROWL_EXPORT void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo); - -/*! @function Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext - * @abstract Posts a Growl notification using parameter values. - * @param title The title of the notification. - * @param description The description of the notification. - * @param notificationName The name of the notification as listed in the - * registration dictionary. - * @param iconData Data representing a notification icon. Can be NULL. - * @param priority The priority of the notification (-2 to +2, with -2 - * being Very Low and +2 being Very High). - * @param isSticky If true, requests that this notification wait for a - * response from the user. - * @param clickContext An object to pass to the clickCallback, if any. Can - * be NULL, in which case the clickCallback is not called. - * @discussion Creates a temporary Growl_Notification, fills it out with the - * supplied information, and calls Growl_PostNotification on it. - * See struct Growl_Notification and Growl_PostNotification for more - * information. - * - * The icon data can be in any format supported by NSImage. As of Mac OS X - * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT formats. - */ -GROWL_EXPORT void Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( - /*inhale*/ - CFStringRef title, - CFStringRef description, - CFStringRef notificationName, - CFDataRef iconData, - signed int priority, - Boolean isSticky, - CFPropertyListRef clickContext); - -#pragma mark - - -// @functiongroup Registering - -/*! @function Growl_RegisterWithDictionary - * @abstract Register your application with Growl without setting a delegate. - * @discussion When you call this function with a dictionary, - * GrowlApplicationBridge registers your application using that dictionary. - * If you pass NULL, GrowlApplicationBridge will ask the delegate - * (if there is one) for a dictionary, and if that doesn't work, it will look - * in your application's bundle for an auto-discoverable plist. - * (XXX refer to more information on that) - * - * If you pass a dictionary to this function, it must include the - * GROWL_APP_NAME key, unless a delegate is set. - * - * This function is mainly an alternative to the delegate system introduced - * with Growl 0.6. Without a delegate, you cannot receive callbacks such as - * growlIsReady (since they are sent to the delegate). You can, - * however, set a delegate after registering without one. - * - * This function was introduced in Growl.framework 0.7. - * @result false if registration failed (e.g. if Growl isn't installed). - */ -GROWL_EXPORT Boolean Growl_RegisterWithDictionary(CFDictionaryRef regDict); - -/*! @function Growl_Reregister - * @abstract Updates your registration with Growl. - * @discussion If your application changes the contents of the - * GROWL_NOTIFICATIONS_ALL key in the registrationDictionary member of the - * Growl delegate, or if it changes the value of that member, or if it - * changes the contents of its auto-discoverable plist, call this function - * to have Growl update its registration information for your application. - * - * Otherwise, this function does not normally need to be called. If you're - * using a delegate, your application will be registered when you set the - * delegate if both the delegate and its registrationDictionary member are - * non-NULL. - * - * This function is now implemented using - * Growl_RegisterWithDictionary. - */ -GROWL_EXPORT void Growl_Reregister(void); - -#pragma mark - - -/*! @function Growl_SetWillRegisterWhenGrowlIsReady - * @abstract Tells GrowlApplicationBridge to register with Growl when Growl - * launches (or not). - * @discussion When Growl has started listening for notifications, it posts a - * GROWL_IS_READY notification on the Distributed Notification - * Center. GrowlApplicationBridge listens for this notification, using it to - * perform various tasks (such as calling your delegate's - * growlIsReady callback, if it has one). If this function is - * called with true, one of those tasks will be to reregister - * with Growl (in the manner of Growl_Reregister). - * - * This attribute is automatically set back to false - * (the default) after every GROWL_IS_READY notification. - * @param flag true if you want GrowlApplicationBridge to register with - * Growl when next it is ready; false if not. - */ -GROWL_EXPORT void Growl_SetWillRegisterWhenGrowlIsReady(Boolean flag); -/*! @function Growl_WillRegisterWhenGrowlIsReady - * @abstract Reports whether GrowlApplicationBridge will register with Growl - * when Growl next launches. - * @result true if GrowlApplicationBridge will register with - * Growl when next it posts GROWL_IS_READY; false if not. - */ -GROWL_EXPORT Boolean Growl_WillRegisterWhenGrowlIsReady(void); - -#pragma mark - - -// @functiongroup Obtaining registration dictionaries - -/*! @function Growl_CopyRegistrationDictionaryFromDelegate - * @abstract Asks the delegate for a registration dictionary. - * @discussion If no delegate is set, or if the delegate's - * registrationDictionary member is NULL, this - * function returns NULL. - * - * This function does not attempt to clean up the dictionary in any way - for - * example, if it is missing the GROWL_APP_NAME key, the result - * will be missing it too. Use - * Growl_CreateRegistrationDictionaryByFillingInDictionary or - * Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys - * to try to fill in missing keys. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromDelegate(void); - -/*! @function Growl_CopyRegistrationDictionaryFromBundle - * @abstract Looks in a bundle for a registration dictionary. - * @discussion This function looks in a bundle for an auto-discoverable - * registration dictionary file using CFBundleCopyResourceURL. - * If it finds one, it loads the file using CFPropertyList and - * returns the result. - * - * If you pass NULL as the bundle, the main bundle is examined. - * - * This function does not attempt to clean up the dictionary in any way - for - * example, if it is missing the GROWL_APP_NAME key, the result - * will be missing it too. Use - * Growl_CreateRegistrationDictionaryByFillingInDictionary: or - * Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys - * to try to fill in missing keys. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromBundle(CFBundleRef bundle); - -/*! @function Growl_CreateBestRegistrationDictionary - * @abstract Obtains a registration dictionary, filled out to the best of - * GrowlApplicationBridge's knowledge. - * @discussion This function creates a registration dictionary as best - * GrowlApplicationBridge knows how. - * - * First, GrowlApplicationBridge examines the Growl delegate (if there is - * one) and gets the registration dictionary from that. If no such dictionary - * was obtained, GrowlApplicationBridge looks in your application's main - * bundle for an auto-discoverable registration dictionary file. If that - * doesn't exist either, this function returns NULL. - * - * Second, GrowlApplicationBridge calls - * Growl_CreateRegistrationDictionaryByFillingInDictionary with - * whatever dictionary was obtained. The result of that function is the - * result of this function. - * - * GrowlApplicationBridge uses this function when you call - * Growl_SetDelegate, or when you call - * Growl_RegisterWithDictionary with NULL. - * - * This function was introduced in Growl.framework 0.7. - * @result A registration dictionary. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateBestRegistrationDictionary(void); - -#pragma mark - - -// @functiongroup Filling in registration dictionaries - -/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionary - * @abstract Tries to fill in missing keys in a registration dictionary. - * @param regDict The dictionary to fill in. - * @result The dictionary with the keys filled in. - * @discussion This function examines the passed-in dictionary for missing keys, - * and tries to work out correct values for them. As of 0.7, it uses: - * - * Key Value - * --- ----- - * GROWL_APP_NAME CFBundleExecutableName - * GROWL_APP_ICON The icon of the application. - * GROWL_APP_LOCATION The location of the application. - * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL - * - * Keys are only filled in if missing; if a key is present in the dictionary, - * its value will not be changed. - * - * This function was introduced in Growl.framework 0.7. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionary(CFDictionaryRef regDict); -/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys - * @abstract Tries to fill in missing keys in a registration dictionary. - * @param regDict The dictionary to fill in. - * @param keys The keys to fill in. If NULL, any missing keys are filled in. - * @result The dictionary with the keys filled in. - * @discussion This function examines the passed-in dictionary for missing keys, - * and tries to work out correct values for them. As of 0.7, it uses: - * - * Key Value - * --- ----- - * GROWL_APP_NAME CFBundleExecutableName - * GROWL_APP_ICON The icon of the application. - * GROWL_APP_LOCATION The location of the application. - * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL - * - * Only those keys that are listed in keys will be filled in. - * Other missing keys are ignored. Also, keys are only filled in if missing; - * if a key is present in the dictionary, its value will not be changed. - * - * This function was introduced in Growl.framework 0.7. - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys(CFDictionaryRef regDict, CFSetRef keys); - -/*! @brief Tries to fill in missing keys in a notification dictionary. - * @param notifDict The dictionary to fill in. - * @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict. - * @discussion This function examines the \a notifDict for missing keys, and - * tries to get them from the last known registration dictionary. As of 1.1, - * the keys that it will look for are: - * - * \li GROWL_APP_NAME - * \li GROWL_APP_ICON - * - * @since Growl.framework 1.1 - */ -GROWL_EXPORT CFDictionaryRef Growl_CreateNotificationDictionaryByFillingInDictionary(CFDictionaryRef notifDict); - -#pragma mark - - -// @functiongroup Querying Growl's status - -/*! @function Growl_IsInstalled - * @abstract Determines whether the Growl prefpane and its helper app are - * installed. - * @result Returns true if Growl is installed, false otherwise. - */ -GROWL_EXPORT Boolean Growl_IsInstalled(void); - -/*! @function Growl_IsRunning - * @abstract Cycles through the process list to find whether GrowlHelperApp - * is running. - * @result Returns true if Growl is running, false otherwise. - */ -GROWL_EXPORT Boolean Growl_IsRunning(void); - -#pragma mark - - -// @functiongroup Launching Growl - -/*! @typedef GrowlLaunchCallback - * @abstract Callback to notify you that Growl is running. - * @param context The context pointer passed to Growl_LaunchIfInstalled. - * @discussion Growl_LaunchIfInstalled calls this callback function if Growl - * was already running or if it launched Growl successfully. - */ -typedef void (*GrowlLaunchCallback)(void *context); - -/*! @function Growl_LaunchIfInstalled - * @abstract Launches GrowlHelperApp if it is not already running. - * @param callback A callback function which will be called if Growl was successfully - * launched or was already running. Can be NULL. - * @param context The context pointer to pass to the callback. Can be NULL. - * @result Returns true if Growl was successfully launched or was already - * running; returns false and does not call the callback otherwise. - * @discussion Returns true and calls the callback (if the callback is not - * NULL) if the Growl helper app began launching or was already - * running. Returns false and performs no other action if Growl could not be - * launched (e.g. because the Growl preference pane is not properly installed). - * - * If Growl_CreateBestRegistrationDictionary returns - * non-NULL, this function will register with Growl atomically. - * - * The callback should take a single argument; this is to allow applications - * to have context-relevant information passed back. It is perfectly - * acceptable for context to be NULL. The callback itself can be - * NULL if you don't want one. - */ -GROWL_EXPORT Boolean Growl_LaunchIfInstalled(GrowlLaunchCallback callback, void *context); - -#pragma mark - -#pragma mark Constants - -/*! @defined GROWL_PREFPANE_BUNDLE_IDENTIFIER - * @abstract The CFBundleIdentifier of the Growl preference pane bundle. - * @discussion GrowlApplicationBridge uses this to determine whether Growl is - * currently installed, by searching for the Growl preference pane. Your - * application probably does not need to use this macro itself. - */ -#ifndef GROWL_PREFPANE_BUNDLE_IDENTIFIER -#define GROWL_PREFPANE_BUNDLE_IDENTIFIER CFSTR("com.growl.prefpanel") -#endif - -__END_DECLS - -#endif /* _GROWLAPPLICATIONBRIDGE_CARBON_H_ */ diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h index 8afda27e..36397576 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h @@ -18,14 +18,11 @@ #import #import -#import "GrowlDefines.h" +#import //Forward declarations @protocol GrowlApplicationBridgeDelegate; -//Internal notification when the user chooses not to install (to avoid continuing to cache notifications awaiting installation) -#define GROWL_USER_CHOSE_NOT_TO_INSTALL_NOTIFICATION @"User chose not to install" - //------------------------------------------------------------------------------ #pragma mark - @@ -45,7 +42,7 @@ * @method isGrowlInstalled * @abstract Detects whether Growl is installed. * @discussion Determines if the Growl prefpane and its helper app are installed. - * @result this method will forever return YES + * @result this method will forever return YES. */ + (BOOL) isGrowlInstalled __attribute__((deprecated)); @@ -57,6 +54,34 @@ */ + (BOOL) isGrowlRunning; + +/*! + * @method isMistEnabled + * @abstract Gives the caller a fairly good indication of whether or not built-in notifications(Mist) will be used. + * @discussion since this call makes use of isGrowlRunning it is entirely possible for this value to change between call and + * executing a notification dispatch + * @result Returns YES if Growl isn't reachable and the developer has not opted-out of + * Mist and the user hasn't set the global mist enable key to false. + */ ++ (BOOL)isMistEnabled; + +/*! + * @method setShouldUseBuiltInNotifications + * @abstract opt-out mechanism for the mist notification style in the event growl can't be reached. + * @discussion if growl is unavailable due to not being installed or as a result of being turned off then + * this option can enable/disable a built-in fire and forget display style + * @param should Specifies whether or not the developer wants to opt-in (default) or opt out + * of the built-in Mist style in the event Growl is unreachable. + */ ++ (void)setShouldUseBuiltInNotifications:(BOOL)should; + +/*! + * @method shouldUseBuiltInNotifications + * @abstract returns the current opt-in state of the framework's use of the Mist display style. + * @result Returns NO if the developer opt-ed out of Mist, the default value is YES. + */ ++ (BOOL)shouldUseBuiltInNotifications; + #pragma mark - /*! @@ -87,7 +112,7 @@ * * @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol. */ -+ (void) setGrowlDelegate:(NSObject *)inDelegate; ++ (void) setGrowlDelegate:(id)inDelegate; /*! * @method growlDelegate @@ -95,7 +120,7 @@ * @discussion See setGrowlDelegate: for details. * @result The Growl delegate. */ -+ (NSObject *) growlDelegate; ++ (id) growlDelegate; #pragma mark - @@ -235,6 +260,7 @@ * Growl when next it is ready; NO if not. */ + (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag; + /*! @method willRegisterWhenGrowlIsReady * @abstract Reports whether GrowlApplicationBridge will register with Growl * when Growl next launches. @@ -323,7 +349,7 @@ * Key Value * --- ----- * GROWL_APP_NAME CFBundleExecutableName - * GROWL_APP_ICON The icon of the application. + * GROWL_APP_ICON_DATA The data of the icon of the application. * GROWL_APP_LOCATION The location of the application. * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL * @@ -336,6 +362,7 @@ * copy of regDict. */ + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict; + /*! @method registrationDictionaryByFillingInDictionary:restrictToKeys: * @abstract Tries to fill in missing keys in a registration dictionary. * @discussion This method examines the passed-in dictionary for missing keys, @@ -344,7 +371,7 @@ * Key Value * --- ----- * GROWL_APP_NAME CFBundleExecutableName - * GROWL_APP_ICON The icon of the application. + * GROWL_APP_ICON_DATA The data of the icon of the application. * GROWL_APP_LOCATION The location of the application. * GROWL_NOTIFICATIONS_DEFAULT GROWL_NOTIFICATIONS_ALL * @@ -368,30 +395,38 @@ * the keys that it will look for are: * * \li GROWL_APP_NAME - * \li GROWL_APP_ICON + * \li GROWL_APP_ICON_DATA * * @since Growl.framework 1.1 */ + (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict; + (NSDictionary *) frameworkInfoDictionary; -@end -//------------------------------------------------------------------------------ #pragma mark - /*! - * @protocol GrowlApplicationBridgeDelegate - * @abstract Required protocol for the Growl delegate. - * @discussion The methods in this protocol are required and are called - * automatically as needed by GrowlApplicationBridge. See - * +[GrowlApplicationBridge setGrowlDelegate:]. - * See also GrowlApplicationBridgeDelegate_InformalProtocol. + *@method growlURLSchemeAvailable + *@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this + *@return Returns whether growl:// is registered on the system + *@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function + * Further, this method can provide a check on whether Growl is installed, + * however, the framework will not be relying on this method for choosing when/how to notify, + * and it is not recommended that the app rely on it for other than whether to use growl:// methods + *@since Growl.framework 1.4 */ ++ (BOOL) isGrowlURLSchemeAvailable; -@protocol GrowlApplicationBridgeDelegate - -// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7. +/*! + * @method openGrowlPreferences: + * @abstract Open Growl preferences, optionally to this app's settings, growl:// method + * @param showApp Whether to show the application's settings, otherwise just opens to the last position + * @return Return's whether opening the URL was succesfull or not. + * @discussion Will launch if Growl is installed, but not running, and open the preferences window + * Uses growl:// URL scheme + * @since Growl.framework 1.4 + */ ++ (BOOL) openGrowlPreferences:(BOOL)showApp; @end @@ -399,11 +434,17 @@ #pragma mark - /*! - * @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol) - * @abstract Methods which may be optionally implemented by the GrowlDelegate. - * @discussion The methods in this informal protocol will only be called if implemented by the delegate. + * @protocol GrowlApplicationBridgeDelegate + * @abstract Required protocol for the Growl delegate. + * @discussion The methods in this protocol are optional and are called + * automatically as needed by GrowlApplicationBridge. See + * +[GrowlApplicationBridge setGrowlDelegate:]. + * See also GrowlApplicationBridgeDelegate_InformalProtocol. */ -@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol) + +@protocol GrowlApplicationBridgeDelegate + +@optional /*! * @method registrationDictionaryForGrowl @@ -510,66 +551,17 @@ */ - (void) growlNotificationTimedOut:(id)clickContext; -@end - -#pragma mark - -/*! - * @category NSObject(GrowlApplicationBridgeDelegate_Installation_InformalProtocol) - * @abstract Methods which may be optionally implemented by the Growl delegate when used with Growl-WithInstaller.framework. - * @discussion The methods in this informal protocol will only be called if - * implemented by the delegate. They allow greater control of the information - * presented to the user when installing or upgrading Growl from within your - * application when using Growl-WithInstaller.framework. - */ -@interface NSObject (GrowlApplicationBridgeDelegate_Installation_InformalProtocol) - -/*! - * @method growlInstallationWindowTitle - * @abstract Return the title of the installation window. - * @discussion If not implemented, Growl will use a default, localized title. - * @result An NSString object to use as the title. - */ -- (NSString *)growlInstallationWindowTitle; - -/*! - * @method growlUpdateWindowTitle - * @abstract Return the title of the upgrade window. - * @discussion If not implemented, Growl will use a default, localized title. - * @result An NSString object to use as the title. - */ -- (NSString *)growlUpdateWindowTitle; - -/*! - * @method growlInstallationInformation - * @abstract Return the information to display when installing. - * @discussion This information may be as long or short as desired (the window - * will be sized to fit it). It will be displayed to the user as an - * explanation of what Growl is and what it can do in your application. It - * should probably note that no download is required to install. - * - * If this is not implemented, Growl will use a default, localized explanation. - * @result An NSAttributedString object to display. - */ -- (NSAttributedString *)growlInstallationInformation; /*! - * @method growlUpdateInformation - * @abstract Return the information to display when upgrading. - * @discussion This information may be as long or short as desired (the window - * will be sized to fit it). It will be displayed to the user as an - * explanation that an updated version of Growl is included in your - * application and no download is required. - * - * If this is not implemented, Growl will use a default, localized explanation. - * @result An NSAttributedString object to display. + * @method hasNetworkClientEntitlement + * @abstract Used only in sandboxed situations since we don't know whether the app has com.apple.security.network.client entitlement + * @discussion GrowlDelegate calls to find out if we have the com.apple.security.network.client entitlement, + * since we can't find this out without hitting the sandbox. We only call it if we detect that the application is sandboxed. */ -- (NSAttributedString *)growlUpdateInformation; +- (BOOL) hasNetworkClientEntitlement; @end -//private -@interface GrowlApplicationBridge (GrowlInstallationPrompt_private) -+ (void) _userChoseNotToInstallGrowl; -@end +#pragma mark - #endif /* __GrowlApplicationBridge_h__ */ diff --git a/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h b/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h index 2b971cfe..0a196f1e 100644 --- a/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h +++ b/Frameworks/Growl.framework/Versions/A/Headers/GrowlDefines.h @@ -7,10 +7,8 @@ #ifdef __OBJC__ #define XSTR(x) (@x) -#define STRING_TYPE NSString * #else #define XSTR CFSTR -#define STRING_TYPE CFStringRef #endif /*! @header GrowlDefines.h @@ -56,7 +54,7 @@ * This key is optional. */ #define GROWL_APP_ID XSTR("ApplicationId") -/*! @defined GROWL_APP_ICON +/*! @defined GROWL_APP_ICON_DATA * @abstract The image data for your application's icon. * @discussion Image data representing your application's icon. This may be * superimposed on a notification icon as a badge, used as the notification @@ -66,7 +64,7 @@ * * Optional. Not supported by all display plugins. */ -#define GROWL_APP_ICON XSTR("ApplicationIcon") +#define GROWL_APP_ICON_DATA XSTR("ApplicationIcon") /*! @defined GROWL_NOTIFICATIONS_DEFAULT * @abstract The array of notifications to turn on by default. * @discussion These are the names of the notifications that should be enabled @@ -101,6 +99,14 @@ * This key is optional. */ #define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions") +/*! @defined GROWL_NOTIFICATIONS_ICONS + * @abstract A dictionary of icons for each notification + * @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are + * icons for each notification, for GNTP spec + * + * This key is optional. + */ +#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons") /*! @defined GROWL_TICKET_VERSION * @abstract The version of your registration ticket. @@ -144,20 +150,20 @@ */ #define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription") /*! @defined GROWL_NOTIFICATION_ICON - * @discussion Image data for the notification icon. Must be in a format + * @discussion Image data for the notification icon. Image data must be in a format * supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. * * Optional. Not supported by all display plugins. */ -#define GROWL_NOTIFICATION_ICON XSTR("NotificationIcon") +#define GROWL_NOTIFICATION_ICON_DATA XSTR("NotificationIcon") /*! @defined GROWL_NOTIFICATION_APP_ICON * @discussion Image data for the application icon, in case GROWL_APP_ICON does - * not apply for some reason. Must be in a format supported by NSImage, such + * not apply for some reason. Image data be in a format supported by NSImage, such * as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF. * * Optional. Not supported by all display plugins. */ -#define GROWL_NOTIFICATION_APP_ICON XSTR("NotificationAppIcon") +#define GROWL_NOTIFICATION_APP_ICON_DATA XSTR("NotificationAppIcon") /*! @defined GROWL_NOTIFICATION_PRIORITY * @discussion The priority of the notification as an integer number from * -2 to +2 (+2 being highest). @@ -185,16 +191,6 @@ */ #define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext") -/*! @defined GROWL_DISPLAY_PLUGIN - * @discussion The name of a display plugin which should be used for this notification. - * Optional. If this key is not set or the specified display plugin does not - * exist, the display plugin stored in the application ticket is used. This key - * allows applications to use different default display plugins for their - * notifications. The user can still override those settings in the preference - * pane. - */ -#define GROWL_DISPLAY_PLUGIN XSTR("NotificationDisplayPlugin") - /*! @defined GROWL_NOTIFICATION_IDENTIFIER * @abstract An identifier for the notification for coalescing purposes. * Notifications with the same identifier fall into the same class; only @@ -224,6 +220,19 @@ */ #define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress") +/*! @defined GROWL_NOTIFICATION_ALREADY_SHOWN + * @abstract If this key is set, it should contain a bool value wrapped + * in a NSNumber which describes whether the notification has + * already been displayed, for instance by built in Notification + * Center support. This value can be used to allow display + * plugins to skip a notification, while still allowing Growl + * actions to run on them. + * + * Optional. Not supported by all display plugins. + */ +#define GROWL_NOTIFICATION_ALREADY_SHOWN XSTR("AlreadyShown") + + // Notifications #pragma mark Notifications @@ -245,7 +254,7 @@ * The userInfo dictionary for this notification can contain these keys: *
    *
  • GROWL_APP_NAME
  • - *
  • GROWL_APP_ICON
  • + *
  • GROWL_APP_ICON_DATA
  • *
  • GROWL_NOTIFICATIONS_ALL
  • *
  • GROWL_NOTIFICATIONS_DEFAULT
  • *
@@ -288,12 +297,6 @@ * Growl_PostNotification. */ #define GROWL_NOTIFICATION XSTR("GrowlNotification") -/*! @defined GROWL_SHUTDOWN -* @abstract The distributed notification name that tells Growl to shutdown. -* @discussion The Growl preference pane posts this notification when the -* "Stop Growl" button is clicked. -*/ -#define GROWL_SHUTDOWN XSTR("GrowlShutdown") /*! @defined GROWL_PING * @abstract A distributed notification to check whether Growl is running. * @discussion This is used by the Growl preference pane. If it receives a @@ -313,15 +316,48 @@ * registration dictionary supplied by its delegate. */ #define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!") -/*! @defined GROWL_NOTIFICATION_CLICKED - * @abstract The distributed notification sent when a supported notification is clicked. + + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX + * @abstract Part of the name of the distributed notification sent when a supported notification is clicked. * @discussion When a Growl notification with a click context is clicked on by - * the user, Growl posts this distributed notification. - * The GrowlApplicationBridge responds to this notification by calling a - * callback in its delegate. + * the user, Growl posts a distributed notification whose name is in the format: + * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX] + * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. + */ +#define GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX XSTR("GrowlClicked!") + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX + * @abstract Part of the name of the distributed notification sent when a supported notification times out without being clicked. + * @discussion When a Growl notification with a click context times out, Growl posts a distributed notification + * whose name is in the format: + * [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX] + * The GrowlApplicationBridge responds to this notification by calling a callback in its delegate. + * NOTE: The user may have actually clicked the 'close' button; this triggers an *immediate* time-out of the notification. */ -#define GROWL_NOTIFICATION_CLICKED XSTR("GrowlClicked!") -#define GROWL_NOTIFICATION_TIMED_OUT XSTR("GrowlTimedOut!") +#define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!") + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON + * @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0 + * @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent + * to inform all running apps that they should now speak to Notification Center directly. + */ +#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON XSTR("GrowlNotificationCenterOn!") + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF + * @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0 + * @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent + * to inform all running apps that they should no longer speak to Notification Center directly. + */ +#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF XSTR("GrowlNotificationCenterOff!") + +/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY + * @abstract The distributed notification sent by an application to query Growl 2.0's notification center support. + * @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification + * center support is on or off. + */ +#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY XSTR("GrowlNotificationCenterYN?") + /*! @group Other symbols */ /* Symbols which don't fit into any of the other categories. */ @@ -345,4 +381,6 @@ #define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition" +#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID") + #endif //ndef _GROWLDEFINES_H diff --git a/Frameworks/Growl.framework/Versions/A/Resources/Info.plist b/Frameworks/Growl.framework/Versions/A/Resources/Info.plist index fa23da2d..6a90f41b 100644 --- a/Frameworks/Growl.framework/Versions/A/Resources/Info.plist +++ b/Frameworks/Growl.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 11C74 + 12C60 CFBundleDevelopmentRegion English CFBundleExecutable @@ -15,25 +15,25 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.3 + 2.0.1 CFBundleSignature GRRR CFBundleVersion - 1.2.3 + 2.0.1 DTCompiler - 4.0 + com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 10M2518 + 4G2008a DTPlatformVersion - PG + GM DTSDKBuild - 9L31a + 12C37 DTSDKName - macosx10.5 + macosx10.8 DTXcode - 0400 + 0452 DTXcodeBuild - 10M2518 + 4G2008a NSPrincipalClass GrowlApplicationBridge diff --git a/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources b/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources new file mode 100644 index 00000000..420b594a --- /dev/null +++ b/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources @@ -0,0 +1,34 @@ + + + + + files + + Resources/Info.plist + + VZb3f8My4te/5JwcjfvotgCXTAs= + + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + + -- cgit v1.2.3 From 918324e27b6b4753307fa6a8166b3d7227f97b35 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 31 Dec 2014 05:36:48 +0100 Subject: Change how Growl status is displayed in prefs The current status of Growl/Notification center will now be shown as a label beneath the "Enable notifications" checkbox. --- Interfaces/English.lproj/Preferences.xib | 225 ++++++++++++++++++------------- Source/SPNotificationsPreferencePane.h | 3 + Source/SPNotificationsPreferencePane.m | 81 +++++++++-- 3 files changed, 210 insertions(+), 99 deletions(-) diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index cc925927..590dde4e 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -88,12 +88,9 @@ {580, 50} - + 256 {580, 172} - - - {{0, 0}, {1920, 1178}} {580, 72} @@ -592,28 +589,29 @@
400 75 - + + + Autodetect + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + YES OtherViews - - - Autodetect - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - + YES @@ -1265,7 +1263,6 @@ {{247, 23}, {316, 17}} - YES 68157504 @@ -1456,7 +1453,7 @@ NSView - + 268 @@ -1464,8 +1461,6 @@ 268 {{422, 14}, {144, 32}} - - YES 67108864 @@ -1487,7 +1482,6 @@ 268 {{205, 20}, {194, 22}} - YES @@ -1508,7 +1502,6 @@ 268 {{202, 59}, {361, 26}} - YES @@ -1579,7 +1572,6 @@ 268 {{17, 25}, {181, 17}} - YES @@ -1599,7 +1591,6 @@ 268 {{17, 65}, {182, 17}} - YES @@ -1619,7 +1610,6 @@ 12 {{205, 89}, {355, 5}} - {0, 0} @@ -1643,7 +1633,6 @@ 268 {{203, 241}, {359, 18}} - YES @@ -1668,7 +1657,6 @@ 268 {{17, 280}, {183, 17}} - YES @@ -1688,7 +1676,6 @@ 268 {{499, 147}, {64, 17}} - YES @@ -1708,7 +1695,6 @@ 268 {{203, 281}, {359, 18}} - YES @@ -1733,7 +1719,6 @@ 268 {{203, 146}, {189, 18}} - YES @@ -1758,7 +1743,6 @@ 268 {{203, 261}, {359, 18}} - YES @@ -1783,7 +1767,6 @@ 268 {{478, 141}, {19, 27}} - YES @@ -1804,7 +1787,6 @@ 268 {{398, 144}, {75, 22}} - YES @@ -1862,7 +1844,6 @@ 268 {{17, 102}, {182, 17}} - YES @@ -1882,7 +1863,6 @@ 268 {{205, 100}, {75, 22}} - YES @@ -1904,7 +1884,6 @@ 268 {{203, 201}, {359, 18}} - YES @@ -1929,7 +1908,6 @@ 12 {{205, 48}, {355, 5}} - {0, 0} @@ -1953,7 +1931,6 @@ 12 {{205, 227}, {355, 5}} - {0, 0} @@ -1977,7 +1954,6 @@ 12 {{205, 172}, {355, 5}} - {0, 0} @@ -2001,7 +1977,6 @@ 12 {{205, 133}, {355, 5}} - {0, 0} @@ -2025,7 +2000,6 @@ 268 {{203, 181}, {359, 18}} - YES @@ -2047,25 +2021,57 @@ {580, 319} - - NSView - + 268 + + + 268 + {{230, 174}, {332, 28}} + + + + _NS:9 + {250, 750} + YES + + 67108864 + 272630016 + JEdyb3dsIFN0YXR1cyBUZXh0JApMaW5lIDI + + _NS:9 + + + + 6 + System + disabledControlTextColor + + 3 + MC4zMzMzMzMzMzMzAA + + + + NO + YES + 1 + 268 - {{202, 173}, {360, 18}} + {{202, 208}, {360, 18}} + + YES 67108864 0 - Enable Growl notifications + Enable notifications 1211912448 @@ -2084,6 +2090,8 @@ 12 {{202, 136}, {360, 5}} + + {0, 0} 67108864 @@ -2106,6 +2114,8 @@ 268 {{202, 150}, {360, 18}} + + YES 67108864 @@ -2129,6 +2139,8 @@ 268 {{202, 110}, {360, 18}} + + YES 67108864 @@ -2152,6 +2164,8 @@ 268 {{230, 87}, {332, 18}} + + YES 67108864 @@ -2175,6 +2189,8 @@ 268 {{230, 41}, {332, 18}} + + YES 67108864 @@ -2198,6 +2214,8 @@ 268 {{230, 64}, {332, 18}} + + YES 67108864 @@ -2221,6 +2239,7 @@ 268 {{230, 18}, {332, 18}} + YES 67108864 @@ -2240,7 +2259,10 @@ NO - {580, 209} + {580, 244} + + + NSView @@ -5201,6 +5223,14 @@ AQAAAAA 2151 + + + growlStatusLabel + + + + X0U-Qs-77g + view @@ -5826,12 +5856,13 @@ AQAAAAA - - - - - + + + + + + @@ -7738,6 +7769,19 @@ AQAAAAA + + cv6-Te-MPL + + + + + + + + JMS-lH-5Te + + + @@ -7907,6 +7951,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {230, 459} com.apple.InterfaceBuilder.CocoaPlugin @@ -8088,6 +8133,8 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + {230, 75} com.apple.InterfaceBuilder.CocoaPlugin @@ -8190,6 +8237,9 @@ AQAAAAA 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 @@ -8477,6 +8527,17 @@ AQAAAAA SPNotificationsPreferencePane SPPreferencePane + + growlStatusLabel + NSTextField + + + growlStatusLabel + + growlStatusLabel + NSTextField + + IBProjectSource ../Source/SPNotificationsPreferencePane.h @@ -8485,25 +8546,17 @@ AQAAAAA SPPreferenceController NSWindowController - - id - id - id - - - - displayEditorPreferences: - id - - + + displayPreferencePane: + id + + + displayPreferencePane: + displayPreferencePane: id - - displayTablePreferences: - id - - + SPAutoUpdatePreferencePane SPEditorPreferencePane @@ -8545,25 +8598,17 @@ AQAAAAA SPPreferenceController - - id - id - id - - - - displayEditorPreferences: - id - - + + displayPreferencePane: + id + + + displayPreferencePane: + displayPreferencePane: id - - displayTablePreferences: - id - - + IBProjectSource ../Source/SPPreferenceController.m diff --git a/Source/SPNotificationsPreferencePane.h b/Source/SPNotificationsPreferencePane.h index e9650928..cf0f4c42 100644 --- a/Source/SPNotificationsPreferencePane.h +++ b/Source/SPNotificationsPreferencePane.h @@ -38,5 +38,8 @@ * Notifications preference pane controller. */ @interface SPNotificationsPreferencePane : SPPreferencePane +{ + IBOutlet NSTextField *growlStatusLabel; +} @end diff --git a/Source/SPNotificationsPreferencePane.m b/Source/SPNotificationsPreferencePane.m index dcd713e2..3c64a1ff 100644 --- a/Source/SPNotificationsPreferencePane.m +++ b/Source/SPNotificationsPreferencePane.m @@ -29,23 +29,66 @@ // More info at #import "SPNotificationsPreferencePane.h" +#import +#import "SPGrowlController.h" + +static NSString *_runningApplicationsKeyPath = @"runningApplications"; @implementation SPNotificationsPreferencePane +- (instancetype)init +{ + self = [super init]; + if (self) { + // this notification is posted by the GrowlApplicationBridge right after + // it would have called -[delegate growlIsReady], so we'll just use this + // as a shortcut. + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(growlLaunchedNotifcation:) + name:GROWL_IS_READY + object:nil]; + // we need to initialize the GrowlApplicationBridge for the notification to actually work + [SPGrowlController sharedGrowlController]; + // Growl doesn't tell use when it exits (even though they DO monitor it). + // This code replicates what it does internally. + [[NSWorkspace sharedWorkspace] addObserver:self + forKeyPath:_runningApplicationsKeyPath + options:NSKeyValueObservingOptionNew + context:nil]; + // TODO: we are only really interested in this notification while we are visible. + } + return self; +} + +-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + //check if growl has exited + if(object == [NSWorkspace sharedWorkspace] && [keyPath isEqualToString:_runningApplicationsKeyPath]){ + [self updateGrowlStatusLabel]; + } +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [[NSWorkspace sharedWorkspace] removeObserver:self forKeyPath:_runningApplicationsKeyPath]; + [super dealloc]; +} + +- (void)growlLaunchedNotifcation:(NSNotification *)notification +{ + [self updateGrowlStatusLabel]; +} + +- (void)preferencePaneWillBeShown +{ + [self updateGrowlStatusLabel]; +} + #pragma mark - #pragma mark Bindings -/** - * Displays an informational message regarding Growl notifications if enabled. - */ - (void)setGrowlEnabled:(BOOL)value { - if (value) { - NSBeginInformationalAlertSheet(NSLocalizedString(@"Growl notification preferences", "Growl notification preferences alert title"), - nil, nil, nil, [[self view] window], self, nil, nil, nil, - NSLocalizedString(@"All Growl notifications are enabled by default. To change which notifications are displayed, go to the Growl Preference Pane in the System Preferences and choose what notifications Growl should display from Sequel Pro.", @"Growl notification preferences alert message")); - } - [prefs setBool:value forKey:SPGrowlEnabled]; } @@ -57,6 +100,26 @@ return [prefs boolForKey:SPGrowlEnabled]; } +- (void)updateGrowlStatusLabel +{ + NSString *text; + if([GrowlApplicationBridge isGrowlRunning]) { + text = NSLocalizedString(@"Growl will be used for sending notifications.\nAdvanced settings can be configured via Growl.",@"Preferences : Notifications : growl status text : growl installed and running"); + } + else { + text = @""; + + if(NSClassFromString(@"NSUserNotificationCenter")) { //this is what growl does + //10.8+ + text = NSLocalizedString(@"Notification Center will be used for sending notifications. ",@"Preferences : Notifications : growl status text : growl not installed, Apple's Notificiation Center is used instead. (KEEP the SPACE at the end)"); + } + //else case would be embedded growl ("Mist", 10.6 - 10.7), but telling that would IMHO be more confusing for the user. + + text = [text stringByAppendingString:NSLocalizedString(@"Install Growl for advanced control over notifications.",@"Preferences : Notifications : growl status text : additional hint when embedded Growl ('Mist') or Notification Center is used.")]; + } + [growlStatusLabel setStringValue:text]; +} + #pragma mark - #pragma mark Preference pane protocol methods -- cgit v1.2.3 From ee588049b5a7f755d788b983dc8cabce24453641 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 Jan 2015 16:08:19 +0100 Subject: =?UTF-8?q?*=20Fix=20broken=20import=20on=2010.6=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Import would not work on a new installation where a certain preference key has not yet been set) * Also attached the gear menu in table structure view to the table header view, so the columns to show can now be selected by right-clicking on the table header (like in Activity Monitor) --- Interfaces/English.lproj/DBView.xib | 166 +++++++++++++++++++++--------------- Source/SPDataImport.m | 7 +- 2 files changed, 105 insertions(+), 68 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index a47effcc..192a0566 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -1141,11 +1141,12 @@ {{-6, -10}, {740, 564}} + source - + 274 @@ -1161,6 +1162,7 @@ -2147483356 {{124, -1}, {33, 25}} + YES @@ -1195,7 +1197,8 @@ 4352 {693, 288} - + + YES NO YES @@ -1204,6 +1207,7 @@ 256 {693, 17} + @@ -1212,12 +1216,13 @@ -2147483392 {15, 20} + name - 60 + 59 50 1000 @@ -1777,6 +1782,7 @@ {{1, 17}, {693, 288}} + @@ -1790,6 +1796,7 @@ {{1, 0}, {693, 17}} + @@ -1798,16 +1805,19 @@ -2147483392 {{674, 17}, {15, 274}} + NO _doScroller: + 0.94791666666666663 -2147483392 {{1, 289}, {689, 16}} + NO 1 @@ -1818,12 +1828,14 @@ {{-1, 22}, {695, 306}} - + + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -1834,6 +1846,7 @@ 292 {{-1, -1}, {32, 25}} + YES @@ -1857,6 +1870,7 @@ 292 {{93, -1}, {32, 25}} + YES @@ -1880,6 +1894,7 @@ 292 {{30, -1}, {32, 25}} + YES @@ -1906,6 +1921,7 @@ 292 {{61, -1}, {32, 25}} + YES @@ -1930,8 +1946,9 @@ 289 - {{661.5, 0}, {36, 23}} + {{662, 0}, {36, 23}} + {250, 250} YES @@ -2031,6 +2048,7 @@ + 1 YES 1 YES @@ -2051,6 +2069,7 @@ {{125, 0}, {506, 23}} + YES @@ -2070,6 +2089,7 @@ 289 {{631, -1}, {32, 25}} + YES @@ -2094,6 +2114,7 @@ {694, 328} + YES NSView @@ -2111,6 +2132,7 @@ 268 {{3, 3}, {58, 14}} + YES @@ -2148,6 +2170,7 @@ {{677, 3}, {10, 13}} + YES @@ -2168,6 +2191,7 @@ {{0, 181}, {694, 20}} + @@ -2183,7 +2207,8 @@ 4352 {693, 141} - + + YES NO YES @@ -2192,6 +2217,7 @@ 256 {693, 17} + @@ -2200,6 +2226,7 @@ -2147483392 {15, 20} + @@ -2462,6 +2489,7 @@ {{1, 17}, {693, 141}} + @@ -2475,6 +2503,7 @@ {{1, 0}, {693, 17}} + @@ -2483,6 +2512,7 @@ -2147483392 {{611, 17}, {15, 126}} + NO @@ -2493,6 +2523,7 @@ -2147483392 {{1, 143}, {610, 15}} + NO 1 @@ -2503,12 +2534,14 @@ {{-1, 22}, {695, 159}} - + + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -2519,6 +2552,7 @@ 292 {{-1, -1}, {32, 25}} + YES @@ -2542,6 +2576,7 @@ 292 {{61, -1}, {32, 25}} + YES @@ -2565,6 +2600,7 @@ 292 {{30, -1}, {32, 25}} + YES @@ -2596,6 +2632,7 @@ {{93, 0}, {601, 23}} + YES @@ -2613,6 +2650,7 @@ {{0, 329}, {694, 201}} + YES NSView @@ -2620,11 +2658,14 @@ {{7, 10}, {694, 530}} + 2 {{10, 7}, {705, 544}} + + Structure @@ -3533,7 +3574,7 @@ customQuery - + 274 @@ -3549,7 +3590,6 @@ {{6, 10}, {695, 23}} - YES @@ -3569,7 +3609,6 @@ 292 {{36, 10}, {36, 23}} - {250, 250} YES @@ -3655,7 +3694,6 @@ 292 {{6, 9}, {32, 25}} - YES @@ -3680,7 +3718,6 @@ 292 {{68, 9}, {32, 25}} - YES @@ -3727,28 +3764,8 @@ 6418 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - {693, 141} - @@ -3807,12 +3824,11 @@ {{1, 1}, {693, 141}} - - {1, -1} + {5, 5} 0 4 @@ -3822,7 +3838,6 @@ -2147483392 {{-100, -100}, {87, 11}} - NO 257 @@ -3835,7 +3850,6 @@ -2147483392 {{224, 1}, {15, 133}} - NO @@ -3844,7 +3858,6 @@ {{0, 1}, {695, 143}} - 133650 @@ -3857,7 +3870,6 @@ {695, 143} - YES NSView @@ -3871,7 +3883,6 @@ 265 {{507, 214}, {180, 22}} - YES @@ -3973,7 +3984,6 @@ 4352 {694, 182} - YES NO @@ -3983,7 +3993,6 @@ 256 {694, 17} - @@ -3992,7 +4001,6 @@ -2147483392 {15, 20} - @@ -4044,7 +4052,6 @@ {{1, 17}, {693, 182}} {{0.5, 0}, {693, 182}} - @@ -4058,7 +4065,6 @@ {{1, 0}, {693, 17}} - @@ -4067,7 +4073,6 @@ -2147483392 {{680, 17}, {15, 199}} - NO @@ -4079,7 +4084,6 @@ 256 {{1, 199}, {693, 15}} - YES NO @@ -4093,7 +4097,6 @@ {{0, -1}, {695, 215}} - 133810 @@ -4111,7 +4114,6 @@ 268 {{156, 214}, {98, 22}} - YES @@ -4225,7 +4227,6 @@ 264 {{38, 214}, {108, 22}} - YES @@ -4339,7 +4340,6 @@ 268 {{-13, 214}, {48, 23}} - {250, 250} YES @@ -4651,7 +4651,6 @@ {{26, 214}, {669, 23}} - YES @@ -4669,7 +4668,6 @@ {{0, 152}, {695, 237}} - YES NSView @@ -4677,13 +4675,11 @@ {695, 389} - {695, 391} - YES @@ -4696,7 +4692,6 @@ 268 {{15, 91}, {363, 14}} - YES @@ -4724,7 +4719,6 @@ 2322 {671, 72} - @@ -4770,7 +4764,6 @@ {671, 72} - @@ -4782,7 +4775,6 @@ -2147483392 {{-100, -100}, {87, 18}} - NO 1 @@ -4795,7 +4787,6 @@ -2147483392 {{225, 0}, {15, 135}} - NO @@ -4804,7 +4795,6 @@ {{12, 12}, {671, 72}} - 133648 @@ -4817,14 +4807,12 @@ {{0, 392}, {695, 117}} - YES {{6, 33}, {695, 509}} - 2 @@ -4833,7 +4821,6 @@ 290 {{103, 12}, {581, 17}} - YES 67108864 @@ -4849,8 +4836,6 @@ {{10, 7}, {705, 544}} - - Custom Query @@ -6715,13 +6700,13 @@ - + 134217731 YES YES - + @@ -15856,6 +15841,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 7498 + + + menu + + + + Uxa-5O-Q0T + menu @@ -30315,6 +30308,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 id NSPopUpButton id + SPTableContentFilterController NSButton NSButton NSButton @@ -30394,6 +30388,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 filterButton id + + filterControllerInstance + SPTableContentFilterController + filterTableClearButton NSButton @@ -30647,6 +30645,35 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 SPTableContentFilterController NSObject + + SPSplitView + NSRuleEditor + SPTableData + SPDatabaseDocument + SPTablesList + + + + contentSplitView + SPSplitView + + + filterRuleEditor + NSRuleEditor + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + IBProjectSource ../Source/SPTableContentFilterController.h @@ -30787,6 +30814,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NSButton SPTableData SPDatabaseDocument + SPTableView SPTablesList @@ -30862,6 +30890,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 tableDocumentInstance SPDatabaseDocument + + tableList + SPTableView + tablesListInstance SPTablesList diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 5859b75d..f1208a54 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -288,7 +288,12 @@ [openPanel setNameFieldStringValue:[lastFilename lastPathComponent]]; } - [openPanel setDirectoryURL:[NSURL URLWithString:[prefs objectForKey:@"openPath"]]]; + NSString *openPath; + if((openPath = [prefs objectForKey:@"openPath"])) { + // Doc says calling +[NSURL URLWithString:] with nil is fine, + // but at least on 10.6 this will cause an exception + [openPanel setDirectoryURL:[NSURL URLWithString:openPath]]; + } [openPanel beginSheetModalForWindow:[tableDocumentInstance parentWindow] completionHandler:^(NSInteger returnCode) { // Ensure text inputs are completed, preventing dead character entry -- cgit v1.2.3 From 30ffc7c4d6158e1210b2463dddb62e627ca410db Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 Jan 2015 16:17:22 +0100 Subject: Some internal addtions for mysql event support (Also deduplicated some code) --- Source/SPConstants.h | 3 ++- Source/SPServerSupport.h | 8 ++++++++ Source/SPServerSupport.m | 5 +++++ Source/SPTablesList.h | 1 + Source/SPTablesList.m | 41 ++++++++++++++++------------------------- 5 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 60787559..415fd4da 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -103,7 +103,8 @@ typedef enum SPTableTypeTable = 0, SPTableTypeView = 1, SPTableTypeProc = 2, - SPTableTypeFunc = 3 + SPTableTypeFunc = 3, + SPTableTypeEvent = 4 } SPTableType; // History views diff --git a/Source/SPServerSupport.h b/Source/SPServerSupport.h index 55b8a6ad..e8b8a613 100644 --- a/Source/SPServerSupport.h +++ b/Source/SPServerSupport.h @@ -85,6 +85,9 @@ // Indexes BOOL supportsIndexKeyBlockSize; + + // Events + BOOL supportsEvents; // Data types BOOL supportsFractionalSeconds; @@ -229,6 +232,11 @@ */ @property (readonly) BOOL supportsTriggers; +/** +* @property supportsEvents Indicates if the server supports scheduled events +*/ +@property (readonly) BOOL supportsEvents; + /** * @property supportsIndexKeyBlockSize Indicates if the server supports specifying an index's key block size */ diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m index 991a9fd3..bf74a61e 100644 --- a/Source/SPServerSupport.m +++ b/Source/SPServerSupport.m @@ -69,6 +69,7 @@ @synthesize supportsArchiveStorageEngine; @synthesize supportsCSVStorageEngine; @synthesize supportsTriggers; +@synthesize supportsEvents; @synthesize supportsIndexKeyBlockSize; @synthesize supportsQuotingEngineTypeInCreateSyntax; @synthesize supportsFractionalSeconds; @@ -185,6 +186,9 @@ // Support for triggers wasn't added until MySQL 5.0.2 supportsTriggers = [self isEqualToOrGreaterThanMajorVersion:5 minor:0 release:2]; + + // Support for events wasn't added until MySQL 5.1.6 + supportsEvents = [self isEqualToOrGreaterThanMajorVersion:5 minor:1 release:6]; // Support for specifying an index's key block size wasn't added until MySQL 5.1.10 supportsIndexKeyBlockSize = [self isEqualToOrGreaterThanMajorVersion:5 minor:1 release:10]; @@ -280,6 +284,7 @@ supportsArchiveStorageEngine = NO; supportsCSVStorageEngine = NO; supportsTriggers = NO; + supportsEvents = NO; supportsIndexKeyBlockSize = NO; supportsQuotingEngineTypeInCreateSyntax = NO; supportsFractionalSeconds = NO; diff --git a/Source/SPTablesList.h b/Source/SPTablesList.h index a8d9ab91..198f327f 100644 --- a/Source/SPTablesList.h +++ b/Source/SPTablesList.h @@ -180,6 +180,7 @@ - (NSArray *)allViewNames; - (NSArray *)allFunctionNames; - (NSArray *)allProcedureNames; +- (NSArray *)allEventNames; - (NSArray *)allDatabaseNames; - (NSArray *)allSystemDatabaseNames; - (NSString *)selectedDatabase; diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 952d4868..3efc45ef 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -91,6 +91,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif - (void)_renameTableOfType:(SPTableType)tableType from:(NSString *)oldTableName to:(NSString *)newTableName; - (void)_duplicateConnectionToFrontTab; +- (NSMutableArray *)_allSchemaObjectsOfType:(SPTableType)type; @end @implementation SPTablesList @@ -1286,47 +1287,37 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; - (NSArray *)allTableNames { - NSMutableArray *returnArray = [NSMutableArray array]; - NSInteger i; - NSInteger cnt = [[self tables] count]; - for(i=0; i Date: Sat, 3 Jan 2015 01:08:03 +0100 Subject: Fix minor UI issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When cancelling a connection, because SSH is asking for a password, the "SSH connecting…" message in the upper right window corner would not be reset. --- Source/SPConnectionController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index e9d9272c..82c29510 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1615,6 +1615,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [progressIndicator display]; [progressIndicatorText setHidden:YES]; [progressIndicatorText display]; + [dbDocument setTitlebarStatus:@""]; // If not testing a connection, Update the password fields, restoring passwords that may have // been bulleted out during connection -- cgit v1.2.3 From 2735e15bf5d4b3a976435ebb29ca9073de0e5071 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 03:57:26 +0100 Subject: Formalize [x release], x = nil; convention Take this commit as a proposal to formalize our existing "[x release], x = nil;" convention by introducing a macro for it. Feel free to revert this commit if you see issues with the approch or implementation. --- Source/DMLocalizedNib.m | 2 +- Source/GeneratePreviewForURL.m | 32 +++++----- Source/NoodleLineNumberView.m | 2 +- Source/SPActivityTextFieldCell.m | 6 +- Source/SPAppController.m | 12 ++-- Source/SPBundleCommandRunner.m | 2 +- Source/SPBundleEditorController.m | 18 +++--- Source/SPCSVExporter.m | 16 ++--- Source/SPCSVParser.m | 4 +- Source/SPConnectionController.m | 38 ++++++------ Source/SPConnectionHandler.m | 12 ++-- Source/SPConsoleMessage.m | 8 +-- Source/SPConstants.h | 7 +++ Source/SPConstants.m | 4 ++ Source/SPCopyTable.m | 10 ++-- Source/SPCustomQuery.m | 14 ++--- Source/SPDataCellFormatter.m | 2 +- Source/SPDataImport.m | 16 ++--- Source/SPDataStorage.m | 8 +-- Source/SPDatabaseData.m | 20 +++---- Source/SPDatabaseDocument.m | 111 +++++++++++++++++------------------ Source/SPDatabaseStructure.m | 6 +- Source/SPDatabaseViewController.m | 2 +- Source/SPDotExporter.m | 12 ++-- Source/SPEditorPreferencePane.m | 16 ++--- Source/SPExportController.m | 12 ++-- Source/SPExportFile.m | 2 +- Source/SPExportInitializer.m | 2 +- Source/SPExporter.m | 6 +- Source/SPExtendedTableInfo.m | 2 +- Source/SPFavoriteNode.m | 2 +- Source/SPFavoritesController.m | 6 +- Source/SPFieldEditorController.m | 2 +- Source/SPFieldMapperController.m | 32 +++++----- Source/SPGeneralPreferencePane.m | 2 +- Source/SPGotoDatabaseController.m | 4 +- Source/SPGroupNode.m | 2 +- Source/SPGrowlController.m | 4 +- Source/SPIndexesController.m | 14 ++--- Source/SPNarrowDownCompletion.m | 2 +- Source/SPNavigatorController.m | 1 - Source/SPPreferenceController.m | 2 +- Source/SPProcessListController.m | 10 ++-- Source/SPQueryController.m | 20 +++---- Source/SPSQLExporter.m | 12 ++-- Source/SPSQLParser.m | 2 +- Source/SPSSHTunnel.m | 20 +++---- Source/SPServerVariablesController.m | 6 +- Source/SPSplitView.m | 16 ++--- Source/SPTableContent.m | 22 +++---- Source/SPTableContentDelegate.m | 2 +- Source/SPTableData.m | 6 +- Source/SPTableFieldValidation.m | 2 +- Source/SPTableRelations.m | 4 +- Source/SPTableStructure.m | 2 +- Source/SPTableStructureLoading.m | 4 +- Source/SPTableTriggers.m | 4 +- Source/SPTablesList.m | 8 +-- Source/SPThreadAdditions.m | 4 +- Source/SPUserManager.m | 28 +++++---- Source/SPXMLExporter.m | 6 +- 61 files changed, 333 insertions(+), 322 deletions(-) diff --git a/Source/DMLocalizedNib.m b/Source/DMLocalizedNib.m index 56f6a810..4a03247a 100644 --- a/Source/DMLocalizedNib.m +++ b/Source/DMLocalizedNib.m @@ -154,7 +154,7 @@ static NSMutableDictionary *deliciousNibNames = nil; { if (deliciousNibNames) { [deliciousNibNames removeObjectForKey:[NSValue valueWithPointer:self]]; - if (![deliciousNibNames count]) [deliciousNibNames release], deliciousNibNames = nil; + if (![deliciousNibNames count]) SPClear(deliciousNibNames); } [self deliciousDealloc]; } diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index 1062f11d..ef20b852 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -78,8 +78,8 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&convError] retain]; if(!spf || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) { - if(spf) [spf release], spf = nil; - if(pool) [pool release], pool = nil; + if(spf) SPClear(spf); + if(pool) SPClear(pool); return noErr; } @@ -89,8 +89,8 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (template == nil || ![template length] || templateReadError != nil) { - if(spf) [spf release], spf = nil; - if(pool) [pool release], pool = nil; + if(spf) SPClear(spf); + if(pool) SPClear(pool); return noErr; } @@ -146,8 +146,8 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (template == nil || ![template length] || templateReadError != nil) { - if(spf) [spf release], spf = nil; - if(pool) [pool release], pool = nil; + if(spf) SPClear(spf); + if(pool) SPClear(pool); return noErr; } // compose the html @@ -162,8 +162,8 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (template == nil || ![template length] || templateReadError != nil) { - if(spf) [spf release], spf = nil; - if(pool) [pool release], pool = nil; + if(spf) SPClear(spf); + if(pool) SPClear(pool); return noErr; } // compose the html @@ -182,7 +182,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (template == nil || ![template length] || templateReadError != nil) { - if(pool) [pool release], pool = nil; + if(pool) SPClear(pool); return noErr; } @@ -190,7 +190,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (windowTemplate == nil || ![windowTemplate length] || templateReadError != nil) { - if(pool) [pool release], pool = nil; + if(pool) SPClear(pool); return noErr; } @@ -205,8 +205,8 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&convError] retain]; if(!spf || readError != nil || [convError length] || !(format == NSPropertyListXMLFormat_v1_0 || format == NSPropertyListBinaryFormat_v1_0)) { - if(spf) [spf release], spf = nil; - if(pool) [pool release], pool = nil; + if(spf) SPClear(spf); + if(pool) SPClear(pool); return noErr; } @@ -323,7 +323,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, encoding:NSUTF8StringEncoding error:&templateReadError]; if (template == nil || ![template length] || templateReadError != nil) { - if(pool) [pool release], pool = nil; + if(pool) SPClear(pool); return noErr; } @@ -418,10 +418,10 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, [sqlHTML appendFormat:@"%@", tokenColor, [[sqlText substringWithRange:tokenRange] HTMLEscapeString]]; if (QLPreviewRequestIsCancelled(preview)) { - if(sqlHTML) [sqlHTML release], sqlHTML = nil; + if(sqlHTML) SPClear(sqlHTML); if(truncatedString) [truncatedString release], sqlHTML = nil; if(sqlText) [sqlText release], sqlHTML = nil; - if(pool) [pool release], pool = nil; + if(pool) SPClear(pool); [loopPool release]; return noErr; } @@ -457,7 +457,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, } else { // No file attributes were read, bail for safety reasons - if(pool) [pool release], pool = nil; + if(pool) SPClear(pool); return noErr; } diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m index 1d58bbed..24b76be1 100644 --- a/Source/NoodleLineNumberView.m +++ b/Source/NoodleLineNumberView.m @@ -497,7 +497,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range); - (void)invalidateLineIndices { - if (lineIndices) [lineIndices release], lineIndices = nil; + if (lineIndices) SPClear(lineIndices); } diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index 5eb2deda..b82fa995 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -324,9 +324,9 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) */ - (void)dealloc { - if(activityName) [activityName release], activityName = nil; - if(activityInfo) [activityInfo release], activityInfo = nil; - if(contextInfo) [contextInfo release], contextInfo = nil; + if(activityName) SPClear(activityName); + if(activityInfo) SPClear(activityInfo); + if(contextInfo) SPClear(contextInfo); if(cancelButton) [cancelButton release]; [super dealloc]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 3f9db630..87cf9f24 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1355,7 +1355,7 @@ */ - (void)setSessionURL:(NSString *)urlString { - if(_sessionURL) [_sessionURL release], _sessionURL = nil; + if(_sessionURL) SPClear(_sessionURL); if(urlString) _sessionURL = [[NSURL fileURLWithPath:urlString] retain]; } @@ -2240,13 +2240,13 @@ if (installedBundleUUIDs) [installedBundleUUIDs release]; if (runningActivitiesArray) [runningActivitiesArray release]; - [prefsController release], prefsController = nil; + SPClear(prefsController); - if (aboutController) [aboutController release], aboutController = nil; - if (bundleEditorController) [bundleEditorController release], bundleEditorController = nil; + if (aboutController) SPClear(aboutController); + if (bundleEditorController) SPClear(bundleEditorController); - if (_sessionURL) [_sessionURL release], _sessionURL = nil; - if (_spfSessionDocData) [_spfSessionDocData release], _spfSessionDocData = nil; + if (_sessionURL) SPClear(_sessionURL); + if (_spfSessionDocData) SPClear(_spfSessionDocData); [super dealloc]; } diff --git a/Source/SPBundleCommandRunner.m b/Source/SPBundleCommandRunner.m index 45184618..08fad6f1 100644 --- a/Source/SPBundleCommandRunner.m +++ b/Source/SPBundleCommandRunner.m @@ -297,7 +297,7 @@ // Read STDOUT saved to file if([fm fileExistsAtPath:stdoutFilePath isDirectory:nil]) { NSString *stdoutContent = [NSString stringWithContentsOfFile:stdoutFilePath encoding:NSUTF8StringEncoding error:nil]; - if(bashTask) [bashTask release], bashTask = nil; + if(bashTask) SPClear(bashTask); [fm removeItemAtPath:stdoutFilePath error:nil]; if(stdoutContent != nil) { if (status == 0) { diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index ac227cf4..69652bf1 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -1093,7 +1093,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [draggedFilePath release]; draggedFilePath = nil; } - if(oldBundleName) [oldBundleName release], oldBundleName = nil; + if(oldBundleName) SPClear(oldBundleName); } #pragma mark - @@ -1234,13 +1234,13 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; // Remember selected bundle name to reset the name if the user cancelled // the editing of the bundle name - if(oldBundleName) [oldBundleName release], oldBundleName = nil; + if(oldBundleName) SPClear(oldBundleName); if(![[self _currentSelectedObject] objectForKey:kChildrenKey]) { oldBundleName = [[[self _currentSelectedObject] objectForKey:kBundleNameKey] retain]; [self _enableBundleDataInput:YES bundleEnabled:![[[self _currentSelectedObject] objectForKey:@"disabled"] boolValue]]; } else { [self _enableBundleDataInput:NO bundleEnabled:NO]; - if(oldBundleName) [oldBundleName release], oldBundleName = nil; + if(oldBundleName) SPClear(oldBundleName); } // Remember the selected bundle name in touchedBundleArray to save only those @@ -1386,7 +1386,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [commandBundleTreeController rearrangeObjects]; [commandsOutlineView reloadData]; - if(oldBundleName) [oldBundleName release], oldBundleName = nil; + if(oldBundleName) SPClear(oldBundleName); oldBundleName = [[[self _currentSelectedObject] objectForKey:kBundleNameKey] retain]; if(oldBundleName != nil && ![touchedBundleArray containsObject:oldBundleName]) [touchedBundleArray addObject:oldBundleName]; @@ -2102,11 +2102,11 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; [shellVariableSuggestions release]; [deletedDefaultBundles release]; - if (touchedBundleArray) [touchedBundleArray release], touchedBundleArray = nil; - if (commandBundleTree) [commandBundleTree release], commandBundleTree = nil; - if (sortDescriptor) [sortDescriptor release], sortDescriptor = nil; - if (bundlePath) [bundlePath release], bundlePath = nil; - if (esUndoManager) [esUndoManager release], esUndoManager = nil; + if (touchedBundleArray) SPClear(touchedBundleArray); + if (commandBundleTree) SPClear(commandBundleTree); + if (sortDescriptor) SPClear(sortDescriptor); + if (bundlePath) SPClear(bundlePath); + if (esUndoManager) SPClear(esUndoManager); [super dealloc]; } diff --git a/Source/SPCSVExporter.m b/Source/SPCSVExporter.m index dd244410..5fb6f664 100644 --- a/Source/SPCSVExporter.m +++ b/Source/SPCSVExporter.m @@ -415,15 +415,15 @@ - (void)dealloc { - if (csvDataArray) [csvDataArray release], csvDataArray = nil; - if (csvTableName) [csvTableName release], csvTableName = nil; + if (csvDataArray) SPClear(csvDataArray); + if (csvTableName) SPClear(csvTableName); - [csvFieldSeparatorString release], csvFieldSeparatorString = nil; - [csvEnclosingCharacterString release], csvEnclosingCharacterString = nil; - [csvEscapeString release], csvEscapeString = nil; - [csvLineEndingString release], csvLineEndingString = nil; - [csvNULLString release], csvNULLString = nil; - [csvTableData release], csvTableData = nil; + SPClear(csvFieldSeparatorString); + SPClear(csvEnclosingCharacterString); + SPClear(csvEscapeString); + SPClear(csvLineEndingString); + SPClear(csvNULLString); + SPClear(csvTableData); [super dealloc]; } diff --git a/Source/SPCSVParser.m b/Source/SPCSVParser.m index 09d8c989..88a2fbb5 100644 --- a/Source/SPCSVParser.m +++ b/Source/SPCSVParser.m @@ -469,7 +469,7 @@ */ - (void) setNullReplacementString:(NSString *)nullString { - if (nullReplacementString) [nullReplacementString release], nullReplacementString = nil; + if (nullReplacementString) SPClear(nullReplacementString); if (nullString) nullReplacementString = [[NSString alloc] initWithString:nullString]; } @@ -576,7 +576,7 @@ { NSMutableString *charactersToSkip; - if (skipCharacterSet) [skipCharacterSet release], skipCharacterSet = nil; + if (skipCharacterSet) SPClear(skipCharacterSet); charactersToSkip = [[NSMutableString alloc] init]; if (![fieldEndString isEqualToString:@" "] && ![fieldQuoteString isEqualToString:@" "] && ![escapeString isEqualToString:@" "] && ![lineEndString isEqualToString:@" "]) diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 82c29510..651d3538 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -256,8 +256,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [[sshPasswordField undoManager] removeAllActionsWithTarget:sshPasswordField]; } else { - [connectionKeychainItemName release], connectionKeychainItemName = nil; - [connectionKeychainItemAccount release], connectionKeychainItemAccount = nil; + SPClear(connectionKeychainItemName); + SPClear(connectionKeychainItemAccount); } } @@ -267,8 +267,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [[sshSSHPasswordField undoManager] removeAllActionsWithTarget:sshSSHPasswordField]; } else { - [connectionSSHKeychainItemName release], connectionSSHKeychainItemName = nil; - [connectionSSHKeychainItemAccount release], connectionSSHKeychainItemAccount = nil; + SPClear(connectionSSHKeychainItemName); + SPClear(connectionSSHKeychainItemAccount); } } #endif @@ -608,11 +608,11 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, #ifndef SP_CODA // Clear the keychain referral items as appropriate - if (connectionKeychainID) [connectionKeychainID release], connectionKeychainID = nil; - if (connectionKeychainItemName) [connectionKeychainItemName release], connectionKeychainItemName = nil; - if (connectionKeychainItemAccount) [connectionKeychainItemAccount release], connectionKeychainItemAccount = nil; - if (connectionSSHKeychainItemName) [connectionSSHKeychainItemName release], connectionSSHKeychainItemName = nil; - if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release], connectionSSHKeychainItemAccount = nil; + if (connectionKeychainID) SPClear(connectionKeychainID); + if (connectionKeychainItemName) SPClear(connectionKeychainItemName); + if (connectionKeychainItemAccount) SPClear(connectionKeychainItemAccount); + if (connectionSSHKeychainItemName) SPClear(connectionSSHKeychainItemName); + if (connectionSSHKeychainItemAccount) SPClear(connectionSSHKeychainItemAccount); SPTreeNode *node = [self selectedFavoriteNode]; if ([node isGroup]) node = nil; @@ -621,7 +621,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, NSDictionary *fav = [[node representedObject] nodeFavorite]; // Keep a copy of the favorite as it currently stands - if (currentFavorite) [currentFavorite release], currentFavorite = nil; + if (currentFavorite) SPClear(currentFavorite); currentFavorite = [fav copy]; [connectionResizeContainer setHidden:NO]; @@ -669,8 +669,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if (![[self password] length]) { [self setPassword:nil]; - [connectionKeychainItemName release], connectionKeychainItemName = nil; - [connectionKeychainItemAccount release], connectionKeychainItemAccount = nil; + SPClear(connectionKeychainItemName); + SPClear(connectionKeychainItemAccount); } // Store the selected favorite ID for use with the document on connection @@ -684,8 +684,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if (![[self sshPassword] length]) { [self setSshPassword:nil]; - [connectionSSHKeychainItemName release], connectionSSHKeychainItemName = nil; - [connectionSSHKeychainItemAccount release], connectionSSHKeychainItemAccount = nil; + SPClear(connectionSSHKeychainItemName); + SPClear(connectionSSHKeychainItemAccount); } [prefs setInteger:[[fav objectForKey:SPFavoriteIDKey] integerValue] forKey:SPLastFavoriteID]; @@ -1365,7 +1365,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self _stopEditingConnection]; - if (currentFavorite) [currentFavorite release], currentFavorite = nil; + if (currentFavorite) SPClear(currentFavorite); currentFavorite = [theFavorite copy]; [self _sortFavorites]; @@ -1888,9 +1888,9 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [prefs release]; #ifndef SP_CODA - [folderImage release], folderImage = nil; - [quickConnectItem release], quickConnectItem = nil; - [quickConnectCell release], quickConnectCell = nil; + SPClear(folderImage); + SPClear(quickConnectItem); + SPClear(quickConnectCell); #endif for (id retainedObject in nibObjectsToRelease) [retainedObject release]; @@ -1904,7 +1904,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release]; #ifndef SP_CODA - if (currentFavorite) [currentFavorite release], currentFavorite = nil; + if (currentFavorite) SPClear(currentFavorite); #endif [super dealloc]; diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index 12b868f5..bac0c680 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -208,9 +208,9 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; // Tidy up isConnecting = NO; - if (sshTunnel) [sshTunnel disconnect], [sshTunnel release], sshTunnel = nil; + if (sshTunnel) [sshTunnel disconnect], SPClear(sshTunnel); - [mySQLConnection release], mySQLConnection = nil; + SPClear(mySQLConnection); #ifndef SP_CODA if (!cancellingConnection) [self _restoreConnectionInterface]; #endif @@ -229,9 +229,9 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; // Tidy up isConnecting = NO; - if (sshTunnel) [sshTunnel release], sshTunnel = nil; + if (sshTunnel) SPClear(sshTunnel); - [mySQLConnection release], mySQLConnection = nil; + SPClear(mySQLConnection); [self _restoreConnectionInterface]; if (isTestingConnection) { [self _showConnectionTestResult:NSLocalizedString(@"Invalid database", @"Invalid database very short status message")]; @@ -352,7 +352,7 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; #endif // Release the tunnel if set - will now be retained by the connection - if (sshTunnel) [sshTunnel release], sshTunnel = nil; + if (sshTunnel) SPClear(sshTunnel); // Pass the connection to the document and clean up the interface [self addConnectionToDocument]; @@ -436,7 +436,7 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; // Release as appropriate if (sshTunnel) { - [sshTunnel disconnect], [sshTunnel release], sshTunnel = nil; + [sshTunnel disconnect], SPClear(sshTunnel); // If the SSH tunnel connection failed because the port it was trying to bind to was already in use take note // of it so we can give the user the option of connecting via standard connection and use the existing tunnel. diff --git a/Source/SPConsoleMessage.m b/Source/SPConsoleMessage.m index 6ada323a..eb7573f9 100644 --- a/Source/SPConsoleMessage.m +++ b/Source/SPConsoleMessage.m @@ -65,10 +65,10 @@ - (void)dealloc { - [message release], message = nil; - [messageDate release], messageDate = nil; - [messageDatabase release], messageDatabase = nil; - [messageConnection release], messageConnection = nil; + SPClear(message); + SPClear(messageDate); + SPClear(messageDatabase); + SPClear(messageConnection); [super dealloc]; } diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 415fd4da..f0350f07 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -612,6 +612,13 @@ extern NSString *SPURLSchemeQueryResultMetaPathHeader; #define SPAppDelegate ((SPAppController *)[NSApp delegate]) +// Provides a standard method for our "[x release], x = nil;" convention. +// Yes, this could have been done with a preprocessor macro alone, however +// a function works more nicely in the debugger and in production code +// the optimizer will most likely remove all overhead by inlining anyway :) +void _SPClear(id *addr); +#define SPClear(x) _SPClear(&x) + //Backwards compatibility #ifndef __MAC_10_7 #define __MAC_10_7 1070 diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 23d8c378..292acb3c 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -417,3 +417,7 @@ NSString *SPURLSchemeQueryInputPathHeader = @"/tmp/SP_QUERY_"; NSString *SPURLSchemeQueryResultPathHeader = @"/tmp/SP_QUERY_RESULT_"; NSString *SPURLSchemeQueryResultStatusPathHeader = @"/tmp/SP_QUERY_RESULT_STATUS_"; NSString *SPURLSchemeQueryResultMetaPathHeader = @"/tmp/SP_QUERY_META_"; + +void inline _SPClear(id *addr) { + [*addr release], *addr = nil; +} diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 3efc132a..7aaae1a6 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -219,7 +219,7 @@ static const NSInteger kBlobAsImageFile = 4; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; [d writeToFile:fp atomically:NO]; - if(d) [d release], d = nil; + if(d) SPClear(d); [image release]; } else { NSString *noData = @""; @@ -242,7 +242,7 @@ static const NSInteger kBlobAsImageFile = 4; } else { [result appendFormat:@"%@\t", [cellData wktString]]; } - if(v) [v release], v = nil; + if(v) SPClear(v); } else { [result appendFormat:@"%@\t", [cellData wktString]]; } @@ -358,7 +358,7 @@ static const NSInteger kBlobAsImageFile = 4; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; [d writeToFile:fp atomically:NO]; - if(d) [d release], d = nil; + if(d) SPClear(d); [image release]; } else { NSString *noData = @""; @@ -381,7 +381,7 @@ static const NSInteger kBlobAsImageFile = 4; } else { [result appendFormat:@"\"%@\",", [cellData wktString]]; } - if(v) [v release], v = nil; + if(v) SPClear(v); } else { [result appendFormat:@"\"%@\",", [cellData wktString]]; } @@ -698,7 +698,7 @@ static const NSInteger kBlobAsImageFile = 4; tableInstance = anInstance; tableStorage = theTableStorage; - if (columnDefinitions) [columnDefinitions release], columnDefinitions = nil; + if (columnDefinitions) SPClear(columnDefinitions); columnDefinitions = [[NSArray alloc] initWithArray:columnDefs]; } diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 8b201776..2114d766 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -141,7 +141,7 @@ // Re-init sort order isDesc = NO; sortColumn = nil; - if(sortField) [sortField release], sortField = nil; + if(sortField) SPClear(sortField); // Retrieve the custom query string and split it into separate SQL queries queryParser = [[SPSQLParser alloc] initWithString:[textView string]]; @@ -185,7 +185,7 @@ // Re-init sort order isDesc = NO; sortColumn = nil; - if(sortField) [sortField release], sortField = nil; + if(sortField) SPClear(sortField); // If the current selection is a single caret position, run the current query. if (selectedRange.length == 0) { @@ -628,7 +628,7 @@ // Remove all the columns if not reloading the table if(!reloadingExistingResult) { - if (cqColumnDefinition) [cqColumnDefinition release], cqColumnDefinition = nil; + if (cqColumnDefinition) SPClear(cqColumnDefinition); [[self onMainThread] updateTableView]; } @@ -1736,7 +1736,7 @@ */ - (void)setResultSelectedRowIndexesToRestore:(NSIndexSet *)theIndexSet { - if (selectionIndexToRestore) [selectionIndexToRestore release], selectionIndexToRestore = nil; + if (selectionIndexToRestore) SPClear(selectionIndexToRestore); if (theIndexSet) selectionIndexToRestore = [[NSIndexSet alloc] initWithIndexSet:theIndexSet]; } @@ -2273,7 +2273,7 @@ if ([mySQLConnection queryErrored]) { sortColumn = nil; - if(sortField) [sortField release], sortField = nil; + if(sortField) SPClear(sortField); return; } @@ -2449,7 +2449,7 @@ // Open the editing sheet if required if ([customQueryView shouldUseFieldEditorForRow:rowIndex column:[[aTableColumn identifier] integerValue] checkWithLock:NULL]) { - if (fieldEditor) [fieldEditor release], fieldEditor = nil; + if (fieldEditor) SPClear(fieldEditor); fieldEditor = [[SPFieldEditorController alloc] init]; // Remember edited row for reselecting and setting the scroll view after reload @@ -4042,7 +4042,7 @@ [resultData release]; [favoritesManager release]; - if(fieldEditor) [fieldEditor release], fieldEditor = nil; + if(fieldEditor) SPClear(fieldEditor); #ifndef SP_CODA if (helpHTMLTemplate) [helpHTMLTemplate release]; diff --git a/Source/SPDataCellFormatter.m b/Source/SPDataCellFormatter.m index 2cd3b8c8..6c6cd913 100644 --- a/Source/SPDataCellFormatter.m +++ b/Source/SPDataCellFormatter.m @@ -140,7 +140,7 @@ - (void)dealloc { - if (fieldType) [fieldType release], fieldType = nil; + if (fieldType) SPClear(fieldType); [super dealloc]; } diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index f1208a54..be3935c4 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -1324,7 +1324,7 @@ cleanup: dispatch_async(dispatch_get_main_queue(), ^{ - if(fieldMapperController) [fieldMapperController release], fieldMapperController = nil; + if(fieldMapperController) SPClear(fieldMapperController); }); return success; @@ -1715,13 +1715,13 @@ cleanup: */ - (void)_resetFieldMappingGlobals { - if (csvImportTailString) [csvImportTailString release], csvImportTailString = nil; - if (csvImportHeaderString) [csvImportHeaderString release], csvImportHeaderString = nil; - if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; - if (fieldMappingGlobalValueArray) [fieldMappingGlobalValueArray release], fieldMappingGlobalValueArray = nil; - if (fieldMappingTableColumnNames) [fieldMappingTableColumnNames release], fieldMappingTableColumnNames = nil; - if (fieldMappingTableDefaultValues) [fieldMappingTableDefaultValues release], fieldMappingTableDefaultValues = nil; - if (fieldMapperOperator) [fieldMapperOperator release], fieldMapperOperator = nil; + if (csvImportTailString) SPClear(csvImportTailString); + if (csvImportHeaderString) SPClear(csvImportHeaderString); + if (fieldMappingArray) SPClear(fieldMappingArray); + if (fieldMappingGlobalValueArray) SPClear(fieldMappingGlobalValueArray); + if (fieldMappingTableColumnNames) SPClear(fieldMappingTableColumnNames); + if (fieldMappingTableDefaultValues) SPClear(fieldMappingTableDefaultValues); + if (fieldMapperOperator) SPClear(fieldMapperOperator); } #pragma mark - diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m index 30be0644..3db04159 100644 --- a/Source/SPDataStorage.m +++ b/Source/SPDataStorage.m @@ -58,7 +58,7 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore { NSUInteger i; editedRowCount = 0; - [editedRows release], editedRows = nil; + SPClear(editedRows); if (unloadedColumns) free(unloadedColumns), unloadedColumns = NULL; if (dataStorage) { @@ -68,7 +68,7 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore [newDataStorage replaceExistingResultStore:dataStorage]; } - [dataStorage release], dataStorage = nil; + SPClear(dataStorage); } dataStorage = [newDataStorage retain]; @@ -449,8 +449,8 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore } - (void) dealloc { - [dataStorage release], dataStorage = nil; - [editedRows release], editedRows = nil; + SPClear(dataStorage); + SPClear(editedRows); if (unloadedColumns) free(unloadedColumns), unloadedColumns = NULL; [super dealloc]; diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m index 58ffa2d2..4856505d 100644 --- a/Source/SPDatabaseData.m +++ b/Source/SPDatabaseData.m @@ -82,11 +82,11 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, */ - (void)resetAllData { - if (characterSetEncoding != nil) [characterSetEncoding release], characterSetEncoding = nil; - if (defaultCollation != nil) [defaultCollation release], defaultCollation = nil; - if (defaultCharacterSetEncoding != nil) [defaultCharacterSetEncoding release], defaultCharacterSetEncoding = nil; - if (serverDefaultCharacterSetEncoding) [serverDefaultCharacterSetEncoding release], serverDefaultCharacterSetEncoding = nil; - if (serverDefaultCollation) [serverDefaultCollation release], serverDefaultCollation = nil; + if (characterSetEncoding != nil) SPClear(characterSetEncoding); + if (defaultCollation != nil) SPClear(defaultCollation); + if (defaultCharacterSetEncoding != nil) SPClear(defaultCharacterSetEncoding); + if (serverDefaultCharacterSetEncoding) SPClear(serverDefaultCharacterSetEncoding); + if (serverDefaultCollation) SPClear(serverDefaultCollation); [collations removeAllObjects]; [characterSetCollations removeAllObjects]; @@ -489,11 +489,11 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, { [self resetAllData]; - [collations release], collations = nil; - [characterSetCollations release], characterSetCollations = nil; - [storageEngines release], storageEngines = nil; - [characterSetEncodings release], characterSetEncodings = nil; - [cachedCollationsByEncoding release], cachedCollationsByEncoding = nil; + SPClear(collations); + SPClear(characterSetCollations); + SPClear(storageEngines); + SPClear(characterSetEncodings); + SPClear(cachedCollationsByEncoding); [super dealloc]; } diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 9f5ce128..6940abfb 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -473,7 +473,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Update the selected database if appropriate if ([connectionController database] && ![[connectionController database] isEqualToString:@""]) { - if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; + if (selectedDatabase) SPClear(selectedDatabase); selectedDatabase = [[NSString alloc] initWithString:[connectionController database]]; #ifndef SP_CODA /* [spHistoryControllerInstance updateHistoryEntries] */ [spHistoryControllerInstance updateHistoryEntries]; @@ -665,8 +665,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [[chooseDatabaseButton menu] addItem:[NSMenuItem separatorItem]]; #endif - if (allDatabases) [allDatabases release]; - if (allSystemDatabases) [allSystemDatabases release]; + if (allDatabases) SPClear(allDatabases); + if (allSystemDatabases) SPClear(allSystemDatabases); NSArray *theDatabaseList = [mySQLConnection databases]; @@ -1056,7 +1056,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA // Close error status sheet for OPTIMIZE, CHECK, REPAIR etc. else if ([contextInfo isEqualToString:@"statusError"]) { - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); } #endif } @@ -1096,7 +1096,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; if(![dbName isNSNull]) { if(![dbName isEqualToString:selectedDatabase]) { - if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; + if (selectedDatabase) SPClear(selectedDatabase); selectedDatabase = [[NSString alloc] initWithString:dbName]; [chooseDatabaseButton selectItemWithTitle:selectedDatabase]; #ifndef SP_CODA /* [self updateWindowTitle:self] */ @@ -1104,7 +1104,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #endif } } else { - if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; + if (selectedDatabase) SPClear(selectedDatabase); [chooseDatabaseButton selectItemAtIndex:0]; #ifndef SP_CODA /* [self updateWindowTitle:self] */ [self updateWindowTitle:self]; @@ -1313,8 +1313,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // If the window has been fully faded in, clean up the timer. if (alphaValue == 1.0) { - [taskDrawTimer invalidate], [taskDrawTimer release], taskDrawTimer = nil; - [taskFadeInStartDate release], taskFadeInStartDate = nil; + [taskDrawTimer invalidate], SPClear(taskDrawTimer); + SPClear(taskFadeInStartDate); } #endif } @@ -1424,8 +1424,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA // Cancel the draw timer if it exists if (taskDrawTimer) { - [taskDrawTimer invalidate], [taskDrawTimer release], taskDrawTimer = nil; - [taskFadeInStartDate release], taskFadeInStartDate = nil; + [taskDrawTimer invalidate], SPClear(taskDrawTimer); + SPClear(taskFadeInStartDate); } // Hide the task interface and reset to indeterminate @@ -1712,7 +1712,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSString *mysqlEncoding = [databaseDataInstance getDatabaseDefaultCharacterSet]; - [selectedDatabaseEncoding release], selectedDatabaseEncoding = nil; + SPClear(selectedDatabaseEncoding); // Fallback or older version? -> set encoding to mysql default encoding latin1 if ( !mysqlEncoding ) { @@ -1953,7 +1953,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2030,7 +2030,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2107,7 +2107,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2183,7 +2183,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2259,7 +2259,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo:NULL]; } else { message = NSLocalizedString(@"MySQL said:",@"mysql said message"); - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:message]; @@ -2315,7 +2315,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; didEndSelector:NULL contextInfo:NULL]; } else { - if (statusValues) [statusValues release], statusValues = nil; + if (statusValues) SPClear(statusValues); statusValues = [resultStatuses retain]; NSAlert *alert = [[NSAlert new] autorelease]; [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Checksums of %@",@"Checksums of %@ message"), what]]; @@ -2487,7 +2487,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [userManagerInstance beginSheetModalForWindow:parentWindow completionHandler:^(){ - [userManagerInstance release], userManagerInstance = nil; + SPClear(userManagerInstance); }]; } @@ -3044,7 +3044,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [self saveDocumentWithFilePath:fileName inBackground:NO onlyPreferences:NO contextInfo:nil]; // Manually loaded nibs don't have their top-level objects released automatically - do that here. - [saveConnectionAccessory release]; + SPClear(saveConnectionAccessory); if(contextInfo == @"saveSPFfileAndClose") [self closeAndDisconnect]; @@ -4357,7 +4357,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; */ - (void)setFileURL:(NSURL *)theURL { - if (spfFileURL) [spfFileURL release], spfFileURL = nil; + if (spfFileURL) SPClear(spfFileURL); spfFileURL = [theURL retain]; if ([parentWindowController selectedTableDocument] == self) { if (spfFileURL && [spfFileURL isFileURL]) @@ -5016,8 +5016,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [self updateWindowTitle:self]; // dealloc spfSession data - [spfSession release]; - spfSession = nil; + SPClear(spfSession); // End the task [self endTask]; @@ -6064,7 +6063,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // that's why we can run this on main thread [databaseStructureRetrieval queryDbStructureWithUserInfo:nil]; - if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; + if (selectedDatabase) SPClear(selectedDatabase); [self setDatabases:self]; @@ -6134,7 +6133,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA /* chooseDatabaseButton selectItemWithTitle: */ [[chooseDatabaseButton onMainThread] selectItemWithTitle:targetDatabaseName]; #endif - if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; + if (selectedDatabase) SPClear(selectedDatabase); selectedDatabase = [[NSString alloc] initWithString:targetDatabaseName]; [databaseDataInstance resetAllData]; @@ -6280,59 +6279,59 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; #ifndef SP_CODA /* release nib objects */ for (id retainedObject in nibObjectsToRelease) [retainedObject release]; - [nibObjectsToRelease release]; + SPClear(nibObjectsToRelease); #endif // Tell listeners that this database document is being closed - fixes retain cycles and allows cleanup [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentWillCloseNotification object:self]; - [databaseStructureRetrieval release]; + SPClear(databaseStructureRetrieval); - [allDatabases release]; - [allSystemDatabases release]; - [gotoDatabaseController release]; + SPClear(allDatabases); + SPClear(allSystemDatabases); + SPClear(gotoDatabaseController); #ifndef SP_CODA /* dealloc ivars */ - [undoManager release]; - [printWebView release]; + SPClear(undoManager); + SPClear(printWebView); #endif - [selectedDatabaseEncoding release]; + SPClear(selectedDatabaseEncoding); #ifndef SP_CODA [taskProgressWindow close]; #endif - if (selectedTableName) [selectedTableName release]; - if (connectionController) [connectionController release]; + if (selectedTableName) SPClear(selectedTableName); + if (connectionController) SPClear(connectionController); #ifndef SP_CODA /* dealloc ivars */ - if (processListController) [processListController release]; - if (serverVariablesController) [serverVariablesController release]; + if (processListController) SPClear(processListController); + if (serverVariablesController) SPClear(serverVariablesController); #endif - if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil; - if (selectedDatabase) [selectedDatabase release]; - if (mySQLVersion) [mySQLVersion release]; + if (mySQLConnection) SPClear(mySQLConnection); + if (selectedDatabase) SPClear(selectedDatabase); + if (mySQLVersion) SPClear(mySQLVersion); #ifndef SP_CODA - if (taskDrawTimer) [taskDrawTimer invalidate], [taskDrawTimer release]; - if (taskFadeInStartDate) [taskFadeInStartDate release]; + if (taskDrawTimer) [taskDrawTimer invalidate], SPClear(taskDrawTimer); + if (taskFadeInStartDate) SPClear(taskFadeInStartDate); #endif - if (queryEditorInitString) [queryEditorInitString release]; + if (queryEditorInitString) SPClear(queryEditorInitString); #ifndef SP_CODA - if (sqlFileURL) [sqlFileURL release]; - if (spfFileURL) [spfFileURL release]; - if (spfPreferences) [spfPreferences release]; - if (spfSession) [spfSession release]; - if (spfDocData) [spfDocData release]; + if (sqlFileURL) SPClear(sqlFileURL); + if (spfFileURL) SPClear(spfFileURL); + if (spfPreferences) SPClear(spfPreferences); + if (spfSession) SPClear(spfSession); + if (spfDocData) SPClear(spfDocData); #endif - if (keyChainID) [keyChainID release]; + if (keyChainID) SPClear(keyChainID); #ifndef SP_CODA - if (mainToolbar) [mainToolbar release]; + if (mainToolbar) SPClear(mainToolbar); #endif - if (titleAccessoryView) [titleAccessoryView release]; + if (titleAccessoryView) SPClear(titleAccessoryView); #ifndef SP_CODA - if (taskProgressWindow) [taskProgressWindow release]; + if (taskProgressWindow) SPClear(taskProgressWindow); #endif - if (serverSupport) [serverSupport release]; + if (serverSupport) SPClear(serverSupport); #ifndef SP_CODA /* dealloc ivars */ - if (processID) [processID release]; - if (runningActivitiesArray) [runningActivitiesArray release]; + if (processID) SPClear(processID); + if (runningActivitiesArray) SPClear(runningActivitiesArray); #endif #ifdef SP_CODA @@ -6340,8 +6339,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; if (customQueryInstance) [customQueryInstance release]; #endif - if (alterDatabaseCharsetHelper) [alterDatabaseCharsetHelper release]; - if (addDatabaseCharsetHelper) [addDatabaseCharsetHelper release]; + if (alterDatabaseCharsetHelper) SPClear(alterDatabaseCharsetHelper); + if (addDatabaseCharsetHelper) SPClear(addDatabaseCharsetHelper); [super dealloc]; } diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m index 70d0aee5..b34522c5 100644 --- a/Source/SPDatabaseStructure.m +++ b/Source/SPDatabaseStructure.m @@ -573,9 +573,9 @@ pthread_mutex_destroy(&dataLock); pthread_mutex_destroy(&connectionCheckLock); - if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil; - if (structure) [structure release], structure = nil; - if (allKeysofDbStructure) [allKeysofDbStructure release], allKeysofDbStructure = nil; + if (mySQLConnection) SPClear(mySQLConnection); + if (structure) SPClear(structure); + if (allKeysofDbStructure) SPClear(allKeysofDbStructure); [super dealloc]; } diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index 9b0ded39..c43761d3 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -332,7 +332,7 @@ if (!aTable) { // Update the selected table name and type - if (selectedTableName) [selectedTableName release], selectedTableName = nil; + if (selectedTableName) SPClear(selectedTableName); selectedTableType = SPTableTypeNone; diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m index 249851ea..5f1dbd42 100644 --- a/Source/SPDotExporter.m +++ b/Source/SPDotExporter.m @@ -231,12 +231,12 @@ { delegate = nil; - [dotExportTables release], dotExportTables = nil; - [dotExportCurrentTable release], dotExportCurrentTable = nil; - [dotTableData release], dotTableData = nil; - [dotDatabaseHost release], dotDatabaseHost = nil; - [dotDatabaseName release], dotDatabaseName = nil; - [dotDatabaseVersion release], dotDatabaseVersion = nil; + SPClear(dotExportTables); + SPClear(dotExportCurrentTable); + SPClear(dotTableData); + SPClear(dotDatabaseHost); + SPClear(dotDatabaseName); + SPClear(dotDatabaseVersion); [super dealloc]; } diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index 08a833c2..7eaecf47 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -209,7 +209,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; if (![fm fileExistsAtPath:selectedPath isDirectory:nil]) { if ([fm copyItemAtPath:[NSString stringWithFormat:@"%@/%@.%@", themePath, [editThemeListItems objectAtIndex:[editThemeListTable selectedRow]], SPColorThemeFileExtension] toPath:selectedPath error:nil]) { - if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; + if (editThemeListItems) SPClear(editThemeListItems); editThemeListItems = [[NSArray arrayWithArray:[self _getAvailableThemes]] retain]; @@ -243,7 +243,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; [prefs setObject:SPCustomColorSchemeName forKey:SPCustomQueryEditorThemeName]; } - if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; + if (editThemeListItems) SPClear(editThemeListItems); editThemeListItems = [[NSArray arrayWithArray:[self _getAvailableThemes]] retain]; @@ -313,7 +313,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; { [[NSColorPanel sharedColorPanel] close]; - if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; + if (editThemeListItems) SPClear(editThemeListItems); editThemeListItems = [[NSArray arrayWithArray:[self _getAvailableThemes]] retain]; @@ -595,7 +595,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; } // Reload everything needed - if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; + if (editThemeListItems) SPClear(editThemeListItems); editThemeListItems = [[NSArray arrayWithArray:[self _getAvailableThemes]] retain]; [editThemeListTable reloadData]; @@ -1029,10 +1029,10 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; */ - (void)dealloc { - if (themePath) [themePath release], themePath = nil; - if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; - if (editorColors) [editorColors release], editorColors = nil; - if (editorNameForColors) [editorNameForColors release], editorNameForColors = nil; + if (themePath) SPClear(themePath); + if (editThemeListItems) SPClear(editThemeListItems); + if (editorColors) SPClear(editorColors); + if (editorNameForColors) SPClear(editorNameForColors); [super dealloc]; } diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 4a97ae00..752e8521 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -1039,13 +1039,13 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; - (void)dealloc { - [tables release], tables = nil; - [exporters release], exporters = nil; - [exportFiles release], exportFiles = nil; - [operationQueue release], operationQueue = nil; - [exportFilename release], exportFilename = nil; + SPClear(tables); + SPClear(exporters); + SPClear(exportFiles); + SPClear(operationQueue); + SPClear(exportFilename); - if (previousConnectionEncoding) [previousConnectionEncoding release], previousConnectionEncoding = nil; + if (previousConnectionEncoding) SPClear(previousConnectionEncoding); [super dealloc]; } diff --git a/Source/SPExportFile.m b/Source/SPExportFile.m index c33aa076..132e1028 100644 --- a/Source/SPExportFile.m +++ b/Source/SPExportFile.m @@ -226,7 +226,7 @@ - (void)dealloc { - if (exportFileHandle) [exportFileHandle release], exportFileHandle = nil; + if (exportFileHandle) SPClear(exportFileHandle); [super dealloc]; } diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 9c626a53..26cdd0dc 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -99,7 +99,7 @@ NSArray *dataArray = nil; // Get rid of the cached connection encoding - if (previousConnectionEncoding) [previousConnectionEncoding release], previousConnectionEncoding = nil; + if (previousConnectionEncoding) SPClear(previousConnectionEncoding); createCustomFilename = ([[exportCustomFilenameTokenField stringValue] length] > 0); diff --git a/Source/SPExporter.m b/Source/SPExporter.m index 7ec577b6..195d900d 100644 --- a/Source/SPExporter.m +++ b/Source/SPExporter.m @@ -103,9 +103,9 @@ */ - (void)dealloc { - if (exportData) [exportData release], exportData = nil; - if (connection) [connection release], connection = nil; - if (exportOutputFile) [exportOutputFile release], exportOutputFile = nil; + if (exportData) SPClear(exportData); + if (connection) SPClear(connection); + if (exportOutputFile) SPClear(exportOutputFile); [super dealloc]; } diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 2e9eb9e2..3d27b821 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -720,7 +720,7 @@ static NSString *SPMySQLCommentField = @"Comment"; { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [connection release], connection = nil; + SPClear(connection); [super dealloc]; } diff --git a/Source/SPFavoriteNode.m b/Source/SPFavoriteNode.m index aabb01c5..b2b99c64 100644 --- a/Source/SPFavoriteNode.m +++ b/Source/SPFavoriteNode.m @@ -103,7 +103,7 @@ static NSString *SPFavoriteNodeKey = @"SPFavoriteNode"; - (void)dealloc { - if (nodeFavorite) [nodeFavorite release], nodeFavorite = nil; + if (nodeFavorite) SPClear(nodeFavorite); [super dealloc]; } diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index 76f376e8..ce6e5427 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -218,7 +218,7 @@ static SPFavoritesController *sharedFavoritesController = nil; NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; - if (favoritesData) [favoritesData release], favoritesData = nil; + if (favoritesData) SPClear(favoritesData); NSString *dataPath = [fileManager applicationSupportDirectoryForSubDirectory:SPDataSupportFolder error:&error]; @@ -468,8 +468,8 @@ static SPFavoritesController *sharedFavoritesController = nil; - (void)dealloc { - if (favoritesTree) [favoritesTree release], favoritesTree = nil; - if (favoritesData) [favoritesData release], favoritesData = nil; + if (favoritesTree) SPClear(favoritesTree); + if (favoritesData) SPClear(favoritesData); pthread_mutex_destroy(&writeLock); pthread_mutex_destroy(&favoritesLock); diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 9048cfe9..c223faf4 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -477,7 +477,7 @@ [usedSheet makeFirstResponder:image == nil || _isGeometry ? editTextView : editImage]; } - if (stringValue) [stringValue release], stringValue = nil; + if (stringValue) SPClear(stringValue); editSheetWillBeInitialized = NO; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 418a255f..9bef9d03 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -219,20 +219,20 @@ static NSUInteger SPSourceColumnTypeInteger = 1; - (void)dealloc { - if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil; - if (sourcePath) [sourcePath release], sourcePath = nil; - if (fieldMappingTableColumnNames) [fieldMappingTableColumnNames release], fieldMappingTableColumnNames = nil; - if (defaultFieldTypesForComboBox) [defaultFieldTypesForComboBox release], defaultFieldTypesForComboBox = nil; - if (fieldMappingTableTypes) [fieldMappingTableTypes release], fieldMappingTableTypes = nil; - if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; - if (fieldMappingButtonOptions) [fieldMappingButtonOptions release], fieldMappingButtonOptions = nil; - if (fieldMappingOperatorOptions) [fieldMappingOperatorOptions release], fieldMappingOperatorOptions = nil; - if (fieldMappingOperatorArray) [fieldMappingOperatorArray release], fieldMappingOperatorArray = nil; - if (fieldMappingGlobalValues) [fieldMappingGlobalValues release], fieldMappingGlobalValues = nil; - if (fieldMappingGlobalValuesSQLMarked) [fieldMappingGlobalValuesSQLMarked release], fieldMappingGlobalValuesSQLMarked = nil; - if (fieldMappingTableDefaultValues) [fieldMappingTableDefaultValues release], fieldMappingTableDefaultValues = nil; - if (primaryKeyFields) [primaryKeyFields release], primaryKeyFields = nil; - if (toBeEditedRowIndexes) [toBeEditedRowIndexes release], toBeEditedRowIndexes = nil; + if (mySQLConnection) SPClear(mySQLConnection); + if (sourcePath) SPClear(sourcePath); + if (fieldMappingTableColumnNames) SPClear(fieldMappingTableColumnNames); + if (defaultFieldTypesForComboBox) SPClear(defaultFieldTypesForComboBox); + if (fieldMappingTableTypes) SPClear(fieldMappingTableTypes); + if (fieldMappingArray) SPClear(fieldMappingArray); + if (fieldMappingButtonOptions) SPClear(fieldMappingButtonOptions); + if (fieldMappingOperatorOptions) SPClear(fieldMappingOperatorOptions); + if (fieldMappingOperatorArray) SPClear(fieldMappingOperatorArray); + if (fieldMappingGlobalValues) SPClear(fieldMappingGlobalValues); + if (fieldMappingGlobalValuesSQLMarked) SPClear(fieldMappingGlobalValuesSQLMarked); + if (fieldMappingTableDefaultValues) SPClear(fieldMappingTableDefaultValues); + if (primaryKeyFields) SPClear(primaryKeyFields); + if (toBeEditedRowIndexes) SPClear(toBeEditedRowIndexes); [super dealloc]; } @@ -605,7 +605,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Update the table view fieldMappingCurrentRow = 0; - if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; + if (fieldMappingArray) SPClear(fieldMappingArray); [self setupFieldMappingArray]; [rowDownButton setEnabled:NO]; [rowUpButton setEnabled:([fieldMappingImportArray count] > 1)]; @@ -912,7 +912,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Update the table view fieldMappingCurrentRow = 0; - if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; + if (fieldMappingArray) SPClear(fieldMappingArray); [self setupFieldMappingArray]; [rowDownButton setEnabled:NO]; [rowUpButton setEnabled:([fieldMappingImportArray count] > 1)]; diff --git a/Source/SPGeneralPreferencePane.m b/Source/SPGeneralPreferencePane.m index 7879b9f0..a1c024e7 100644 --- a/Source/SPGeneralPreferencePane.m +++ b/Source/SPGeneralPreferencePane.m @@ -208,7 +208,7 @@ static NSString *SPDatabaseImage = @"database-small"; - (void)dealloc { - [folderImage release], folderImage = nil; + SPClear(folderImage); [super dealloc]; } diff --git a/Source/SPGotoDatabaseController.m b/Source/SPGotoDatabaseController.m index 3f9a4730..5e8a4fb2 100644 --- a/Source/SPGotoDatabaseController.m +++ b/Source/SPGotoDatabaseController.m @@ -265,8 +265,8 @@ - (void)dealloc { - [unfilteredList release], unfilteredList = nil; - [filteredList release], filteredList = nil; + SPClear(unfilteredList); + SPClear(filteredList); [super dealloc]; } diff --git a/Source/SPGroupNode.m b/Source/SPGroupNode.m index debc0b84..4d90c0c1 100644 --- a/Source/SPGroupNode.m +++ b/Source/SPGroupNode.m @@ -108,7 +108,7 @@ static NSString *SPGroupNodeIsExpandedKey = @"SPGroupNodeIsExpanded"; - (void)dealloc { - if (nodeName) [nodeName release], nodeName = nil; + if (nodeName) SPClear(nodeName); [super dealloc]; } diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m index f363208c..be659041 100644 --- a/Source/SPGrowlController.m +++ b/Source/SPGrowlController.m @@ -143,7 +143,7 @@ static SPGrowlController *sharedGrowlController = nil; postNotification = YES; } - [timingNotificationName release], timingNotificationName = nil; + SPClear(timingNotificationName); } // Post notification only if preference is set and visibility has been confirmed @@ -192,7 +192,7 @@ static SPGrowlController *sharedGrowlController = nil; - (void)setVisibilityForNotificationName:(NSString *)name { if (timingNotificationName) { - [timingNotificationName release], timingNotificationName = nil; + SPClear(timingNotificationName); } timingNotificationName = [[NSString alloc] initWithString:name]; diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 7236a977..5cca12f9 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -219,7 +219,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // If no initial field has been selected yet - all fields are indexed - add the first field. if (!initialField) initialField = [fields objectAtIndex:0]; - if (indexedFieldNames) [indexedFieldNames release], indexedFieldNames = nil; + if (indexedFieldNames) SPClear(indexedFieldNames); // Reset the indexed columns [indexedFields removeAllObjects]; @@ -1081,14 +1081,14 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; - (void)dealloc { - [table release], table = nil; - [indexes release], indexes = nil; - [fields release], fields = nil; + SPClear(table); + SPClear(indexes); + SPClear(fields); - [supportsLength release], supportsLength = nil; - [requiresLength release], requiresLength = nil; + SPClear(supportsLength); + SPClear(requiresLength); - if (indexedFields) [indexedFields release], indexedFields = nil; + if (indexedFields) SPClear(indexedFields); #ifndef SP_CODA [prefs removeObserver:self forKeyPath:SPDisplayTableViewVerticalGridlines]; diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 1b0128ca..cb1ba20b 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -206,7 +206,7 @@ [stateTimer invalidate]; [stateTimer release]; stateTimer = nil; - if(syncArrowImages) [syncArrowImages release], syncArrowImages = nil; + if(syncArrowImages) SPClear(syncArrowImages); [self performSelectorOnMainThread:@selector(reInvokeCompletion) withObject:nil waitUntilDone:YES]; closeMe = YES; return; diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 07feee86..e4bdd1ec 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -560,7 +560,6 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if([[item componentsSeparatedByString:SPUniqueSchemaDelimiter] count] < 4) [arr addObject:item]; } - if([arr count] < 1 ) @[@0, @""]; if([arr count] == 1) { NSArray *split = [[arr objectAtIndex:0] componentsSeparatedByString:SPUniqueSchemaDelimiter]; if([split count] == 2 ) [NSArray arrayWithObjects:@1, [split lastObject], nil]; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index d28dfcb9..ae407312 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -232,7 +232,7 @@ - (void)dealloc { - [preferencePanes release], preferencePanes = nil; + SPClear(preferencePanes); [super dealloc]; } diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index f24a7891..5f8a422e 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -500,7 +500,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; { // If the filtered array is allocated and it's not a reference to the processes array get rid of it if ((processesFiltered) && (processesFiltered != processes)) { - [processesFiltered release], processesFiltered = nil; + SPClear(processesFiltered); } // Kill the auto refresh timer if running @@ -554,7 +554,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // If the auto refresh timer is running, kill it if (autoRefreshTimer && [autoRefreshTimer isValid]) { [autoRefreshTimer invalidate]; - [autoRefreshTimer release], autoRefreshTimer = nil; + SPClear(autoRefreshTimer); } } @@ -710,7 +710,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // If the filtered array is allocated and its not a reference to the processes array, // relase it to prevent memory leaks upon the next allocation. if ((processesFiltered) && (processesFiltered != processes)) { - [processesFiltered release], processesFiltered = nil; + SPClear(processesFiltered); } processesFiltered = [[NSMutableArray alloc] init]; @@ -763,9 +763,9 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; processListThreadRunning = NO; - [processes release], processes = nil; + SPClear(processes); - if (autoRefreshTimer) [autoRefreshTimer release], autoRefreshTimer = nil; + if (autoRefreshTimer) SPClear(autoRefreshTimer); [super dealloc]; } diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index c08aec3e..4aba3a14 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -645,20 +645,20 @@ static SPQueryController *sharedQueryController = nil; [NSObject cancelPreviousPerformRequestsWithTarget:self]; #ifndef SP_CODA - [dateFormatter release], dateFormatter = nil; + SPClear(dateFormatter); - [messagesFullSet release], messagesFullSet = nil; - [messagesFilteredSet release], messagesFilteredSet = nil; - [activeFilterString release], activeFilterString = nil; + SPClear(messagesFullSet); + SPClear(messagesFilteredSet); + SPClear(activeFilterString); - [favoritesContainer release], favoritesContainer = nil; - [historyContainer release], historyContainer = nil; - [contentFilterContainer release], contentFilterContainer = nil; + SPClear(favoritesContainer); + SPClear(historyContainer); + SPClear(contentFilterContainer); #endif - if (completionKeywordList) [completionKeywordList release], completionKeywordList = nil; - if (completionFunctionList) [completionFunctionList release], completionFunctionList = nil; - if (functionArgumentSnippets) [functionArgumentSnippets release], functionArgumentSnippets = nil; + if (completionKeywordList) SPClear(completionKeywordList); + if (completionFunctionList) SPClear(completionFunctionList); + if (functionArgumentSnippets) SPClear(functionArgumentSnippets); #ifndef SP_CODA pthread_mutex_destroy(&consoleLock); diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 9fd57e6d..f9dde93c 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -910,12 +910,12 @@ - (void)dealloc { - [sqlExportTables release], sqlExportTables = nil; - [sqlDatabaseHost release], sqlDatabaseHost = nil; - [sqlDatabaseName release], sqlDatabaseName = nil; - [sqlExportCurrentTable release], sqlExportCurrentTable = nil; - [sqlDatabaseVersion release], sqlDatabaseVersion = nil; - [sqlExportErrors release], sqlExportErrors = nil; + SPClear(sqlExportTables); + SPClear(sqlDatabaseHost); + SPClear(sqlDatabaseName); + SPClear(sqlExportCurrentTable); + SPClear(sqlDatabaseVersion); + SPClear(sqlExportErrors); [super dealloc]; } diff --git a/Source/SPSQLParser.m b/Source/SPSQLParser.m index d9162a66..a7a3ee98 100644 --- a/Source/SPSQLParser.m +++ b/Source/SPSQLParser.m @@ -1021,7 +1021,7 @@ TO_BUFFER_STATE to_scan_string (const char *); } - (void) setString:(NSString *)aString { [string setString:aString]; - if (delimiter) [delimiter release], delimiter = nil; + if (delimiter) SPClear(delimiter); delimiterLengthMinusOne = 0; lastMatchIsDelimiter = NO; [self _clearCharCache]; diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 20f1aa43..c9a214ab 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -126,8 +126,8 @@ { // As this object is not a NSWindowController, use manual top-level nib item management - if (sshQuestionDialog) [sshQuestionDialog release], sshQuestionDialog = nil; - if (sshPasswordDialog) [sshPasswordDialog release], sshPasswordDialog = nil; + if (sshQuestionDialog) SPClear(sshQuestionDialog); + if (sshPasswordDialog) SPClear(sshPasswordDialog); parentWindow = theWindow; if (![NSBundle loadNibNamed:@"SSHQuestionDialog" owner:self]) { @@ -167,7 +167,7 @@ */ - (BOOL)setPasswordKeychainName:(NSString *)theName account:(NSString *)theAccount { - if (password) [password release], password = nil; + if (password) SPClear(password); passwordInKeychain = YES; keychainName = [[NSString alloc] initWithString:theName]; @@ -420,8 +420,8 @@ [task waitUntilExit]; // On tunnel close, clean up, ready for re-use if the delegate reconnects. - [task release], task = nil; - [standardError release], standardError = nil; + SPClear(task); + SPClear(standardError); [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSFileHandleDataAvailableNotification" object:nil]; @@ -438,8 +438,8 @@ // Run the run loop for a short time to ensure all task/pipe callbacks are dealt with [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; - [taskEnvironment release], taskEnvironment = nil; - [taskArguments release], taskArguments = nil; + SPClear(taskEnvironment); + SPClear(taskArguments); [pool release]; } @@ -647,7 +647,7 @@ NSString *thePassword = nil; if (requestedPassphrase) { thePassword = [NSString stringWithString:requestedPassphrase]; - [requestedPassphrase release], requestedPassphrase = nil; + SPClear(requestedPassphrase); } // Unlock the lock again @@ -747,8 +747,8 @@ if (identityFilePath) [identityFilePath release]; // As this object is not a NSWindowController, use manual top-level nib item management - if (sshQuestionDialog) [sshQuestionDialog release], sshQuestionDialog = nil; - if (sshPasswordDialog) [sshPasswordDialog release], sshPasswordDialog = nil; + if (sshQuestionDialog) SPClear(sshQuestionDialog); + if (sshPasswordDialog) SPClear(sshPasswordDialog); [super dealloc]; } diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index 090970fb..dade0687 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -115,7 +115,7 @@ // If the filtered array is allocated and it's not a reference to the processes array get rid of it if ((variablesFiltered) && (variablesFiltered != variables)) { - [variablesFiltered release], variablesFiltered = nil; + SPClear(variablesFiltered); } } @@ -292,7 +292,7 @@ // If the filtered array is allocated and its not a reference to the variables array // relase it to prevent memory leaks upon the next allocation. if ((variablesFiltered) && (variablesFiltered != variables)) { - [variablesFiltered release], variablesFiltered = nil; + SPClear(variablesFiltered); } variablesFiltered = [[NSMutableArray alloc] init]; @@ -381,7 +381,7 @@ { [prefs removeObserver:self forKeyPath:SPUseMonospacedFonts]; - [variables release], variables = nil; + SPClear(variables); [super dealloc]; } diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m index 9d5b59d8..599432cf 100644 --- a/Source/SPSplitView.m +++ b/Source/SPSplitView.m @@ -108,8 +108,8 @@ [viewMinimumSizes release]; [viewMaximumSizes release]; - if (animationTimer) [animationTimer invalidate], [animationTimer release], animationTimer = nil; - if (animationRetainCycleBypassObject) [animationRetainCycleBypassObject release], animationRetainCycleBypassObject = nil; + if (animationTimer) [animationTimer invalidate], SPClear(animationTimer); + if (animationRetainCycleBypassObject) SPClear(animationRetainCycleBypassObject); [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; @@ -233,8 +233,8 @@ // Otherwise, start an animation. } else { - if (animationTimer) [animationTimer invalidate], [animationTimer release], animationTimer = nil; - if (animationRetainCycleBypassObject) [animationRetainCycleBypassObject release], animationRetainCycleBypassObject = nil; + if (animationTimer) [animationTimer invalidate], SPClear(animationTimer); + if (animationRetainCycleBypassObject) SPClear(animationRetainCycleBypassObject); animationStartTime = [NSDate monotonicTimeInterval]; // Determine the animation length, in seconds, starting with a quarter of a second @@ -853,8 +853,8 @@ // If the animation has reached the end, ensure completion tasks are run if (animationProgress == 1) { - if (animationTimer) [animationTimer invalidate], [animationTimer release], animationTimer = nil; - if (animationRetainCycleBypassObject) [animationRetainCycleBypassObject release], animationRetainCycleBypassObject = nil; + if (animationTimer) [animationTimer invalidate], SPClear(animationTimer); + if (animationRetainCycleBypassObject) SPClear(animationRetainCycleBypassObject); // If uncollapsing, restore the original view and remove the helper if (!collapsibleSubviewCollapsed) { @@ -1132,12 +1132,12 @@ [[wrappedView window] makeFirstResponder:firstResponderToRestore]; } - [wrappedView release], wrappedView = nil; + SPClear(wrappedView); } - (void)dealloc { - if (wrappedView) [wrappedView release], wrappedView = nil; + if (wrappedView) SPClear(wrappedView); [super dealloc]; } diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index d904ab73..b0d0f03c 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -407,7 +407,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper #endif // Reset table key store for use in argumentForRow: - if (keys) [keys release], keys = nil; + if (keys) SPClear(keys); // Reset data column store [dataColumns removeAllObjects]; @@ -425,7 +425,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // Otherwise store the newly selected table name and reset the data } else { - if (selectedTable) [selectedTable release], selectedTable = nil; + if (selectedTable) SPClear(selectedTable); if (newTableName) selectedTable = [[NSString alloc] initWithString:newTableName]; previousTableRowsCount = 0; contentPage = 1; @@ -1509,7 +1509,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // If a string was supplied, use a custom query from that URL scheme else if([sender isKindOfClass:[NSString class]] && [(NSString *)sender length]) { - if(schemeFilter) [schemeFilter release], schemeFilter = nil; + if(schemeFilter) SPClear(schemeFilter); schemeFilter = [sender retain]; activeFilter = 2; } @@ -3942,7 +3942,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper */ - (void) setSortColumnNameToRestore:(NSString *)theSortColumnName isAscending:(BOOL)isAscending { - if (sortColumnToRestore) [sortColumnToRestore release], sortColumnToRestore = nil; + if (sortColumnToRestore) SPClear(sortColumnToRestore); if (theSortColumnName) { sortColumnToRestore = [[NSString alloc] initWithString:theSortColumnName]; @@ -3963,7 +3963,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper */ - (void) setSelectionToRestore:(NSDictionary *)theSelection { - if (selectionToRestore) [selectionToRestore release], selectionToRestore = nil; + if (selectionToRestore) SPClear(selectionToRestore); if (theSelection) selectionToRestore = [theSelection copy]; } @@ -3981,11 +3981,11 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper */ - (void) setFiltersToRestore:(NSDictionary *)filterSettings { - if (filterFieldToRestore) [filterFieldToRestore release], filterFieldToRestore = nil; - if (filterComparisonToRestore) [filterComparisonToRestore release], filterComparisonToRestore = nil; - if (filterValueToRestore) [filterValueToRestore release], filterValueToRestore = nil; - if (firstBetweenValueToRestore) [firstBetweenValueToRestore release], firstBetweenValueToRestore = nil; - if (secondBetweenValueToRestore) [secondBetweenValueToRestore release], secondBetweenValueToRestore = nil; + if (filterFieldToRestore) SPClear(filterFieldToRestore); + if (filterComparisonToRestore) SPClear(filterComparisonToRestore); + if (filterValueToRestore) SPClear(filterValueToRestore); + if (firstBetweenValueToRestore) SPClear(firstBetweenValueToRestore); + if (secondBetweenValueToRestore) SPClear(secondBetweenValueToRestore); if (filterSettings) { if ([filterSettings objectForKey:@"filterField"]) @@ -4311,7 +4311,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper [NSObject cancelPreviousPerformRequestsWithTarget:self]; [NSObject cancelPreviousPerformRequestsWithTarget:tableContentView]; - if(fieldEditor) [fieldEditor release], fieldEditor = nil; + if(fieldEditor) SPClear(fieldEditor); [self clearTableLoadTimer]; [tableLoadingCondition release]; diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index 0a624efc..b73282ec 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -295,7 +295,7 @@ fieldEncoding = [columnDefinition objectForKey:@"charset_name"]; } - if (fieldEditor) [fieldEditor release], fieldEditor = nil; + if (fieldEditor) SPClear(fieldEditor); fieldEditor = [[SPFieldEditorController alloc] init]; diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 0e340f49..86243956 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -520,7 +520,7 @@ // connection reconnect dialog to appear and the user chose to close the connection. if (!syntaxResult) return nil; - if (tableCreateSyntax != nil) [tableCreateSyntax release], tableCreateSyntax = nil; + if (tableCreateSyntax != nil) SPClear(tableCreateSyntax); // A NULL value indicates that the user does not have permission to view the syntax if ([[syntaxResult objectAtIndex:1] isNSNull]) { @@ -864,7 +864,7 @@ } // Retrieve the table syntax string - if (tableCreateSyntax) [tableCreateSyntax release], tableCreateSyntax = nil; + if (tableCreateSyntax) SPClear(tableCreateSyntax); NSString *syntaxString = [[theResult getRowAsArray] objectAtIndex:1]; // A NULL value indicates that the user does not have permission to view the syntax @@ -1086,7 +1086,7 @@ nil, nil, [NSApp mainWindow], self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving the trigger information for table '%@'. Please try again.\n\nMySQL said: %@", @"error retrieving table information informative message"), [tableListInstance tableName], [mySQLConnection lastErrorMessage]]); - if (triggers) [triggers release], triggers = nil; + if (triggers) SPClear(triggers); if (changeEncoding) [mySQLConnection restoreStoredEncoding]; } diff --git a/Source/SPTableFieldValidation.m b/Source/SPTableFieldValidation.m index e3c7f706..97c55a93 100644 --- a/Source/SPTableFieldValidation.m +++ b/Source/SPTableFieldValidation.m @@ -136,7 +136,7 @@ - (void)dealloc { - [fieldTypes release], fieldTypes = nil; + SPClear(fieldTypes); [super dealloc]; } diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index f82dd3e7..2374ea81 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -666,8 +666,8 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; [[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:SPUseMonospacedFonts]; - [relationData release], relationData = nil; - [takenConstraintNames release], takenConstraintNames = nil; + SPClear(relationData); + SPClear(takenConstraintNames); [super dealloc]; } diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 9013fb05..77e5c77b 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -1479,7 +1479,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [typeSuggestions release]; [extraFieldSuggestions release]; - [fieldValidation release], fieldValidation = nil; + SPClear(fieldValidation); if (defaultValues) [defaultValues release]; if (selectedTable) [selectedTable release]; diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index a15d31cd..1950c32e 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -312,7 +312,7 @@ ![tableDocumentInstance isWorking]; // Update the selected table name - if (selectedTable) [selectedTable release], selectedTable = nil; + if (selectedTable) SPClear(selectedTable); if (newTableName) selectedTable = [[NSString alloc] initWithString:newTableName]; [indexesController setTable:selectedTable]; @@ -348,7 +348,7 @@ [indexesController setFields:tableFields]; [indexesController setIndexes:[tableDetails objectForKey:@"tableIndexes"]]; - if (defaultValues) [defaultValues release], defaultValues = nil; + if (defaultValues) SPClear(defaultValues); newDefaultValues = [NSMutableDictionary dictionaryWithCapacity:[tableFields count]]; diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m index 1ab39825..179e509e 100644 --- a/Source/SPTableTriggers.m +++ b/Source/SPTableTriggers.m @@ -632,8 +632,8 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode"; - (void)dealloc { - [triggerData release], triggerData = nil; - [editedTrigger release], editedTrigger = nil; + SPClear(triggerData); + SPClear(editedTrigger); [[NSNotificationCenter defaultCenter] removeObserver:self]; [prefs removeObserver:self forKeyPath:SPUseMonospacedFonts]; diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 3efc45ef..147aec52 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -1314,7 +1314,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; - (NSMutableArray *)_allSchemaObjectsOfType:(SPTableType)type { NSMutableArray *returnArray = [NSMutableArray array]; - NSUInteger i; + NSInteger i; NSInteger cnt = [[self tables] count]; for(i=0; i 1) { [tablesListView deselectAll:self]; - if (selectedTableName) [selectedTableName release], selectedTableName = nil; + if (selectedTableName) SPClear(selectedTableName); } #ifndef SP_CODA diff --git a/Source/SPThreadAdditions.m b/Source/SPThreadAdditions.m index 74476888..f61b6289 100644 --- a/Source/SPThreadAdditions.m +++ b/Source/SPThreadAdditions.m @@ -88,9 +88,9 @@ - (void)dealloc { - [object release], object = nil; + SPClear(object); selector = NULL; - [name release], name = nil; + SPClear(name); [super dealloc]; } diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index abfac606..bf78ab6f 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -848,7 +848,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; - (void)_clearData { [managedObjectContext reset]; - [managedObjectContext release], managedObjectContext = nil; + SPClear(managedObjectContext); } /** @@ -1458,18 +1458,20 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [managedObjectContext release]; - [persistentStoreCoordinator release]; - [managedObjectModel release]; - [privColumnToGrantMap release]; - [connection release]; - [privsSupportedByServer release]; - [schemas release]; - [availablePrivs release]; - [grantedSchemaPrivs release]; - [treeSortDescriptor release]; - [serverSupport release]; + + + SPClear(managedObjectContext); + SPClear(persistentStoreCoordinator); + SPClear(managedObjectModel); + SPClear(privColumnToGrantMap); + SPClear(connection); + SPClear(privsSupportedByServer); + SPClear(schemas); + SPClear(availablePrivs); + SPClear(grantedSchemaPrivs); + SPClear(treeSortDescriptor); + SPClear(treeSortDescriptors); + SPClear(serverSupport); [super dealloc]; } diff --git a/Source/SPXMLExporter.m b/Source/SPXMLExporter.m index 5aefd80b..dd4e9223 100644 --- a/Source/SPXMLExporter.m +++ b/Source/SPXMLExporter.m @@ -358,9 +358,9 @@ - (void)dealloc { - if (xmlDataArray) [xmlDataArray release], xmlDataArray = nil; - if (xmlTableName) [xmlTableName release], xmlTableName = nil; - if (xmlNULLString) [xmlNULLString release], xmlNULLString = nil; + if (xmlDataArray) SPClear(xmlDataArray); + if (xmlTableName) SPClear(xmlTableName); + if (xmlNULLString) SPClear(xmlNULLString); [super dealloc]; } -- cgit v1.2.3 From 5b55d8c4d24b0c24a5dc74a49cfd70448146d582 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 21:10:26 +0100 Subject: Replace some "magic numbers" with constants --- Source/SPConstants.h | 8 ++++++++ Source/SPDatabaseDocument.m | 12 ++++++------ Source/SPWindowController.m | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Source/SPConstants.h b/Source/SPConstants.h index f0350f07..a2df5bde 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -148,6 +148,14 @@ typedef enum { SPMainMenuSequelPro = 0, SPMainMenuFile = 1, + SPMainMenuFileSaveConnection = 1004, + SPMainMenuFileSaveConnectionAs = 1005, + SPMainMenuFileSaveQuery = 1006, + SPMainMenuFileSaveQueryAs = 1008, + SPMainMenuFileSaveSession = 1020, + SPMainMenuFileSaveSessionAs = 1021, + SPMainMenuFileClose = 1003, + SPMainMenuFileCloseTab = 1103, SPMainMenuEdit = 2, SPMainMenuView = 3, SPMainMenuDatabase = 4, diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 6940abfb..ab8eafc6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2831,10 +2831,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [panel setCanSelectHiddenExtension:YES]; // Save Query... - if (sender != nil && ([sender tag] == 1006 || [sender tag] == 1008)) { + if (sender != nil && ([sender tag] == SPMainMenuFileSaveQuery || [sender tag] == SPMainMenuFileSaveQueryAs)) { // If Save was invoked, check whether the file was previously opened, and if so save without the panel - if ([sender tag] == 1006 && [[[self sqlFileURL] path] length]) { + if ([sender tag] == SPMainMenuFileSaveQuery && [[[self sqlFileURL] path] length]) { NSError *error = nil; NSString *content = [NSString stringWithString:[[[customQueryInstance valueForKeyPath:@"textView"] textStorage] string]]; [content writeToURL:sqlFileURL atomically:YES encoding:sqlFileEncoding error:&error]; @@ -2865,11 +2865,11 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Save As… or Save } - else if (sender == nil || [sender tag] == 1005 || [sender tag] == 1004) { + else if (sender == nil || [sender tag] == SPMainMenuFileSaveConnection || [sender tag] == SPMainMenuFileSaveConnectionAs) { // If Save was invoked check for fileURL and Untitled docs and save the spf file without save panel // otherwise ask for file name - if (sender != nil && [sender tag] == 1004 && [[[self fileURL] path] length] && ![self isUntitled]) { + if (sender != nil && [sender tag] == SPMainMenuFileSaveConnection && [[[self fileURL] path] length] && ![self isUntitled]) { [self saveDocumentWithFilePath:nil inBackground:YES onlyPreferences:NO contextInfo:nil]; return; } @@ -2920,10 +2920,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo = sender == nil ? @"saveSPFfileAndClose" : @"saveSPFfile"; } // Save Session or Save Session As... - else if (sender == nil || [sender tag] == 1020 || [sender tag] == 1021) + else if (sender == nil || [sender tag] == SPMainMenuFileSaveSession || [sender tag] == SPMainMenuFileSaveSessionAs) { // Save As Session - if ([sender tag] == 1020 && [SPAppDelegate sessionURL]) { + if ([sender tag] == SPMainMenuFileSaveSession && [SPAppDelegate sessionURL]) { [self saveConnectionPanelDidEnd:panel returnCode:1 contextInfo:@"saveAsSession"]; return; } diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index f90b423d..6edbb684 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -83,8 +83,8 @@ enum { [self _setUpTabBar]; // Retrieve references to the 'Close Window' and 'Close Tab' menus. These are updated as window focus changes. - closeWindowMenuItem = [[[[NSApp mainMenu] itemWithTag:SPMainMenuFile] submenu] itemWithTag:1003]; - closeTabMenuItem = [[[[NSApp mainMenu] itemWithTag:SPMainMenuFile] submenu] itemWithTag:1103]; + closeWindowMenuItem = [[[[NSApp mainMenu] itemWithTag:SPMainMenuFile] submenu] itemWithTag:SPMainMenuFileClose]; + closeTabMenuItem = [[[[NSApp mainMenu] itemWithTag:SPMainMenuFile] submenu] itemWithTag:SPMainMenuFileCloseTab]; // Register for drag start and stop notifications - used to show/hide tab bars [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabDragStarted:) name:PSMTabDragDidBeginNotification object:nil]; -- cgit v1.2.3 From e201531daa71ee1a2e2a0f927c619947126c9d3d Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 21:15:43 +0100 Subject: Addition to commit 2735e15b --- Source/SPActivityTextFieldCell.m | 2 +- Source/SPAppController.m | 16 +++++----- Source/SPBundleCommandTextView.m | 4 +-- Source/SPBundleEditorController.m | 56 +++++++++++++++++------------------ Source/SPBundleHTMLOutputController.m | 2 +- Source/SPCSVParser.m | 22 +++++++------- Source/SPChooseMenuItemDialog.m | 2 +- Source/SPColorSelectorView.m | 2 +- Source/SPConnectionController.m | 21 +++++++------ Source/SPContentFilterManager.m | 2 +- Source/SPCopyTable.m | 4 +-- Source/SPCustomQuery.m | 31 +++++++++---------- Source/SPDataImport.m | 25 ++++++++-------- Source/SPDatabaseDocument.m | 3 +- Source/SPDatabaseStructure.m | 5 ++-- Source/SPFieldEditorController.m | 14 ++++----- Source/SPFileHandle.m | 4 +-- Source/SPHistoryController.m | 4 +-- Source/SPNarrowDownCompletion.m | 29 ++++++++---------- Source/SPNavigatorController.m | 28 +++++++++--------- Source/SPPrintController.m | 2 +- Source/SPQueryFavoriteManager.m | 2 +- Source/SPSQLParser.m | 7 ++--- Source/SPSSHTunnel.m | 29 +++++++++--------- Source/SPSplitView.m | 4 +-- Source/SPTableContent.m | 51 +++++++++++++++---------------- Source/SPTableData.m | 29 ++++++++---------- Source/SPTableInfo.m | 4 +-- Source/SPTableStructure.m | 14 ++++----- Source/SPTablesList.m | 18 +++++------ Source/SPTextAndLinkCell.m | 2 +- Source/SPTextView.m | 22 +++++++------- Source/SPTooltip.m | 6 ++-- Source/SPUserManager.m | 4 +-- Source/SPWindowController.m | 2 +- 35 files changed, 223 insertions(+), 249 deletions(-) diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index b82fa995..b09454bb 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -327,7 +327,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) if(activityName) SPClear(activityName); if(activityInfo) SPClear(activityInfo); if(contextInfo) SPClear(contextInfo); - if(cancelButton) [cancelButton release]; + if(cancelButton) SPClear(cancelButton); [super dealloc]; } diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 87cf9f24..0840978d 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -2231,14 +2231,14 @@ { [[NSNotificationCenter defaultCenter] removeObserver:self]; - if (bundleItems) [bundleItems release]; - if (bundleUsedScopes) [bundleUsedScopes release]; - if (bundleHTMLOutputController) [bundleHTMLOutputController release]; - if (bundleCategories) [bundleCategories release]; - if (bundleTriggers) [bundleTriggers release]; - if (bundleKeyEquivalents) [bundleKeyEquivalents release]; - if (installedBundleUUIDs) [installedBundleUUIDs release]; - if (runningActivitiesArray) [runningActivitiesArray release]; + if (bundleItems) SPClear(bundleItems); + if (bundleUsedScopes) SPClear(bundleUsedScopes); + if (bundleHTMLOutputController) SPClear(bundleHTMLOutputController); + if (bundleCategories) SPClear(bundleCategories); + if (bundleTriggers) SPClear(bundleTriggers); + if (bundleKeyEquivalents) SPClear(bundleKeyEquivalents); + if (installedBundleUUIDs) SPClear(installedBundleUUIDs); + if (runningActivitiesArray) SPClear(runningActivitiesArray); SPClear(prefsController); diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index 9a2d2ba8..f8d4e53f 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -40,8 +40,8 @@ { [[NSNotificationCenter defaultCenter] removeObserver:self]; [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth]; - [prefs release]; - [lineNumberView release]; + SPClear(prefs); + SPClear(lineNumberView); [super dealloc]; } diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 69652bf1..01aca387 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -1090,8 +1090,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; // Remove temporary drag file if any if(draggedFilePath) { [[NSFileManager defaultManager] removeItemAtPath:draggedFilePath error:nil]; - [draggedFilePath release]; - draggedFilePath = nil; + SPClear(draggedFilePath); } if(oldBundleName) SPClear(oldBundleName); } @@ -1478,8 +1477,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; // Remove old temporary drag file if any if(draggedFilePath) { [[NSFileManager defaultManager] removeItemAtPath:draggedFilePath error:nil]; - [draggedFilePath release]; - draggedFilePath = nil; + SPClear(draggedFilePath); } NSImage *dragImage; @@ -2074,33 +2072,33 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; - (void)dealloc { - [inputGeneralScopePopUpMenu release]; - [inputInputFieldScopePopUpMenu release]; - [inputDataTableScopePopUpMenu release]; - [outputGeneralScopePopUpMenu release]; - [outputInputFieldScopePopUpMenu release]; - [outputDataTableScopePopUpMenu release]; - [inputFallbackInputFieldScopePopUpMenu release]; - [triggerInputFieldPopUpMenu release]; - [triggerDataTablePopUpMenu release]; - [triggerGeneralPopUpMenu release]; - [withBlobDataTablePopUpMenu release]; - [inputNonePopUpMenu release]; + SPClear(inputGeneralScopePopUpMenu); + SPClear(inputInputFieldScopePopUpMenu); + SPClear(inputDataTableScopePopUpMenu); + SPClear(outputGeneralScopePopUpMenu); + SPClear(outputInputFieldScopePopUpMenu); + SPClear(outputDataTableScopePopUpMenu); + SPClear(inputFallbackInputFieldScopePopUpMenu); + SPClear(triggerInputFieldPopUpMenu); + SPClear(triggerDataTablePopUpMenu); + SPClear(triggerGeneralPopUpMenu); + SPClear(withBlobDataTablePopUpMenu); + SPClear(inputNonePopUpMenu); - [inputGeneralScopeArray release]; - [inputInputFieldScopeArray release]; - [inputDataTableScopeArray release]; - [outputGeneralScopeArray release]; - [outputInputFieldScopeArray release]; - [outputDataTableScopeArray release]; - [inputFallbackInputFieldScopeArray release]; - [triggerInputFieldArray release]; - [triggerDataTableArray release]; - [triggerGeneralArray release]; - [withBlobDataTableArray release]; + SPClear(inputGeneralScopeArray); + SPClear(inputInputFieldScopeArray); + SPClear(inputDataTableScopeArray); + SPClear(outputGeneralScopeArray); + SPClear(outputInputFieldScopeArray); + SPClear(outputDataTableScopeArray); + SPClear(inputFallbackInputFieldScopeArray); + SPClear(triggerInputFieldArray); + SPClear(triggerDataTableArray); + SPClear(triggerGeneralArray); + SPClear(withBlobDataTableArray); - [shellVariableSuggestions release]; - [deletedDefaultBundles release]; + SPClear(shellVariableSuggestions); + SPClear(deletedDefaultBundles); if (touchedBundleArray) SPClear(touchedBundleArray); if (commandBundleTree) SPClear(commandBundleTree); diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index ed1142a2..16a2f9da 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -126,7 +126,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; - (void)dealloc { - if(webPreferences) [webPreferences release]; + if(webPreferences) SPClear(webPreferences); [super dealloc]; } diff --git a/Source/SPCSVParser.m b/Source/SPCSVParser.m index 88a2fbb5..819c34b7 100644 --- a/Source/SPCSVParser.m +++ b/Source/SPCSVParser.m @@ -650,17 +650,17 @@ return self; } - (void) dealloc { - [csvString release]; - [fieldEndString release]; - [lineEndString release]; - [fieldQuoteString release]; - [escapeString release]; - [escapedFieldEndString release]; - [escapedLineEndString release]; - [escapedFieldQuoteString release]; - [escapedEscapeString release]; - if (nullReplacementString) [nullReplacementString release]; - if (skipCharacterSet) [skipCharacterSet release]; + SPClear(csvString); + SPClear(fieldEndString); + SPClear(lineEndString); + SPClear(fieldQuoteString); + SPClear(escapeString); + SPClear(escapedFieldEndString); + SPClear(escapedLineEndString); + SPClear(escapedFieldQuoteString); + SPClear(escapedEscapeString); + if (nullReplacementString) SPClear(nullReplacementString); + if (skipCharacterSet) SPClear(skipCharacterSet); [super dealloc]; } diff --git a/Source/SPChooseMenuItemDialog.m b/Source/SPChooseMenuItemDialog.m index 60b9ced3..8b7bf650 100644 --- a/Source/SPChooseMenuItemDialog.m +++ b/Source/SPChooseMenuItemDialog.m @@ -174,7 +174,7 @@ - (void)dealloc { - [dummyTextView release]; + SPClear(dummyTextView); [super dealloc]; } diff --git a/Source/SPColorSelectorView.m b/Source/SPColorSelectorView.m index 15b18596..f2eade86 100644 --- a/Source/SPColorSelectorView.m +++ b/Source/SPColorSelectorView.m @@ -424,7 +424,7 @@ enum trackingAreaIDs // ------------------------------------------------------------------------------- - (void)dealloc { - [trackingAreas release]; + SPClear(trackingAreas); [super dealloc]; } diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 651d3538..79a15a19 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -317,8 +317,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, // Cancel the SSH tunnel if present if (sshTunnel) { [sshTunnel disconnect]; - [sshTunnel release]; - sshTunnel = nil; + SPClear(sshTunnel); } #ifndef SP_CODA @@ -1848,7 +1847,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, mySQLConnection = nil; } - if (sshTunnel) [sshTunnel setConnectionStateChangeSelector:nil delegate:nil], [sshTunnel disconnect], [sshTunnel release]; + if (sshTunnel) [sshTunnel setConnectionStateChangeSelector:nil delegate:nil], SPClear(sshTunnel); } #pragma mark - @@ -1883,9 +1882,9 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, #endif #ifndef SP_CODA - [keychain release]; + SPClear(keychain); #endif - [prefs release]; + SPClear(prefs); #ifndef SP_CODA SPClear(folderImage); @@ -1895,13 +1894,13 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, for (id retainedObject in nibObjectsToRelease) [retainedObject release]; - [nibObjectsToRelease release]; + SPClear(nibObjectsToRelease); - if (connectionKeychainID) [connectionKeychainID release]; - if (connectionKeychainItemName) [connectionKeychainItemName release]; - if (connectionKeychainItemAccount) [connectionKeychainItemAccount release]; - if (connectionSSHKeychainItemName) [connectionSSHKeychainItemName release]; - if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release]; + if (connectionKeychainID) SPClear(connectionKeychainID); + if (connectionKeychainItemName) SPClear(connectionKeychainItemName); + if (connectionKeychainItemAccount) SPClear(connectionKeychainItemAccount); + if (connectionSSHKeychainItemName) SPClear(connectionSSHKeychainItemName); + if (connectionSSHKeychainItemAccount) SPClear(connectionSSHKeychainItemAccount); #ifndef SP_CODA if (currentFavorite) SPClear(currentFavorite); diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index e35fd672..a8e747e2 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -975,7 +975,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; - (void)dealloc { - [contentFilters release]; + SPClear(contentFilters); [super dealloc]; } diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 7aaae1a6..7f25d05f 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -1539,9 +1539,9 @@ static const NSInteger kBlobAsImageFile = 4; - (void)dealloc { - if (columnDefinitions) [columnDefinitions release]; + if (columnDefinitions) SPClear(columnDefinitions); #ifndef SP_CODA - [prefs release]; + SPClear(prefs); #endif [super dealloc]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 2114d766..8b3897fe 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1465,8 +1465,7 @@ { if (queryLoadTimer) { [queryLoadTimer invalidate]; - [queryLoadTimer release]; - queryLoadTimer = nil; + SPClear(queryLoadTimer); } } @@ -2153,8 +2152,7 @@ // this is the same as saying (isDesc && !invert) || (!isDesc && invert) if (isDesc != invert) { - [sortField release]; - sortField = nil; + SPClear(sortField); } else { isDesc = !isDesc; } @@ -3681,8 +3679,7 @@ } if(fieldEditor) { - [fieldEditor release]; - fieldEditor = nil; + SPClear(fieldEditor); } // Preserve focus and restore selection indexes if appropriate @@ -4036,22 +4033,22 @@ [NSObject cancelPreviousPerformRequestsWithTarget:customQueryView]; [self clearQueryLoadTimer]; - [resultLoadingCondition release]; - [usedQuery release]; - [lastExecutedQuery release]; - [resultData release]; - [favoritesManager release]; + SPClear(resultLoadingCondition); + SPClear(usedQuery); + SPClear(lastExecutedQuery); + SPClear(resultData); + SPClear(favoritesManager); if(fieldEditor) SPClear(fieldEditor); #ifndef SP_CODA - if (helpHTMLTemplate) [helpHTMLTemplate release]; + if (helpHTMLTemplate) SPClear(helpHTMLTemplate); #endif - if (mySQLversion) [mySQLversion release]; - if (sortField) [sortField release]; - if (cqColumnDefinition) [cqColumnDefinition release]; - if (selectionIndexToRestore) [selectionIndexToRestore release]; - if (currentQueryRanges) [currentQueryRanges release]; + if (mySQLversion) SPClear(mySQLversion); + if (sortField) SPClear(sortField); + if (cqColumnDefinition) SPClear(cqColumnDefinition); + if (selectionIndexToRestore) SPClear(selectionIndexToRestore); + if (currentQueryRanges) SPClear(currentQueryRanges); [super dealloc]; } diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index be3935c4..30ef3bf4 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -312,7 +312,7 @@ // Reset progress cancelled from any previous runs progressCancelled = NO; - if (lastFilename) [lastFilename release]; lastFilename = nil; + if (lastFilename) SPClear(lastFilename); lastFilename = [[NSString stringWithString:[[openPanel URL] path]] retain]; @@ -1728,21 +1728,20 @@ cleanup: - (void)dealloc { - if (fieldMappingImportArray) [fieldMappingImportArray release]; - if (geometryFields) [geometryFields release]; - if (geometryFieldsMapIndex) [geometryFieldsMapIndex release]; - if (bitFields) [bitFields release]; - if (nullableNumericFields) [nullableNumericFields release]; - if (bitFieldsMapIndex) [bitFieldsMapIndex release]; - if (nullableNumericFieldsMapIndex) [nullableNumericFieldsMapIndex release]; - - if (lastFilename) [lastFilename release]; - if (prefs) [prefs release]; - if(selectedTableTarget) [selectedTableTarget release]; + if (fieldMappingImportArray) SPClear(fieldMappingImportArray); + if (geometryFields) SPClear(geometryFields); + if (geometryFieldsMapIndex) SPClear(geometryFieldsMapIndex); + if (bitFields) SPClear(bitFields); + if (nullableNumericFields) SPClear(nullableNumericFields); + if (bitFieldsMapIndex) SPClear(bitFieldsMapIndex); + if (nullableNumericFieldsMapIndex) SPClear(nullableNumericFieldsMapIndex); + if (lastFilename) SPClear(lastFilename); + if (prefs) SPClear(prefs); + if (selectedTableTarget) SPClear(selectedTableTarget); for (id retainedObject in nibObjectsToRelease) [retainedObject release]; - [nibObjectsToRelease release]; + SPClear(nibObjectsToRelease); [super dealloc]; } diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index ab8eafc6..a0a6bf1c 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -569,8 +569,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; if (queryEditorInitString && [queryEditorInitString length]) { [self viewQuery:self]; [customQueryInstance doPerformLoadQueryService:queryEditorInitString]; - [queryEditorInitString release]; - queryEditorInitString = nil; + SPClear(queryEditorInitString); } if (spfSession != nil) { diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m index b34522c5..2eab3562 100644 --- a/Source/SPDatabaseStructure.m +++ b/Source/SPDatabaseStructure.m @@ -567,7 +567,7 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; [self destroy:nil]; - [structureRetrievalThreads release]; + SPClear(structureRetrievalThreads); pthread_mutex_destroy(&threadManagementLock); pthread_mutex_destroy(&dataLock); @@ -630,8 +630,7 @@ } pthread_mutex_unlock(&threadManagementLock); - [mySQLConnection release]; - mySQLConnection = nil; + SPClear(mySQLConnection); } // Create a copy of the supplied connection diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index c223faf4..4f34a998 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -169,14 +169,14 @@ } #endif - if ( sheetEditData ) [sheetEditData release]; + if ( sheetEditData ) SPClear(sheetEditData); #ifndef SP_CODA - if ( qlTypes ) [qlTypes release]; + if ( qlTypes ) SPClear(qlTypes); #endif - if ( tmpFileName ) [tmpFileName release]; - if ( tmpDirPath ) [tmpDirPath release]; - if ( esUndoManager ) [esUndoManager release]; - if ( contextInfo ) [contextInfo release]; + if ( tmpFileName ) SPClear(tmpFileName); + if ( tmpDirPath ) SPClear(tmpDirPath); + if ( esUndoManager ) SPClear(esUndoManager); + if ( contextInfo ) SPClear(contextInfo); [super dealloc]; } @@ -1078,8 +1078,6 @@ image = [[[NSImage alloc] initWithPasteboard:[NSPasteboard generalPasteboard]] autorelease]; if (image) { - if (nil != sheetEditData) [sheetEditData release]; - [editImage setImage:image]; if( sheetEditData ) [sheetEditData release]; diff --git a/Source/SPFileHandle.m b/Source/SPFileHandle.m index 58350443..62204252 100644 --- a/Source/SPFileHandle.m +++ b/Source/SPFileHandle.m @@ -467,10 +467,10 @@ { [self closeFile]; - if (processingThread) [processingThread release]; + if (processingThread) SPClear(processingThread); free(wrappedFilePath); - [buffer release]; + SPClear(buffer); pthread_mutex_destroy(&bufferLock); diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m index af39323c..aa504bc2 100644 --- a/Source/SPHistoryController.m +++ b/Source/SPHistoryController.m @@ -71,8 +71,8 @@ - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [tableContentStates release]; - [history release]; + SPClear(tableContentStates); + SPClear(history); [super dealloc]; } diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index cb1ba20b..d5391644 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -159,18 +159,16 @@ [NSObject cancelPreviousPerformRequestsWithTarget:self]; if(stateTimer != nil) { [stateTimer invalidate]; - [stateTimer release]; - stateTimer = nil; + SPClear(stateTimer); } - if (staticPrefix) [staticPrefix release]; - [mutablePrefix release]; - [textualInputCharacters release]; - [originalFilterString release]; - if(syncArrowImages) [syncArrowImages release]; - if(suggestions) [suggestions release]; - - if (filtered) [filtered release]; - if (databaseStructureRetrieval) [databaseStructureRetrieval release]; + SPClear(mutablePrefix); + SPClear(textualInputCharacters); + SPClear(originalFilterString); + if (staticPrefix) SPClear(staticPrefix); + if (syncArrowImages) SPClear(syncArrowImages); + if (suggestions) SPClear(suggestions); + if (filtered) SPClear(filtered); + if (databaseStructureRetrieval) SPClear(databaseStructureRetrieval); [super dealloc]; } @@ -181,8 +179,7 @@ // Invalidate the timer now to prevent retain cycles preventing deallocation if (stateTimer != nil) { [stateTimer invalidate]; - [stateTimer release]; - stateTimer = nil; + SPClear(stateTimer); } closeMe = YES; @@ -204,8 +201,7 @@ isQueryingDatabaseStructure = NO; if(stateTimer) { [stateTimer invalidate]; - [stateTimer release]; - stateTimer = nil; + SPClear(stateTimer); if(syncArrowImages) SPClear(syncArrowImages); [self performSelectorOnMainThread:@selector(reInvokeCompletion) withObject:nil waitUntilDone:YES]; closeMe = YES; @@ -222,8 +218,7 @@ { if(stateTimer) { [stateTimer invalidate]; - [stateTimer release]; - stateTimer = nil; + SPClear(stateTimer); } [theView setCompletionIsOpen:NO]; [self close]; diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index e4bdd1ec..3f194b24 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -109,21 +109,21 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - if(schemaDataFiltered) [schemaDataFiltered release]; - if(allSchemaKeys) [allSchemaKeys release]; - if(schemaData) [schemaData release]; - if(infoArray) [infoArray release]; - if(updatingConnections) [updatingConnections release]; - if(expandStatus2) [expandStatus2 release]; - if(cachedSortedKeys) [cachedSortedKeys release]; + if(schemaDataFiltered) SPClear(schemaDataFiltered); + if(allSchemaKeys) SPClear(allSchemaKeys); + if(schemaData) SPClear(schemaData); + if(infoArray) SPClear(infoArray); + if(updatingConnections) SPClear(updatingConnections); + if(expandStatus2) SPClear(expandStatus2); + if(cachedSortedKeys) SPClear(cachedSortedKeys); #ifndef SP_CODA /* dealloc ivars */ - [connectionIcon release]; - [databaseIcon release]; - [tableIcon release]; - [viewIcon release]; - [procedureIcon release]; - [functionIcon release]; - [fieldIcon release]; + SPClear(connectionIcon); + SPClear(databaseIcon); + SPClear(tableIcon); + SPClear(viewIcon); + SPClear(procedureIcon); + SPClear(functionIcon); + SPClear(fieldIcon); #endif [super dealloc]; diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index 70f5662b..d0feec68 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -193,7 +193,7 @@ { [[printWebView mainFrame] loadHTMLString:HTMLString baseURL:nil]; - if (printThread) [printThread release]; + if (printThread) SPClear(printThread); } /** diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 649d4b5a..6522b884 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -971,7 +971,7 @@ - (void)dealloc { - [favorites release]; + SPClear(favorites); [super dealloc]; } diff --git a/Source/SPSQLParser.m b/Source/SPSQLParser.m index a7a3ee98..d9bec2eb 100644 --- a/Source/SPSQLParser.m +++ b/Source/SPSQLParser.m @@ -790,8 +790,7 @@ TO_BUFFER_STATE to_scan_string (const char *); // Drop back to standard non-delimiter mode if the delimiter has ended if ([delimiter isEqualToString:[NSString stringWithFormat:@"%C", character]]) { - if (delimiter) [delimiter release]; - delimiter = nil; + if (delimiter) SPClear(delimiter); delimiterLengthMinusOne = 0; } @@ -1039,8 +1038,8 @@ TO_BUFFER_STATE to_scan_string (const char *); [self _clearCharCache]; } - (void) dealloc { - [string release]; - if (delimiter) [delimiter release]; + SPClear(string); + if (delimiter) SPClear(delimiter); if (charCacheEnd != -1) free(stringCharCache); [super dealloc]; } diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index c9a214ab..1c217986 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -711,8 +711,7 @@ SPKeychain *keychain = [[SPKeychain alloc] init]; [keychain addPassword:thePassword forName:@"SSH" account:currentKeyName withLabel:[NSString stringWithFormat:@"SSH: %@", currentKeyName]]; [keychain release]; - [currentKeyName release]; - currentKeyName = nil; + SPClear(currentKeyName); } } @@ -729,22 +728,22 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; if (connectionState != SPMySQLProxyIdle) [self disconnect]; [NSObject cancelPreviousPerformRequestsWithTarget:self]; - [sshHost release]; - [sshLogin release]; - [remoteHost release]; - [tunnelConnectionName release]; - [tunnelConnectionVerifyHash release]; + SPClear(sshHost); + SPClear(sshLogin); + SPClear(remoteHost); + SPClear(tunnelConnectionName); + SPClear(tunnelConnectionVerifyHash); [tunnelConnection invalidate]; - [tunnelConnection release]; - [debugMessages release]; - [debugMessagesLock release]; + SPClear(tunnelConnection); + SPClear(debugMessages); + SPClear(debugMessagesLock); [answerAvailableLock tryLock]; [answerAvailableLock unlock]; - [answerAvailableLock release]; - if (password) [password release]; - if (keychainName) [keychainName release]; - if (keychainAccount) [keychainAccount release]; - if (identityFilePath) [identityFilePath release]; + SPClear(answerAvailableLock); + if (password) SPClear(password); + if (keychainName) SPClear(keychainName); + if (keychainAccount) SPClear(keychainAccount); + if (identityFilePath) SPClear(identityFilePath); // As this object is not a NSWindowController, use manual top-level nib item management if (sshQuestionDialog) SPClear(sshQuestionDialog); diff --git a/Source/SPSplitView.m b/Source/SPSplitView.m index 599432cf..ed87f3c0 100644 --- a/Source/SPSplitView.m +++ b/Source/SPSplitView.m @@ -105,8 +105,8 @@ - (void)dealloc { - [viewMinimumSizes release]; - [viewMaximumSizes release]; + SPClear(viewMinimumSizes); + SPClear(viewMaximumSizes); if (animationTimer) [animationTimer invalidate], SPClear(animationTimer); if (animationRetainCycleBypassObject) SPClear(animationRetainCycleBypassObject); diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index b0d0f03c..9295c858 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -462,7 +462,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper #endif // Reset sort column - if (sortCol) [sortCol release]; sortCol = nil; + if (sortCol) SPClear(sortCol); isDesc = NO; // Empty and disable filter options @@ -697,8 +697,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // Otherwise, clear sorting } else { if (sortCol) { - [sortCol release]; - sortCol = nil; + SPClear(sortCol); } isDesc = NO; } @@ -1372,8 +1371,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper { if (tableLoadTimer) { [tableLoadTimer invalidate]; - [tableLoadTimer release]; - tableLoadTimer = nil; + SPClear(tableLoadTimer); } } @@ -1678,8 +1676,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // this is the same as saying (isDesc && !invert) || (!isDesc && invert) if (isDesc != invert) { - [sortCol release]; - sortCol = nil; + SPClear(sortCol); } else { isDesc = !isDesc; @@ -3494,8 +3491,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper } if(fieldEditor) { - [fieldEditor release]; - fieldEditor = nil; + SPClear(fieldEditor); } [[tableContentView window] makeFirstResponder:tableContentView]; @@ -4314,34 +4310,35 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if(fieldEditor) SPClear(fieldEditor); [self clearTableLoadTimer]; - [tableLoadingCondition release]; - [tableValues release]; + SPClear(tableLoadingCondition); + SPClear(tableValues); pthread_mutex_destroy(&tableValuesLock); - [dataColumns release]; - [oldRow release]; + SPClear(dataColumns); + SPClear(oldRow); #ifndef SP_CODA for (id retainedObject in nibObjectsToRelease) [retainedObject release]; - [nibObjectsToRelease release]; - [paginationPopover release]; + SPClear(nibObjectsToRelease); + SPClear(paginationPopover); - [filterTableData release]; - if (lastEditedFilterTableValue) [lastEditedFilterTableValue release]; - if (filterTableDefaultOperator) [filterTableDefaultOperator release]; + SPClear(filterTableData); + if (lastEditedFilterTableValue) SPClear(lastEditedFilterTableValue); + if (filterTableDefaultOperator) SPClear(filterTableDefaultOperator); #endif - if (selectedTable) [selectedTable release]; - if (contentFilters) [contentFilters release]; - if (numberOfDefaultFilters) [numberOfDefaultFilters release]; - if (keys) [keys release]; - if (sortCol) [sortCol release]; - [usedQuery release]; - if (sortColumnToRestore) [sortColumnToRestore release]; - if (selectionToRestore) [selectionToRestore release]; + if (selectedTable) SPClear(selectedTable); + if (contentFilters) SPClear(contentFilters); + if (numberOfDefaultFilters) SPClear(numberOfDefaultFilters); + if (keys) SPClear(keys); + if (sortCol) SPClear(sortCol); + SPClear(usedQuery); + if (sortColumnToRestore) SPClear(sortColumnToRestore); + if (selectionToRestore) SPClear(selectionToRestore); + if (cqColumnDefinition) SPClear(cqColumnDefinition); + if (filterFieldToRestore) filterFieldToRestore = nil; if (filterComparisonToRestore) filterComparisonToRestore = nil; if (filterValueToRestore) filterValueToRestore = nil; if (firstBetweenValueToRestore) firstBetweenValueToRestore = nil; if (secondBetweenValueToRestore) secondBetweenValueToRestore = nil; - if (cqColumnDefinition) [cqColumnDefinition release]; [super dealloc]; } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 86243956..320a0b66 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -329,18 +329,15 @@ [status removeAllObjects]; if (triggers != nil) { - [triggers release]; - triggers = nil; + SPClear(triggers); } if (tableEncoding != nil) { - [tableEncoding release]; - tableEncoding = nil; + SPClear(tableEncoding); } if (tableCreateSyntax != nil) { - [tableCreateSyntax release]; - tableCreateSyntax = nil; + SPClear(tableCreateSyntax); } } @@ -1395,16 +1392,16 @@ */ - (void)dealloc { - [columns release]; - [columnNames release]; - [constraints release]; - [status release]; - [primaryKeyColumns release]; - - if (triggers) [triggers release]; - if (tableEncoding) [tableEncoding release]; - if (tableCreateSyntax) [tableCreateSyntax release]; - if (mySQLConnection) [mySQLConnection release]; + SPClear(columns); + SPClear(columnNames); + SPClear(constraints); + SPClear(status); + SPClear(primaryKeyColumns); + + if (triggers) SPClear(triggers); + if (tableEncoding) SPClear(tableEncoding); + if (tableCreateSyntax) SPClear(tableCreateSyntax); + if (mySQLConnection) SPClear(mySQLConnection); pthread_mutex_destroy(&dataProcessingLock); diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 4b16bdc0..e1ce3e4d 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -470,8 +470,8 @@ { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [info release]; - [activities release]; + SPClear(info); + SPClear(activities); [super dealloc]; } diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 77e5c77b..32739eb3 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -1473,16 +1473,16 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [prefs removeObserver:indexesController forKeyPath:SPUseMonospacedFonts]; #endif - [tableFields release]; - [oldRow release]; - [enumFields release]; - [typeSuggestions release]; - [extraFieldSuggestions release]; + SPClear(tableFields); + SPClear(oldRow); + SPClear(enumFields); + SPClear(typeSuggestions); + SPClear(extraFieldSuggestions); SPClear(fieldValidation); - if (defaultValues) [defaultValues release]; - if (selectedTable) [selectedTable release]; + if (defaultValues) SPClear(defaultValues); + if (selectedTable) SPClear(selectedTable); [super dealloc]; } diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 147aec52..aa0d6ea2 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -328,8 +328,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; selectedTableType = (SPTableType)[[tableTypes objectAtIndex:itemToReselect] integerValue]; } else { - if (selectedTableName) [selectedTableName release]; - selectedTableName = nil; + if (selectedTableName) SPClear(selectedTableName); selectedTableType = SPTableTypeNone; } @@ -860,8 +859,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; NSIndexSet *indexes = [tablesListView selectedRowIndexes]; #endif // Update the selected table name and type - if (selectedTableName) [selectedTableName release]; - selectedTableName = nil; + if (selectedTableName) SPClear(selectedTableName); #ifndef SP_CODA /* ui manipulation */ @@ -2729,15 +2727,15 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [tables release]; - [tableTypes release]; + SPClear(tables); + SPClear(tableTypes); #ifndef SP_CODA - if (isTableListFiltered && filteredTables) [filteredTables release]; - if (isTableListFiltered && filteredTableTypes) [filteredTableTypes release]; + if (isTableListFiltered && filteredTables) SPClear(filteredTables); + if (isTableListFiltered && filteredTableTypes) SPClear(filteredTableTypes); #endif - if (selectedTableName) [selectedTableName release]; + if (selectedTableName) SPClear(selectedTableName); - if (addTableCharsetHelper) [addTableCharsetHelper release]; + if (addTableCharsetHelper) SPClear(addTableCharsetHelper); [super dealloc]; } diff --git a/Source/SPTextAndLinkCell.m b/Source/SPTextAndLinkCell.m index 89521e54..2aefbff5 100644 --- a/Source/SPTextAndLinkCell.m +++ b/Source/SPTextAndLinkCell.m @@ -70,7 +70,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) */ - (void) dealloc { - if (linkButton) [linkButton release]; + if (linkButton) SPClear(linkButton); [super dealloc]; } diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 4ed92f94..70fcefc5 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -3687,18 +3687,18 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS if (completionIsOpen) [completionPopup close], completionIsOpen = NO; #ifndef SP_CODA - [prefs release]; + SPClear(prefs); #endif - [lineNumberView release]; - if(queryHiliteColor) [queryHiliteColor release]; - if(queryEditorBackgroundColor) [queryEditorBackgroundColor release]; - if(commentColor) [commentColor release]; - if(quoteColor) [quoteColor release]; - if(keywordColor) [keywordColor release]; - if(backtickColor) [backtickColor release]; - if(numericColor) [numericColor release]; - if(variableColor) [variableColor release]; - if(otherTextColor) [otherTextColor release]; + SPClear(lineNumberView); + if(queryHiliteColor) SPClear(queryHiliteColor); + if(queryEditorBackgroundColor) SPClear(queryEditorBackgroundColor); + if(commentColor) SPClear(commentColor); + if(quoteColor) SPClear(quoteColor); + if(keywordColor) SPClear(keywordColor); + if(backtickColor) SPClear(backtickColor); + if(numericColor) SPClear(numericColor); + if(variableColor) SPClear(variableColor); + if(otherTextColor) SPClear(otherTextColor); [super dealloc]; } diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m index 33564d81..0a7597f5 100644 --- a/Source/SPTooltip.m +++ b/Source/SPTooltip.m @@ -241,9 +241,9 @@ static CGFloat slow_in_out (CGFloat t) - (void)dealloc { [NSObject cancelPreviousPerformRequestsWithTarget:self]; - [didOpenAtDate release]; - [webView release]; - [webPreferences release]; + SPClear(didOpenAtDate); + SPClear(webView); + SPClear(webPreferences); [super dealloc]; } diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index bf78ab6f..e3f611c3 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -555,12 +555,12 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; didEndSelector:NULL contextInfo:nil]; - [errorsString release]; + SPClear(errorsString); return; } - [errorsString release]; + SPClear(errorsString); // Otherwise, close the sheet [NSApp endSheet:[self window] returnCode:0]; diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 6edbb684..0666f1a7 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -537,7 +537,7 @@ enum { // Tear down the animations on the tab bar to stop redraws [tabBar destroyAnimations]; - [managedDatabaseConnections release]; + SPClear(managedDatabaseConnections); [super dealloc]; } -- cgit v1.2.3 From 4ffde6a4867ae005405f586947cf943097c212c1 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 6 Jan 2015 22:18:39 +0100 Subject: Minor internal changes --- Source/SPCopyTable.h | 6 +++--- Source/SPCopyTable.m | 19 +++++++++---------- Source/SPGeneralPreferencePane.m | 6 ++++++ Source/SPPreferenceController.m | 2 -- Source/SPPreferenceControllerDelegate.h | 2 +- Source/SPTextView.m | 2 +- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Source/SPCopyTable.h b/Source/SPCopyTable.h index 02bc2fb4..e397e030 100644 --- a/Source/SPCopyTable.h +++ b/Source/SPCopyTable.h @@ -40,7 +40,7 @@ extern NSInteger SPEditMenuCopy; extern NSInteger SPEditMenuCopyWithColumns; -extern NSInteger SPEditCopyAsSQL; +extern NSInteger SPEditMenuCopyAsSQL; /*! @class copyTable @@ -52,7 +52,7 @@ extern NSInteger SPEditCopyAsSQL; */ @interface SPCopyTable : SPTableView { - SPTableContent* tableInstance; // the table content view instance + SPTableContent* tableInstance; // the table content view instance id mySQLConnection; // current MySQL connection NSArray* columnDefinitions; // array of NSDictionary containing info about columns NSString* selectedTable; // the name of the current selected table @@ -94,7 +94,7 @@ extern NSInteger SPEditCopyAsSQL; @param isLocal who cares @result Always calls for a copy type drag operation */ -- (NSUInteger)draggingSourceOperationMaskForLocal:(BOOL)isLocal; +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal; #ifndef SP_CODA /* method decls */ /*! diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 7f25d05f..2b5554b5 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -56,7 +56,7 @@ NSInteger SPEditMenuCopy = 2001; NSInteger SPEditMenuCopyWithColumns = 2002; -NSInteger SPEditCopyAsSQL = 2003; +NSInteger SPEditMenuCopyAsSQL = 2003; static const NSInteger kBlobExclude = 1; static const NSInteger kBlobInclude = 2; @@ -102,7 +102,7 @@ static const NSInteger kBlobAsImageFile = 4; #ifndef SP_CODA /* copy table rows */ NSString *tmp = nil; - if ([sender tag] == SPEditCopyAsSQL) { + if ([sender tag] == SPEditMenuCopyAsSQL) { tmp = [self rowsAsSqlInsertsOnlySelectedRows:YES]; if (tmp != nil){ @@ -607,7 +607,7 @@ static const NSInteger kBlobAsImageFile = 4; /** * Allow for drag-n-drop out of the application as a copy */ -- (NSUInteger) draggingSourceOperationMaskForLocal:(BOOL)isLocal +- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal { return NSDragOperationCopy; } @@ -991,7 +991,7 @@ static const NSInteger kBlobAsImageFile = 4; } // Don't validate anything other than the copy commands - if (menuItemTag != SPEditMenuCopy && menuItemTag != SPEditMenuCopyWithColumns && menuItemTag != SPEditCopyAsSQL) { + if (menuItemTag != SPEditMenuCopy && menuItemTag != SPEditMenuCopyWithColumns && menuItemTag != SPEditMenuCopyAsSQL) { return YES; } @@ -1006,7 +1006,7 @@ static const NSInteger kBlobAsImageFile = 4; } // Enable the Copy as SQL commands if rows are selected and column definitions are available - if (menuItemTag == SPEditCopyAsSQL) { + if (menuItemTag == SPEditMenuCopyAsSQL) { return (columnDefinitions != nil && [self numberOfSelectedRows] > 0); } #endif @@ -1189,15 +1189,14 @@ static const NSInteger kBlobAsImageFile = 4; */ - (BOOL)shouldUseFieldEditorForRow:(NSUInteger)rowIndex column:(NSUInteger)colIndex checkWithLock:(pthread_mutex_t *)dataLock { - // Retrieve the column definition - NSDictionary *columnDefinition = [[(id )[self delegate] dataColumnDefinitions] objectAtIndex:colIndex]; - - NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; - // Return YES if the multiple line editing button is enabled - triggers sheet editing on all cells. #ifndef SP_CODA if ([prefs boolForKey:SPEditInSheetEnabled]) return YES; #endif + + // Retrieve the column definition + NSDictionary *columnDefinition = [[(id )[self delegate] dataColumnDefinitions] objectAtIndex:colIndex]; + NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; // If the column is a BLOB or TEXT column, and not an enum, trigger sheet editing BOOL isBlob = ([columnType isEqualToString:@"textdata"] || [columnType isEqualToString:@"blobdata"]); diff --git a/Source/SPGeneralPreferencePane.m b/Source/SPGeneralPreferencePane.m index a1c024e7..8f4f5c5b 100644 --- a/Source/SPGeneralPreferencePane.m +++ b/Source/SPGeneralPreferencePane.m @@ -204,6 +204,12 @@ static NSString *SPDatabaseImage = @"database-small"; return NO; } +- (void)preferencePaneWillBeShown +{ + [self updateDefaultFavoritePopup]; +} + + #pragma mark - - (void)dealloc diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index ae407312..36954bc8 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -68,8 +68,6 @@ { [self _setupToolbar]; - [(SPGeneralPreferencePane *)generalPreferencePane updateDefaultFavoritePopup]; - preferencePanes = [[NSArray alloc] initWithObjects: generalPreferencePane, tablesPreferencePane, diff --git a/Source/SPPreferenceControllerDelegate.h b/Source/SPPreferenceControllerDelegate.h index 2fcdfb24..bcfcb271 100644 --- a/Source/SPPreferenceControllerDelegate.h +++ b/Source/SPPreferenceControllerDelegate.h @@ -37,6 +37,6 @@ * * Preference controller delegate category. */ -@interface SPPreferenceController (SPPreferenceControllerDelegate) +@interface SPPreferenceController (SPPreferenceControllerDelegate) @end diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 70fcefc5..c3ebf394 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -3225,7 +3225,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS // Disable "Copy with Column Names" and "Copy as SQL INSERT" // in the main menu if ( [menuItem tag] == SPEditMenuCopyWithColumns - || [menuItem tag] == SPEditCopyAsSQL ) { + || [menuItem tag] == SPEditMenuCopyAsSQL) { return NO; } -- cgit v1.2.3 From 56949ac737a3838f3276d0e558fd0dac7632aae5 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 6 Jan 2015 23:14:21 +0100 Subject: Change some code formatting --- Source/SPDatabaseDocument.m | 25 ++++++---- Source/SPExportController.m | 71 +++++++++++++++------------- Source/SPTablesList.m | 110 ++++++++++++++++++++++---------------------- 3 files changed, 108 insertions(+), 98 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index a0a6bf1c..269e62d4 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5312,9 +5312,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } NSInteger itemType = SPTableTypeNone; - NSString *itemTypeStr = @"TABLE"; NSUInteger i; - NSInteger queryCol = 1; // Loop through the unfiltered tables/views to find the desired item for (i = 0; i < [availableItems count]; i++) { @@ -5327,19 +5325,26 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // If no match found, continue if (itemType == SPTableTypeNone) continue; + NSString *itemTypeStr; + NSInteger queryCol; + switch(itemType) { case SPTableTypeTable: case SPTableTypeView: - itemTypeStr = @"TABLE"; - break; + itemTypeStr = @"TABLE"; + queryCol = 1; + break; case SPTableTypeProc: - itemTypeStr = @"PROCEDURE"; - queryCol = 2; - break; + itemTypeStr = @"PROCEDURE"; + queryCol = 2; + break; case SPTableTypeFunc: - itemTypeStr = @"FUNCTION"; - queryCol = 2; - break; + itemTypeStr = @"FUNCTION"; + queryCol = 2; + break; + default: + NSLog(@"%s: Unhandled SPTableType=%ld for item=%@ (skipping)", __func__, itemType, item); + continue; } // Ensure that queries are made in UTF8 diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 752e8521..f650bab9 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -431,45 +431,50 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; [tables removeAllObjects]; // For all modes, retrieve table and view names - NSArray *tablesAndViews = [tablesListInstance allTableAndViewNames]; - - for (id itemName in tablesAndViews) { - [tables addObject:[NSMutableArray arrayWithObjects: - itemName, - @YES, - @YES, - @YES, - [NSNumber numberWithInt:SPTableTypeTable], - nil]]; - } + { + NSArray *tablesAndViews = [tablesListInstance allTableAndViewNames]; + + for (id itemName in tablesAndViews) { + [tables addObject:[NSMutableArray arrayWithObjects: + itemName, + @YES, + @YES, + @YES, + [NSNumber numberWithInt:SPTableTypeTable], + nil]]; + } + } // The purpose of this extra { } is to limit visibility and thus catch copy&paste errors // For SQL only, add procedures and functions if (exportType == SPSQLExport) { - NSArray *procedures = [tablesListInstance allProcedureNames]; - - for (id procName in procedures) + // Procedures { - [tables addObject:[NSMutableArray arrayWithObjects: - procName, - @YES, - @YES, - @YES, - [NSNumber numberWithInt:SPTableTypeProc], - nil]]; + NSArray *procedures = [tablesListInstance allProcedureNames]; + + for (id procName in procedures) { + [tables addObject:[NSMutableArray arrayWithObjects: + procName, + @YES, + @YES, + @YES, + [NSNumber numberWithInt:SPTableTypeProc], + nil]]; + } } - - NSArray *functions = [tablesListInstance allFunctionNames]; - - for (id funcName in functions) + // Functions { - [tables addObject:[NSMutableArray arrayWithObjects: - funcName, - @YES, - @YES, - @YES, - [NSNumber numberWithInt:SPTableTypeFunc], - nil]]; - } + NSArray *functions = [tablesListInstance allFunctionNames]; + + for (id funcName in functions) { + [tables addObject:[NSMutableArray arrayWithObjects: + funcName, + @YES, + @YES, + @YES, + [NSNumber numberWithInt:SPTableTypeFunc], + nil]]; + } + } } if (sender) { diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index aa0d6ea2..1ae2e83f 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -273,13 +273,12 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [tables addObject:NSLocalizedString(@"PROCS & FUNCS",@"header for procs & funcs list")]; [tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeNone]]; - for (NSArray *eachRow in theResult) { - [tables addObject:NSArrayObjectAtIndex(eachRow, 3)]; - if ([NSArrayObjectAtIndex(eachRow, 4) isEqualToString:@"PROCEDURE"]) { - [tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeProc]]; - } else { - [tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeFunc]]; - } + for (NSArray *eachRow in theResult) { + [tables addObject:NSArrayObjectAtIndex(eachRow, 3)]; + if ([NSArrayObjectAtIndex(eachRow, 4) isEqualToString:@"PROCEDURE"]) { + [tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeProc]]; + } else { + [tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeFunc]]; } } } @@ -885,31 +884,31 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; switch (lastType) { case SPTableTypeTable: - [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Tables", @"delete tables menu title")]; - [truncateTableButton setTitle:NSLocalizedString(@"Truncate Tables", @"truncate tables menu item")]; - [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Tables", @"delete tables menu title")]; - [truncateTableContextMenuItem setTitle:NSLocalizedString(@"Truncate Tables", @"truncate tables menu item")]; - [truncateTableButton setHidden:NO]; - [truncateTableContextMenuItem setHidden:NO]; - break; + [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Tables", @"delete tables menu title")]; + [truncateTableButton setTitle:NSLocalizedString(@"Truncate Tables", @"truncate tables menu item")]; + [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Tables", @"delete tables menu title")]; + [truncateTableContextMenuItem setTitle:NSLocalizedString(@"Truncate Tables", @"truncate tables menu item")]; + [truncateTableButton setHidden:NO]; + [truncateTableContextMenuItem setHidden:NO]; + break; case SPTableTypeView: - [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Views", @"delete views menu title")]; - [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Views", @"delete views menu title")]; - [truncateTableButton setHidden:YES]; - [truncateTableContextMenuItem setHidden:YES]; - break; + [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Views", @"delete views menu title")]; + [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Views", @"delete views menu title")]; + [truncateTableButton setHidden:YES]; + [truncateTableContextMenuItem setHidden:YES]; + break; case SPTableTypeProc: - [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Procedures", @"delete procedures menu title")]; - [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Procedures", @"delete procedures menu title")]; - [truncateTableButton setHidden:YES]; - [truncateTableContextMenuItem setHidden:YES]; - break; + [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Procedures", @"delete procedures menu title")]; + [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Procedures", @"delete procedures menu title")]; + [truncateTableButton setHidden:YES]; + [truncateTableContextMenuItem setHidden:YES]; + break; case SPTableTypeFunc: - [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Functions", @"delete functions menu title")]; - [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Functions", @"delete functions menu title")]; - [truncateTableButton setHidden:YES]; - [truncateTableContextMenuItem setHidden:YES]; - break; + [removeTableMenuItem setTitle:NSLocalizedString(@"Delete Functions", @"delete functions menu title")]; + [removeTableContextMenuItem setTitle:NSLocalizedString(@"Delete Functions", @"delete functions menu title")]; + [truncateTableButton setHidden:YES]; + [truncateTableContextMenuItem setHidden:YES]; + break; } } else { @@ -1274,10 +1273,11 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; - (NSArray *)allTableAndViewNames { NSMutableArray *returnArray = [NSMutableArray array]; - NSInteger i; + NSUInteger i; NSInteger cnt = [[self tables] count]; for(i=0; i Date: Tue, 6 Jan 2015 23:20:59 +0100 Subject: Addition to previous commit. Attention: Depening on your diff tool (Kaleidoscope and Tower are pretty bad, AppCode works well) this change might look big, but all I did was remove two levels of else { } by using return; instead. --- Source/SPTablesList.m | 245 +++++++++++++++++++++++++------------------------- 1 file changed, 123 insertions(+), 122 deletions(-) diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 1ae2e83f..e2165029 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -2495,140 +2495,141 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Couldn't get create syntax.\nMySQL said: %@", @"message of panel when table information cannot be retrieved"), [mySQLConnection lastErrorMessage]]); - } else { - //insert new table name in create syntax and create new table - NSScanner *scanner; - NSString *scanString; - - if(tblType == SPTableTypeView){ - scanner = [[NSScanner alloc] initWithString:[[queryResult getRowAsDictionary] objectForKey:@"Create View"]]; - [scanner scanUpToString:@"AS" intoString:nil]; - [scanner scanUpToString:@"" intoString:&scanString]; - [scanner release]; - [mySQLConnection queryString:[NSString stringWithFormat:@"CREATE VIEW %@ %@", [[copyTableNameField stringValue] backtickQuotedString], scanString]]; - } - else if(tblType == SPTableTypeTable){ - scanner = [[NSScanner alloc] initWithString:[[queryResult getRowAsDictionary] objectForKey:@"Create Table"]]; - [scanner scanUpToString:@"(" intoString:nil]; - [scanner scanUpToString:@"" intoString:&scanString]; - [scanner release]; - - // If there are any InnoDB referencial constraints we need to strip out the names as they must be unique. - // MySQL will generate the new names based on the new table name. - scanString = [scanString stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"CONSTRAINT `[^`]+` "] withString:@""]; - - // If we're not copying the tables content as well then we need to strip out any AUTO_INCREMENT presets. - if (!copyTableContent) { - scanString = [scanString stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"AUTO_INCREMENT=[0-9]+ "] withString:@""]; - } - - [mySQLConnection queryString:[NSString stringWithFormat:@"CREATE TABLE %@ %@", [[copyTableNameField stringValue] backtickQuotedString], scanString]]; + return; + } + + //insert new table name in create syntax and create new table + NSScanner *scanner; + NSString *scanString; + + if(tblType == SPTableTypeView){ + scanner = [[NSScanner alloc] initWithString:[[queryResult getRowAsDictionary] objectForKey:@"Create View"]]; + [scanner scanUpToString:@"AS" intoString:nil]; + [scanner scanUpToString:@"" intoString:&scanString]; + [scanner release]; + [mySQLConnection queryString:[NSString stringWithFormat:@"CREATE VIEW %@ %@", [[copyTableNameField stringValue] backtickQuotedString], scanString]]; + } + else if(tblType == SPTableTypeTable){ + scanner = [[NSScanner alloc] initWithString:[[queryResult getRowAsDictionary] objectForKey:@"Create Table"]]; + [scanner scanUpToString:@"(" intoString:nil]; + [scanner scanUpToString:@"" intoString:&scanString]; + [scanner release]; + + // If there are any InnoDB referencial constraints we need to strip out the names as they must be unique. + // MySQL will generate the new names based on the new table name. + scanString = [scanString stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"CONSTRAINT `[^`]+` "] withString:@""]; + + // If we're not copying the tables content as well then we need to strip out any AUTO_INCREMENT presets. + if (!copyTableContent) { + scanString = [scanString stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"AUTO_INCREMENT=[0-9]+ "] withString:@""]; } - else if(tblType == SPTableTypeFunc || tblType == SPTableTypeProc) - { - // get the create syntax - SPMySQLResult *theResult; - - if(selectedTableType == SPTableTypeProc) - theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW CREATE PROCEDURE %@", [selectedTableName backtickQuotedString]]]; - else if([self tableType] == SPTableTypeFunc) - theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW CREATE FUNCTION %@", [selectedTableName backtickQuotedString]]]; - else - return; - - // Check for errors, only displaying if the connection hasn't been terminated - if ([mySQLConnection queryErrored]) { - if ([mySQLConnection isConnected]) { - SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"An error occured while retrieving the create syntax for '%@'.\nMySQL said: %@", @"message of panel when create syntax cannot be retrieved"), selectedTableName, [mySQLConnection lastErrorMessage]]); - } - return; - } - [theResult setReturnDataAsStrings:YES]; - NSString *tableSyntax = [[theResult getRowAsArray] objectAtIndex:2]; - - // replace the old name by the new one and drop the old one - [mySQLConnection queryString:[tableSyntax stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(?<=%@ )(`[^`]+?`)", [tableType uppercaseString]] withString:[[copyTableNameField stringValue] backtickQuotedString]]]; + [mySQLConnection queryString:[NSString stringWithFormat:@"CREATE TABLE %@ %@", [[copyTableNameField stringValue] backtickQuotedString], scanString]]; + } + else if(tblType == SPTableTypeFunc || tblType == SPTableTypeProc) + { + // get the create syntax + SPMySQLResult *theResult; + + if(selectedTableType == SPTableTypeProc) + theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW CREATE PROCEDURE %@", [selectedTableName backtickQuotedString]]]; + else if([self tableType] == SPTableTypeFunc) + theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW CREATE FUNCTION %@", [selectedTableName backtickQuotedString]]]; + else + return; - if ([mySQLConnection queryErrored]) { + // Check for errors, only displaying if the connection hasn't been terminated + if ([mySQLConnection queryErrored]) { + if ([mySQLConnection isConnected]) { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"Couldn't duplicate '%@'.\nMySQL said: %@", @"message of panel when an item cannot be renamed"), [copyTableNameField stringValue], [mySQLConnection lastErrorMessage]]); + [NSString stringWithFormat:NSLocalizedString(@"An error occured while retrieving the create syntax for '%@'.\nMySQL said: %@", @"message of panel when create syntax cannot be retrieved"), selectedTableName, [mySQLConnection lastErrorMessage]]); } - + return; } - if ([mySQLConnection queryErrored]) { - //error while creating new table + [theResult setReturnDataAsStrings:YES]; + NSString *tableSyntax = [[theResult getRowAsArray] objectAtIndex:2]; + + // replace the old name by the new one and drop the old one + [mySQLConnection queryString:[tableSyntax stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(?<=%@ )(`[^`]+?`)", [tableType uppercaseString]] withString:[[copyTableNameField stringValue] backtickQuotedString]]]; + + if ([mySQLConnection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"Couldn't create '%@'.\nMySQL said: %@", @"message of panel when table cannot be created"), [copyTableNameField stringValue], [mySQLConnection lastErrorMessage]]); - } else { - - if (copyTableContent) { - //copy table content - [mySQLConnection queryString:[NSString stringWithFormat: - @"INSERT INTO %@ SELECT * FROM %@", - [[copyTableNameField stringValue] backtickQuotedString], - [selectedTableName backtickQuotedString] - ]]; - - if ([mySQLConnection queryErrored]) { - SPBeginAlertSheet( - NSLocalizedString(@"Warning", @"warning"), - NSLocalizedString(@"OK", @"OK button"), - nil, - nil, - [tableDocumentInstance parentWindow], - self, - nil, - nil, - NSLocalizedString(@"There have been errors while copying table content. Please control the new table.", @"message of panel when table content cannot be copied") - ); - } - } - - // Insert the new item into the tables list and select it. - NSInteger addItemAtIndex = NSNotFound; - for (NSUInteger i = 0; i < [tables count]; i++) { - NSInteger theTableType = [[tableTypes objectAtIndex:i] integerValue]; - if (theTableType == SPTableTypeNone) continue; - if ((theTableType == SPTableTypeView || theTableType == SPTableTypeTable) - && (tblType == SPTableTypeProc || tblType == SPTableTypeFunc)) { - continue; - } - if ((theTableType == SPTableTypeProc || theTableType == SPTableTypeFunc) - && (tblType == SPTableTypeView || tblType == SPTableTypeTable)) { - addItemAtIndex = i - 1; - break; - } - if ([[copyTableNameField stringValue] localizedCompare:[tables objectAtIndex:i]] == NSOrderedAscending) { - addItemAtIndex = i; - break; - } - } - if (addItemAtIndex == NSNotFound) { - [tables addObject:[copyTableNameField stringValue]]; - [tableTypes addObject:[NSNumber numberWithInteger:tblType]]; - } else { - [tables insertObject:[copyTableNameField stringValue] atIndex:addItemAtIndex]; - [tableTypes insertObject:[NSNumber numberWithInteger:tblType] atIndex:addItemAtIndex]; - } + [NSString stringWithFormat:NSLocalizedString(@"Couldn't duplicate '%@'.\nMySQL said: %@", @"message of panel when an item cannot be renamed"), [copyTableNameField stringValue], [mySQLConnection lastErrorMessage]]); + } - // Set the selected table name and type, and use updateFilter to update the filter list and selection - if (selectedTableName) [selectedTableName release]; - - selectedTableName = [[NSString alloc] initWithString:[copyTableNameField stringValue]]; - selectedTableType = tblType; - - [self updateFilter:self]; - - [tablesListView scrollRowToVisible:[tablesListView selectedRow]]; - [tableDocumentInstance loadTable:selectedTableName ofType:selectedTableType]; + } - // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; + if ([mySQLConnection queryErrored]) { + //error while creating new table + SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, + [NSString stringWithFormat:NSLocalizedString(@"Couldn't create '%@'.\nMySQL said: %@", @"message of panel when table cannot be created"), [copyTableNameField stringValue], [mySQLConnection lastErrorMessage]]); + return; + } + + if (copyTableContent) { + //copy table content + [mySQLConnection queryString:[NSString stringWithFormat: + @"INSERT INTO %@ SELECT * FROM %@", + [[copyTableNameField stringValue] backtickQuotedString], + [selectedTableName backtickQuotedString] + ]]; + + if ([mySQLConnection queryErrored]) { + SPBeginAlertSheet( + NSLocalizedString(@"Warning", @"warning"), + NSLocalizedString(@"OK", @"OK button"), + nil, + nil, + [tableDocumentInstance parentWindow], + self, + nil, + nil, + NSLocalizedString(@"There have been errors while copying table content. Please control the new table.", @"message of panel when table content cannot be copied") + ); } } + + // Insert the new item into the tables list and select it. + NSInteger addItemAtIndex = NSNotFound; + for (NSUInteger i = 0; i < [tables count]; i++) { + NSInteger theTableType = [[tableTypes objectAtIndex:i] integerValue]; + if (theTableType == SPTableTypeNone) continue; + if ((theTableType == SPTableTypeView || theTableType == SPTableTypeTable) + && (tblType == SPTableTypeProc || tblType == SPTableTypeFunc)) { + continue; + } + if ((theTableType == SPTableTypeProc || theTableType == SPTableTypeFunc) + && (tblType == SPTableTypeView || tblType == SPTableTypeTable)) { + addItemAtIndex = i - 1; + break; + } + if ([[copyTableNameField stringValue] localizedCompare:[tables objectAtIndex:i]] == NSOrderedAscending) { + addItemAtIndex = i; + break; + } + } + if (addItemAtIndex == NSNotFound) { + [tables addObject:[copyTableNameField stringValue]]; + [tableTypes addObject:[NSNumber numberWithInteger:tblType]]; + } else { + [tables insertObject:[copyTableNameField stringValue] atIndex:addItemAtIndex]; + [tableTypes insertObject:[NSNumber numberWithInteger:tblType] atIndex:addItemAtIndex]; + } + + // Set the selected table name and type, and use updateFilter to update the filter list and selection + if (selectedTableName) [selectedTableName release]; + + selectedTableName = [[NSString alloc] initWithString:[copyTableNameField stringValue]]; + selectedTableType = tblType; + + [self updateFilter:self]; + + [tablesListView scrollRowToVisible:[tablesListView selectedRow]]; + [tableDocumentInstance loadTable:selectedTableName ofType:selectedTableType]; + + // Query the structure of all databases in the background (mainly for completion) + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } #endif -- cgit v1.2.3 From 69b519cb18762cd1b1596d50346f24e233cb8e29 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 7 Jan 2015 00:07:36 +0100 Subject: Fix some warnings --- Source/SPPreferenceController.h | 1 - Source/SPPreferenceController.m | 10 ++++++++-- Source/SPPreferenceControllerDelegate.m | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/SPPreferenceController.h b/Source/SPPreferenceController.h index c34f8542..3434663e 100644 --- a/Source/SPPreferenceController.h +++ b/Source/SPPreferenceController.h @@ -61,7 +61,6 @@ NSToolbarItem *generalItem; NSToolbarItem *notificationsItem; NSToolbarItem *tablesItem; - NSToolbarItem *favoritesItem; NSToolbarItem *autoUpdateItem; NSToolbarItem *networkItem; NSToolbarItem *editorItem; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 36954bc8..fad1d95b 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -128,14 +128,14 @@ [prefs setObject:[NSArchiver archivedDataWithRootObject:font] forKey:SPGlobalResultTableFont]; - [(SPTablesPreferencePane *)tablesPreferencePane updateDisplayedTableFontName]; + [tablesPreferencePane updateDisplayedTableFontName]; break; case SPPrefFontChangeTargetEditor: font = [[NSFontPanel sharedFontPanel] panelConvertFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorFont]]]; [prefs setObject:[NSArchiver archivedDataWithRootObject:font] forKey:SPCustomQueryEditorFont]; - [(SPEditorPreferencePane *)editorPreferencePane updateDisplayedEditorFontName]; + [editorPreferencePane updateDisplayedEditorFontName]; break; } } @@ -231,6 +231,12 @@ - (void)dealloc { SPClear(preferencePanes); + SPClear(generalItem); + SPClear(tablesItem); + SPClear(notificationsItem); + SPClear(editorItem); + SPClear(autoUpdateItem); + SPClear(networkItem); [super dealloc]; } diff --git a/Source/SPPreferenceControllerDelegate.m b/Source/SPPreferenceControllerDelegate.m index ce05de6c..6a16de0f 100644 --- a/Source/SPPreferenceControllerDelegate.m +++ b/Source/SPPreferenceControllerDelegate.m @@ -62,7 +62,7 @@ #pragma mark - #pragma mark Toolbar delegate methods -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag +- (NSToolbarItem *)toolbar:(NSToolbar *)aToolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { if ([itemIdentifier isEqualToString:SPPreferenceToolbarGeneral]) { return generalItem; @@ -89,7 +89,7 @@ return [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease]; } -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)aToolbar { return @[ SPPreferenceToolbarGeneral, @@ -102,7 +102,7 @@ ]; } -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)aToolbar { return @[ SPPreferenceToolbarGeneral, @@ -115,7 +115,7 @@ ]; } -- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar +- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)aToolbar { return @[ SPPreferenceToolbarGeneral, -- cgit v1.2.3 From dcfe99612cadd055599acd2070d4d9ac49633a95 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Jan 2015 22:07:25 +0100 Subject: Unescape escaped mirrored snippets in query fav. fixes #2049 --- Source/SPTextView.m | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Source/SPTextView.m b/Source/SPTextView.m index c3ebf394..f50ed939 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -1934,20 +1934,22 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } // unescape escaped snippets and re-adjust successive snippet locations : \${1:a} → ${1:a} - NSString *ure = @"(?s)\\\\\\$\\{(1?\\d):(.{0}|.*?[^\\\\])\\}"; - while([snip isMatchedByRegex:ure]) { - NSRange escapeRange = [snip rangeOfRegex:ure capture:0L]; - [snip replaceCharactersInRange:escapeRange withString:[snip substringWithRange:NSMakeRange(escapeRange.location+1,escapeRange.length-1)]]; - NSInteger loc = escapeRange.location + targetRange.location; - [snip flushCachedRegexData]; - for(i=0; i<=snippetControlMax; i++) - if(snippetControlArray[i][0] > -1 && snippetControlArray[i][0] > loc) - snippetControlArray[i][0]--; - // Adjust mirrored snippets - if(mirroredCounter > -1) - for(i=0; i<=mirroredCounter; i++) - if(snippetMirroredControlArray[i][0] > -1 && snippetMirroredControlArray[i][1] > loc) - snippetMirroredControlArray[i][1]--; + // unescape escaped mirrored snippets and re-adjust successive snippet locations : \$1 → $1 + for (NSString *regex in @[@"(?s)\\\\\\$\\{(1?\\d):(.{0}|.*?[^\\\\])\\}",@"(?s)\\\\\\$(1?\\d)(?=\\D)"]) { + while([snip isMatchedByRegex:regex]) { + NSRange escapeRange = [snip rangeOfRegex:regex capture:0L]; + [snip replaceCharactersInRange:escapeRange withString:[snip substringWithRange:NSMakeRange(escapeRange.location+1,escapeRange.length-1)]]; + NSInteger loc = escapeRange.location + targetRange.location; + [snip flushCachedRegexData]; + for(i=0; i<=snippetControlMax; i++) + if(snippetControlArray[i][0] > -1 && snippetControlArray[i][0] > loc) + snippetControlArray[i][0]--; + // Adjust mirrored snippets + if(mirroredCounter > -1) + for(i=0; i<=mirroredCounter; i++) + if(snippetMirroredControlArray[i][0] > -1 && snippetMirroredControlArray[i][1] > loc) + snippetMirroredControlArray[i][1]--; + } } // Insert favorite query by selecting the tab trigger if any -- cgit v1.2.3 From 4fafe928e01b6dbf1674eebddd8b9816a9ebcdd1 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 10 Jan 2015 08:42:27 +0100 Subject: Somehow a "}" got dropped in 56949ac7 --- Source/SPTablesList.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index e2165029..76f6d1ce 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -282,6 +282,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; } } } + } #endif // Restore encoding if appropriate -- cgit v1.2.3 From d5ffcf83d78e5dc2c6185c13ecce5456b613a655 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 10 Jan 2015 14:51:20 +0100 Subject: Fix a compiler warning --- Source/SPAppController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 0840978d..0d60437b 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -670,10 +670,10 @@ } // Update Bundle Editor if it was already initialized - for (id win in [NSApp windows]) + for (NSWindow *win in [NSApp windows]) { - if ([[[[win delegate] class] description] isEqualToString:@"SPBundleEditorController"]) { - [[win delegate] reloadBundles:nil]; + if ([[win delegate] class] == [SPBundleEditorController class]) { + [((SPBundleEditorController *)[win delegate]) reloadBundles:nil]; break; } } -- cgit v1.2.3 From 07ad0987959c3e43c82e8cffcbf66761327b8c41 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 11 Jan 2015 14:51:24 +0100 Subject: Yay, 2015. --- LICENSE | 2 +- Resources/License.rtf | 2 +- readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index bea4374e..3e5f86db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2002-2014 Sequel Pro & CocoaMySQL Teams. +Copyright (c) 2002-2015 Sequel Pro & CocoaMySQL Teams. All rights reserved. diff --git a/Resources/License.rtf b/Resources/License.rtf index 8d733b9b..a9ce83c0 100644 --- a/Resources/License.rtf +++ b/Resources/License.rtf @@ -5,7 +5,7 @@ \deftab560 \pard\tx560\pardeftab560\pardirnatural -\f0\b\fs22 \cf2 \CocoaLigature0 Copyright (c) 2002-2014 Sequel Pro & CocoaMySQL Teams. \ +\f0\b\fs22 \cf2 \CocoaLigature0 Copyright (c) 2002-2015 Sequel Pro & CocoaMySQL Teams. \ \ All rights reserved. \b0 \ diff --git a/readme.md b/readme.md index 6f1d4ded..25c4206c 100644 --- a/readme.md +++ b/readme.md @@ -20,6 +20,6 @@ Build Instructions License ======= -Copyright (c) 2002-2014 Sequel Pro & CocoaMySQL Teams. All rights reserved. +Copyright (c) 2002-2015 Sequel Pro & CocoaMySQL Teams. All rights reserved. Sequel Pro is free and open source software, licensed under [MIT](http://opensource.org/licenses/MIT). See [LICENSE](https://github.com/sequelpro/sequelpro/blob/master/LICENSE) for full details. -- cgit v1.2.3 From f2bb1116a22dcbd680a61637532108d0c8497b99 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 11 Jan 2015 15:24:10 +0100 Subject: Fix an issue where a KV Observer was not removed on dealloc resulting in KVO messaging a Zombie and crashing --- Source/SPDatabaseDocument.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 269e62d4..a14a6f03 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -6264,6 +6264,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [prefs removeObserver:tableSourceInstance forKeyPath:SPUseMonospacedFonts]; [prefs removeObserver:[SPQueryController sharedQueryController] forKeyPath:SPUseMonospacedFonts]; [prefs removeObserver:tableContentInstance forKeyPath:SPGlobalResultTableFont]; + [prefs removeObserver:tableContentInstance forKeyPath:SPDisplayBinaryDataAsHex]; [prefs removeObserver:[SPQueryController sharedQueryController] forKeyPath:SPConsoleEnableLogging]; [prefs removeObserver:self forKeyPath:SPConsoleEnableLogging]; -- cgit v1.2.3 From 4e3fc71b8f5c4a1cc53e2ebf6dee1ad9ccfbaf34 Mon Sep 17 00:00:00 2001 From: Christoph Neukirch Date: Tue, 13 Jan 2015 19:57:30 +0100 Subject: Fix an issue with ssh -L forwarding (: is the correct separator) --- Source/SPSSHTunnel.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 1c217986..3b58d331 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -373,10 +373,10 @@ [taskArguments addObject:sshHost]; } if (useHostFallback) { - [taskArguments addObject:[NSString stringWithFormat:@"-L %ld/127.0.0.1/%ld", (long)localPort, (long)remotePort]]; - [taskArguments addObject:[NSString stringWithFormat:@"-L %ld/%@/%ld", (long)localPortFallback, remoteHost, (long)remotePort]]; + [taskArguments addObject:[NSString stringWithFormat:@"-L %ld:127.0.0.1:%ld", (long)localPort, (long)remotePort]]; + [taskArguments addObject:[NSString stringWithFormat:@"-L %ld:%@:%ld", (long)localPortFallback, remoteHost, (long)remotePort]]; } else { - [taskArguments addObject:[NSString stringWithFormat:@"-L %ld/%@/%ld", (long)localPort, remoteHost, (long)remotePort]]; + [taskArguments addObject:[NSString stringWithFormat:@"-L %ld:%@:%ld", (long)localPort, remoteHost, (long)remotePort]]; } [task setArguments:taskArguments]; -- cgit v1.2.3 From e9b8c389a1e2341ff069de8de4305163dfef48b5 Mon Sep 17 00:00:00 2001 From: Max Lohrmann Date: Tue, 13 Jan 2015 21:46:54 +0100 Subject: Change the way the NSOpenPanel is handled when selecting an SSH key to address #2042 --- Source/SPConnectionController.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 79a15a19..7cde1e4e 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -371,8 +371,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, #ifndef SP_CODA NSString *directoryPath = nil; NSString *filePath = nil; - keySelectionPanel = [NSOpenPanel openPanel]; - [keySelectionPanel setShowsHiddenFiles:[prefs boolForKey:SPHiddenKeyFileVisibilityKey]]; + NSView *accessoryView = nil; // If the button was toggled off, ensure editing is ended if ([sender state] == NSOffState) { @@ -395,7 +394,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, directoryPath = [sshKeyLocation stringByDeletingLastPathComponent]; } - [keySelectionPanel setAccessoryView:sshKeyLocationHelp]; + accessoryView = sshKeyLocationHelp; } // SSL key file location: else if (sender == standardSSLKeyFileButton || sender == socketSSLKeyFileButton || sender == sslOverSSHKeyFileButton) { @@ -404,7 +403,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, return; } - [keySelectionPanel setAccessoryView:sslKeyFileLocationHelp]; + accessoryView = sslKeyFileLocationHelp; } // SSL certificate file location: else if (sender == standardSSLCertificateButton || sender == socketSSLCertificateButton || sender == sslOverSSHCertificateButton) { @@ -413,7 +412,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, return; } - [keySelectionPanel setAccessoryView:sslCertificateLocationHelp]; + accessoryView = sslCertificateLocationHelp; } // SSL CA certificate file location: else if (sender == standardSSLCACertButton || sender == socketSSLCACertButton || sender == sslOverSSHCACertButton) { @@ -422,12 +421,21 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, return; } - [keySelectionPanel setAccessoryView:sslCACertLocationHelp]; + accessoryView = sslCACertLocationHelp; } + + keySelectionPanel = [[NSOpenPanel openPanel] retain]; // retain/release needed on OS X ≤ 10.6 according to Apple doc + [keySelectionPanel setShowsHiddenFiles:[prefs boolForKey:SPHiddenKeyFileVisibilityKey]]; + [keySelectionPanel setAccessoryView:accessoryView]; [keySelectionPanel beginSheetModalForWindow:[dbDocument parentWindow] completionHandler:^(NSInteger returnCode) { NSString *abbreviatedFileName = [[[keySelectionPanel URL] path] stringByAbbreviatingWithTildeInPath]; + + //delay the release so it won't happen while this block is still executing. + dispatch_async(dispatch_get_current_queue(), ^{ + SPClear(keySelectionPanel); + }); // SSH key file selection if (sender == sshSSHKeyButton) { -- cgit v1.2.3 From 1deef4e36d118412d34b695e54d888394463a9a3 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 26 Jan 2015 01:13:40 +0100 Subject: Fix build destination of GotoDatabaseDialog.xib --- sequel-pro.xcodeproj/project.pbxproj | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 5a795678..87d779f8 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -180,8 +180,8 @@ 4DECC4910EC2B436008D359E /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3340EC2A170008D359E /* Growl.framework */; }; 501B1D181728A3DA0017C92E /* SPCharsetCollationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */; }; 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; - 50A9F8AD19EAD4860053E571 /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50A9F8AC19EAD4860053E571 /* GotoDatabaseDialog.xib */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; + 50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; 50E217B618174280009D3580 /* SPFavoriteColorSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; @@ -884,9 +884,9 @@ 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableContentFilterController.h; sourceTree = ""; }; 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = ""; }; - 50A9F8AC19EAD4860053E571 /* GotoDatabaseDialog.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = GotoDatabaseDialog.xib; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = ""; }; 50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGotoDatabaseController.h; sourceTree = ""; }; 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGotoDatabaseController.m; sourceTree = ""; }; + 50D3C34A1A75B8A800B5429C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = ""; }; 50E217B118174246009D3580 /* SPColorSelectorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorSelectorView.h; sourceTree = ""; }; 50E217B218174246009D3580 /* SPColorSelectorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorSelectorView.m; sourceTree = ""; }; 50E217B418174280009D3580 /* SPFavoriteColorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFavoriteColorSupport.h; sourceTree = ""; }; @@ -2202,7 +2202,7 @@ BC8B0DAD104004F900FC02EC /* EncodingPopupView.xib */, B5E92F170F75B2D100012500 /* ExportDialog.xib */, BCA6F62F100FA7D700E80253 /* FieldEditorSheet.xib */, - 50A9F8AC19EAD4860053E571 /* GotoDatabaseDialog.xib */, + 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */, BC65C3B0107CE3EE003F7B02 /* ImportAccessory.xib */, 17A7773611C52E61001E27B4 /* IndexesView.xib */, 1761FD460EF03A6F00331368 /* MainMenu.xib */, @@ -2927,7 +2927,7 @@ C9AD7C7C1676158C00234EEE /* toolbar-switch-to-sql@2x.png in Resources */, C9AD7C7F167619B400234EEE /* button_refresh.png in Resources */, C9AD7C80167619B400234EEE /* button_refresh@2x.png in Resources */, - 50A9F8AD19EAD4860053E571 /* GotoDatabaseDialog.xib in Resources */, + 50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */, C9AD7C8316761B3300234EEE /* button_action.png in Resources */, C9AD7C8416761B3300234EEE /* button_action@2x.png in Resources */, C9AD7C891676204300234EEE /* button_info_pane_hide.png in Resources */, @@ -3409,6 +3409,14 @@ name = UserManagerView.xib; sourceTree = ""; }; + 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */ = { + isa = PBXVariantGroup; + children = ( + 50D3C34A1A75B8A800B5429C /* English */, + ); + name = GotoDatabaseDialog.xib; + sourceTree = ""; + }; 58186D1F0F4CB38900851FE9 /* ConnectionErrorDialog.xib */ = { isa = PBXVariantGroup; children = ( -- cgit v1.2.3 From cf2559d98a00699462bc32f3e19753a9ca547a9c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Jan 2015 01:55:18 +0100 Subject: Move some duplicate code into it's own file --- Source/SPEditorTokens.l | 55 +---------------------- Source/SPParserUtils.c | 87 ++++++++++++++++++++++++++++++++++++ Source/SPParserUtils.h | 41 +++++++++++++++++ Source/SPSQLTokenizer.l | 59 ++---------------------- sequel-pro.xcodeproj/project.pbxproj | 8 ++++ 5 files changed, 140 insertions(+), 110 deletions(-) create mode 100644 Source/SPParserUtils.c create mode 100644 Source/SPParserUtils.h diff --git a/Source/SPEditorTokens.l b/Source/SPEditorTokens.l index c10dbd60..a40105a1 100644 --- a/Source/SPEditorTokens.l +++ b/Source/SPEditorTokens.l @@ -43,8 +43,8 @@ */ #import "SPEditorTokens.h" +#include "SPParserUtils.h" -size_t utf8strlen(const char * _s); size_t yyuoffset, yyuleng; //keep track of the current utf-8 character (not byte) offset and token length @@ -126,59 +126,6 @@ keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BIN } %% -#define ONEMASK ((size_t)(-1) / 0xFF) -// adapted from http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html -size_t utf8strlen(const char * _s) -{ - const char * s; - size_t count = 0; - size_t u; - unsigned char b; - - /* Handle any initial misaligned bytes. */ - for (s = _s; (uintptr_t)(s) & (sizeof(size_t) - 1); s++) { - b = *s; - - /* Exit if we hit a zero byte. */ - if (b == '\0') - goto done; - - /* Is this byte NOT the first byte of a character? */ - count += (b >> 7) & ((~b) >> 6); - } - - /* Handle complete blocks. */ - for (; ; s += sizeof(size_t)) { - /* Prefetch 256 bytes ahead. */ - __builtin_prefetch(&s[256], 0, 0); - - /* Grab 4 or 8 bytes of UTF-8 data. */ - u = *(size_t *)(s); - - /* Exit the loop if there are any zero bytes. */ - if ((u - ONEMASK) & (~u) & (ONEMASK * 0x80)) - break; - - /* Count bytes which are NOT the first byte of a character. */ - u = ((u & (ONEMASK * 0x80)) >> 7) & ((~u) >> 6); - count += (u * ONEMASK) >> ((sizeof(size_t) - 1) * 8); - } - - /* Take care of any left-over bytes. */ - for (; ; s++) { - b = *s; - - /* Exit if we hit a zero byte. */ - if (b == '\0') - break; - - /* Is this byte NOT the first byte of a character? */ - count += (b >> 7) & ((~b) >> 6); - } - -done: - return ((s - _s) - count); -} /* un-optimized keywords: ACCESSIBLE diff --git a/Source/SPParserUtils.c b/Source/SPParserUtils.c new file mode 100644 index 00000000..b3b48945 --- /dev/null +++ b/Source/SPParserUtils.c @@ -0,0 +1,87 @@ +// +// SPParserUtils.c +// sequel-pro +// +// Created by Max Lohrmann on 27.01.15. +// Relocated from existing files. Previous copyright applies. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#include "SPParserUtils.h" +#include + +#define ONEMASK ((size_t)(-1) / 0xFF) + +// adapted from http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html +size_t utf8strlen(const char * _s) +{ + const char * s; + size_t count = 0; + size_t u; + unsigned char b; + + /* Handle any initial misaligned bytes. */ + for (s = _s; (uintptr_t)(s) & (sizeof(size_t) - 1); s++) { + b = *s; + + /* Exit if we hit a zero byte. */ + if (b == '\0') + goto done; + + /* Is this byte NOT the first byte of a character? */ + count += (b >> 7) & ((~b) >> 6); + } + + /* Handle complete blocks. */ + for (; ; s += sizeof(size_t)) { + /* Prefetch 256 bytes ahead. */ + __builtin_prefetch(&s[256], 0, 0); + + /* Grab 4 or 8 bytes of UTF-8 data. */ + u = *(size_t *)(s); + + /* Exit the loop if there are any zero bytes. */ + if ((u - ONEMASK) & (~u) & (ONEMASK * 0x80)) + break; + + /* Count bytes which are NOT the first byte of a character. */ + u = ((u & (ONEMASK * 0x80)) >> 7) & ((~u) >> 6); + count += (u * ONEMASK) >> ((sizeof(size_t) - 1) * 8); + } + + /* Take care of any left-over bytes. */ + for (; ; s++) { + b = *s; + + /* Exit if we hit a zero byte. */ + if (b == '\0') + break; + + /* Is this byte NOT the first byte of a character? */ + count += (b >> 7) & ((~b) >> 6); + } + +done: + return ((s - _s) - count); +} diff --git a/Source/SPParserUtils.h b/Source/SPParserUtils.h new file mode 100644 index 00000000..487131e0 --- /dev/null +++ b/Source/SPParserUtils.h @@ -0,0 +1,41 @@ +// +// SPParserUtils.h +// sequel-pro +// +// Created by Max Lohrmann on 27.01.15. +// Relocated from existing files. Previous copyright applies. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#ifndef __SPParserUtils__ +#define __SPParserUtils__ + +#include + +/** + * Return number of characters (NOT bytes) in a given UTF-8 encoded C string. + */ +size_t utf8strlen(const char * _s); + +#endif /* defined(__SPParserUtils__) */ diff --git a/Source/SPSQLTokenizer.l b/Source/SPSQLTokenizer.l index 24dac938..b9170edb 100644 --- a/Source/SPSQLTokenizer.l +++ b/Source/SPSQLTokenizer.l @@ -31,12 +31,12 @@ // More info at #import "SPSQLTokenizer.h" +#include "SPParserUtils.h" -int utf8strlenfortoken(const char * _s); -int yyuoffset, yyuleng; +size_t yyuoffset, yyuleng; //keep track of the current utf-8 character (not byte) offset and token length -#define YY_USER_ACTION { yyuoffset += yyuleng; yyuleng = utf8strlenfortoken(yytext); } +#define YY_USER_ACTION { yyuoffset += yyuleng; yyuleng = utf8strlen(yytext); } //ignore the output of unmatched characters #define ECHO {} %} @@ -90,56 +90,3 @@ compend {s}"end" return 0; } %% -#define ONEMASK ((size_t)(-1) / 0xFF) -// adapted from http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html -int utf8strlenfortoken(const char * _s) -{ - const char * s; - size_t count = 0; - size_t u; - unsigned char b; - - /* Handle any initial misaligned bytes. */ - for (s = _s; (uintptr_t)(s) & (sizeof(size_t) - 1); s++) { - b = *s; - - /* Exit if we hit a zero byte. */ - if (b == '\0') - goto done; - - /* Is this byte NOT the first byte of a character? */ - count += (b >> 7) & ((~b) >> 6); - } - - /* Handle complete blocks. */ - for (; ; s += sizeof(size_t)) { - /* Prefetch 256 bytes ahead. */ - __builtin_prefetch(&s[256], 0, 0); - - /* Grab 4 or 8 bytes of UTF-8 data. */ - u = *(size_t *)(s); - - /* Exit the loop if there are any zero bytes. */ - if ((u - ONEMASK) & (~u) & (ONEMASK * 0x80)) - break; - - /* Count bytes which are NOT the first byte of a character. */ - u = ((u & (ONEMASK * 0x80)) >> 7) & ((~u) >> 6); - count += (u * ONEMASK) >> ((sizeof(size_t) - 1) * 8); - } - - /* Take care of any left-over bytes. */ - for (; ; s++) { - b = *s; - - /* Exit if we hit a zero byte. */ - if (b == '\0') - break; - - /* Is this byte NOT the first byte of a character? */ - count += (b >> 7) & ((~b) >> 6); - } - -done: - return (int)((s - _s) - count); -} diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 87d779f8..7368bcf5 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -182,6 +182,8 @@ 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; 50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */; }; + 50D3C3521A77135F00B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; + 50D3C3541A7715E600B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; 50E217B618174280009D3580 /* SPFavoriteColorSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; @@ -887,6 +889,8 @@ 50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGotoDatabaseController.h; sourceTree = ""; }; 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPGotoDatabaseController.m; sourceTree = ""; }; 50D3C34A1A75B8A800B5429C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = ""; }; + 50D3C3501A77135F00B5429C /* SPParserUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SPParserUtils.c; sourceTree = ""; }; + 50D3C3511A77135F00B5429C /* SPParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPParserUtils.h; sourceTree = ""; }; 50E217B118174246009D3580 /* SPColorSelectorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorSelectorView.h; sourceTree = ""; }; 50E217B218174246009D3580 /* SPColorSelectorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorSelectorView.m; sourceTree = ""; }; 50E217B418174280009D3580 /* SPFavoriteColorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFavoriteColorSupport.h; sourceTree = ""; }; @@ -2533,6 +2537,8 @@ BCD0AD4A0FBBFC480066EA5C /* SPSQLTokenizer.h */, BCD0AD480FBBFC340066EA5C /* SPSQLTokenizer.l */, 1755A25C16B33BEA00B35787 /* SPSyntaxParser.h */, + 50D3C3501A77135F00B5429C /* SPParserUtils.c */, + 50D3C3511A77135F00B5429C /* SPParserUtils.h */, ); name = Parsing; sourceTree = ""; @@ -3035,6 +3041,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 50D3C3541A7715E600B5429C /* SPParserUtils.c in Sources */, BC34F3281292AD6F000DA1AA /* SPConstants.m in Sources */, BC6D709E120C4C9F008027B5 /* SPEditorTokens.l in Sources */, BC0E1487120AAB5C00E52E25 /* SPStringAdditions.m in Sources */, @@ -3223,6 +3230,7 @@ 17D3C66E128AD4710047709F /* SPFavoritesController.m in Sources */, 17D3C671128AD8160047709F /* SPSingleton.m in Sources */, 17D3C6D3128B1C900047709F /* SPFavoritesOutlineView.m in Sources */, + 50D3C3521A77135F00B5429C /* SPParserUtils.c in Sources */, BC68BFC7128D4EAE004907D9 /* SPBundleEditorController.m in Sources */, BC1944D01297291800A236CD /* SPBundleCommandTextView.m in Sources */, BC77C5E4129AA69E009AD832 /* SPBundleHTMLOutputController.m in Sources */, -- cgit v1.2.3 From c9c96aff2a9e7201859f9ac6c46c0d9986f22ac3 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Jan 2015 03:34:49 +0100 Subject: Adding a unit test that should fail right now (if I could get Xcode to **actually** run the tests instead of only showing green checkmarks, that is) --- UnitTests/SPParserUtilsTest.m | 72 ++++++++++++++++++++++++++++++++++++ sequel-pro.xcodeproj/project.pbxproj | 14 +++++++ 2 files changed, 86 insertions(+) create mode 100644 UnitTests/SPParserUtilsTest.m diff --git a/UnitTests/SPParserUtilsTest.m b/UnitTests/SPParserUtilsTest.m new file mode 100644 index 00000000..c760e8b5 --- /dev/null +++ b/UnitTests/SPParserUtilsTest.m @@ -0,0 +1,72 @@ +// +// SPParserUtilsTest.m +// sequel-pro +// +// Created by Max Lohrmann on 27.01.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#define USE_APPLICATION_UNIT_TEST 1 + +#import +#import + +#include "SPParserUtils.h" + +@interface SPParserUtilsTest : SenTestCase + +- (void)testUtf8strlen; + +@end + +@implementation SPParserUtilsTest + +- (void)testUtf8strlen { + const char *empty = ""; + NSString *emptyString = [NSString stringWithCString:empty encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(empty),[emptyString length], @"empty string"); + + const char *singleByteSeq = "Hello World!"; + NSString *singleByteString = [NSString stringWithCString:singleByteSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(singleByteSeq), [singleByteString length], @"ASCII UTF-8 subset"); + + const char *twoByteSeq = "H\xC3\xA4ll\xC3\xB6 W\xC3\x9Crld\xC3\x9F!"; // Hällö WÜrldß! + NSString *twoByteString = [NSString stringWithCString:twoByteSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(twoByteSeq), [twoByteString length], @"String containing two-byte utf8 characters"); + + const char *threeByteSeq = "\xE3\x81\x93.\xE3\x82\x93.\xE3\x81\xAB.\xE3\x81\xA1.\xE3\x81\xAF"; // こ.ん.に.ち.は + NSString *threeByteString = [NSString stringWithCString:threeByteSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(threeByteSeq), [threeByteString length], @"String containing three-byte utf8 characters"); + + const char *fourByteSeq = "\xF0\x9F\x8D\x8F\xF0\x9F\x8D\x8B\xF0\x9F\x8D\x92"; //🍏🍋🍒 + NSString *fourByteString = [NSString stringWithCString:fourByteSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(fourByteSeq), [fourByteString length], @"String containing only 4-byte utf8 characters (outside BMP)"); + + const char *mixedSeq = "\xE3\x81\x82\xE3\x82\x81\xE3\x80\x90\xE9\xA3\xB4\xE3\x80\x91\xF0\x9F\x8D\xAD \xE2\x89\x88 S\xC3\xBC\xC3\x9Figkeit"; // あめ【飴】🍭 ≈ Süßigkeit + NSString *mixedString = [NSString stringWithCString:mixedSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(mixedSeq), [mixedString length], @"utf8 characters with all 4 lengths mixed together."); +} + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 7368bcf5..d9cb76c1 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -184,6 +184,8 @@ 50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */; }; 50D3C3521A77135F00B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; 50D3C3541A7715E600B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; + 50D3C35C1A771C4C00B5429C /* SPParserUtilsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C35B1A771C4C00B5429C /* SPParserUtilsTest.m */; }; + 50D3C35D1A77217800B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; 50E217B618174280009D3580 /* SPFavoriteColorSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; @@ -891,6 +893,7 @@ 50D3C34A1A75B8A800B5429C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/GotoDatabaseDialog.xib; sourceTree = ""; }; 50D3C3501A77135F00B5429C /* SPParserUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SPParserUtils.c; sourceTree = ""; }; 50D3C3511A77135F00B5429C /* SPParserUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPParserUtils.h; sourceTree = ""; }; + 50D3C35B1A771C4C00B5429C /* SPParserUtilsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPParserUtilsTest.m; sourceTree = ""; }; 50E217B118174246009D3580 /* SPColorSelectorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPColorSelectorView.h; sourceTree = ""; }; 50E217B218174246009D3580 /* SPColorSelectorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorSelectorView.m; sourceTree = ""; }; 50E217B418174280009D3580 /* SPFavoriteColorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFavoriteColorSupport.h; sourceTree = ""; }; @@ -2345,6 +2348,7 @@ 380F4EF20FC0B67A00B0BFD7 /* Unit Tests */ = { isa = PBXGroup; children = ( + 50D3C3591A771C2300B5429C /* Other */, 1198F5B41174EDDE00670590 /* Database Actions */, 17DC886A126B378A00E9AAEC /* Category Additions */, ); @@ -2352,6 +2356,14 @@ path = UnitTests; sourceTree = ""; }; + 50D3C3591A771C2300B5429C /* Other */ = { + isa = PBXGroup; + children = ( + 50D3C35B1A771C4C00B5429C /* SPParserUtilsTest.m */, + ); + name = Other; + sourceTree = ""; + }; 583CE39511722B70008F148E /* File Compression */ = { isa = PBXGroup; children = ( @@ -3027,6 +3039,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 50D3C35D1A77217800B5429C /* SPParserUtils.c in Sources */, 380F4EF50FC0B68F00B0BFD7 /* SPStringAdditionsTests.m in Sources */, 1760599F1336199D0098E162 /* SPMenuAdditionsTests.m in Sources */, 1798F1C4155018E2004B0AB8 /* SPMutableArrayAdditionsTests.m in Sources */, @@ -3034,6 +3047,7 @@ 17DB5F4A1555CA810046834B /* SPMenuAdditions.m in Sources */, 1717F9661557E0450065C036 /* SPStringAdditions.m in Sources */, 1717FA401558313A0065C036 /* RegexKitLite.m in Sources */, + 50D3C35C1A771C4C00B5429C /* SPParserUtilsTest.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- cgit v1.2.3 From aa15d317223cc0d1f0d3267728132b7bdbf238df Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Jan 2015 12:02:48 +0100 Subject: Expand previous unit test --- UnitTests/SPParserUtilsTest.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UnitTests/SPParserUtilsTest.m b/UnitTests/SPParserUtilsTest.m index c760e8b5..5066f8f7 100644 --- a/UnitTests/SPParserUtilsTest.m +++ b/UnitTests/SPParserUtilsTest.m @@ -48,6 +48,13 @@ NSString *emptyString = [NSString stringWithCString:empty encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(empty),[emptyString length], @"empty string"); + // This is just a little safeguard. + // If any of those conditions fail, all of the following assumptions are moot. + const char *charSeq = "\xF0\x9F\x8D\x8F"; //🍏 + NSString *charString = [NSString stringWithCString:charSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(strlen(charSeq), 4, @"assumption about storage for binary C string"); + STAssertEquals([charString length], 2, @"assumption about NSString internal storage of string"); + const char *singleByteSeq = "Hello World!"; NSString *singleByteString = [NSString stringWithCString:singleByteSeq encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(singleByteSeq), [singleByteString length], @"ASCII UTF-8 subset"); @@ -67,6 +74,11 @@ const char *mixedSeq = "\xE3\x81\x82\xE3\x82\x81\xE3\x80\x90\xE9\xA3\xB4\xE3\x80\x91\xF0\x9F\x8D\xAD \xE2\x89\x88 S\xC3\xBC\xC3\x9Figkeit"; // あめ【飴】🍭 ≈ Süßigkeit NSString *mixedString = [NSString stringWithCString:mixedSeq encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(mixedSeq), [mixedString length], @"utf8 characters with all 4 lengths mixed together."); + + //composed vs. decomposed chars + const char *decompSeq = "\xC3\xA4 - a\xCC\x88"; // ä - ä + NSString *decompString = [NSString stringWithCString:decompSeq encoding:NSUTF8StringEncoding]; + STAssertEquals(utf8strlen(decompSeq), [decompString length], @"\"LATIN SMALL LETTER A WITH DIAERESIS\" vs. \"LATIN SMALL LETTER A\" + \"COMBINING DIAERESIS\""); } @end -- cgit v1.2.3 From 2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 28 Jan 2015 22:42:47 +0100 Subject: Fix syntax highlighting for emoji et al. #2044 Voodoo magic provided by @Bibiko ;) --- Source/SPParserUtils.c | 45 ++++++++++++++++++---- UnitTests/SPParserUtilsTest.m | 7 +++- .../xcshareddata/xcschemes/Sequel Pro.xcscheme | 9 ++++- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/Source/SPParserUtils.c b/Source/SPParserUtils.c index b3b48945..69929cee 100644 --- a/Source/SPParserUtils.c +++ b/Source/SPParserUtils.c @@ -31,18 +31,36 @@ #include "SPParserUtils.h" #include +#define SIZET (sizeof(size_t)) +#define SIZET1 (SIZET - 1) +#define SBYTE (SIZET1 * 8) + #define ONEMASK ((size_t)(-1) / 0xFF) +#define ONEMASK8 (ONEMASK * 0x80) +#define FMASK ((size_t)(-1)*(ONEMASK*0xf)-1) // adapted from http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html size_t utf8strlen(const char * _s) { + + /* Due to [NSString length] behaviour for chars > 0xFFFF {length = 2} + "correct" the variable 'count' by subtraction the number + of occurrences of the start byte 0xF0 (4-byte UTF-8 char). + Here we assume that only up to 4-byte UTF-8 chars + are allowed [latest UTF-8 specification]. + + Marked in the source code by "CORRECT". + */ + const char * s; - size_t count = 0; - size_t u; + long count = 0; + size_t u = 0; + size_t u1 = 0; unsigned char b; + /* Handle any initial misaligned bytes. */ - for (s = _s; (uintptr_t)(s) & (sizeof(size_t) - 1); s++) { + for (s = _s; (uintptr_t)(s) & SIZET1; s++) { b = *s; /* Exit if we hit a zero byte. */ @@ -51,10 +69,13 @@ size_t utf8strlen(const char * _s) /* Is this byte NOT the first byte of a character? */ count += (b >> 7) & ((~b) >> 6); + + /* CORRECT */ + count -= (b & 0xf0) == 0xf0; } /* Handle complete blocks. */ - for (; ; s += sizeof(size_t)) { + for (; ; s += SIZET) { /* Prefetch 256 bytes ahead. */ __builtin_prefetch(&s[256], 0, 0); @@ -62,12 +83,19 @@ size_t utf8strlen(const char * _s) u = *(size_t *)(s); /* Exit the loop if there are any zero bytes. */ - if ((u - ONEMASK) & (~u) & (ONEMASK * 0x80)) + if ((u - ONEMASK) & (~u) & ONEMASK8) break; + /* CORRECT */ + u1 = u & FMASK; + u1 = (u1 >> 7) & (u1 >> 6) & (u1 >> 5) & (u1 >> 4); + if (u1) count -= (u1 * ONEMASK) >> SBYTE; + /* Count bytes which are NOT the first byte of a character. */ - u = ((u & (ONEMASK * 0x80)) >> 7) & ((~u) >> 6); - count += (u * ONEMASK) >> ((sizeof(size_t) - 1) * 8); + u = ((u & ONEMASK8) >> 7) & ((~u) >> 6); + + count += (u * ONEMASK) >> SBYTE; + } /* Take care of any left-over bytes. */ @@ -80,6 +108,9 @@ size_t utf8strlen(const char * _s) /* Is this byte NOT the first byte of a character? */ count += (b >> 7) & ((~b) >> 6); + + /* CORRECT */ + count -= (b & 0xf0) == 0xf0; } done: diff --git a/UnitTests/SPParserUtilsTest.m b/UnitTests/SPParserUtilsTest.m index 5066f8f7..994b166a 100644 --- a/UnitTests/SPParserUtilsTest.m +++ b/UnitTests/SPParserUtilsTest.m @@ -44,6 +44,9 @@ @implementation SPParserUtilsTest - (void)testUtf8strlen { + // NOTE!!: Those test do not verify that the utf8strlen() function works according to spec, + // but whether it produces the same results as NSString for the same input. + const char *empty = ""; NSString *emptyString = [NSString stringWithCString:empty encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(empty),[emptyString length], @"empty string"); @@ -52,8 +55,8 @@ // If any of those conditions fail, all of the following assumptions are moot. const char *charSeq = "\xF0\x9F\x8D\x8F"; //🍏 NSString *charString = [NSString stringWithCString:charSeq encoding:NSUTF8StringEncoding]; - STAssertEquals(strlen(charSeq), 4, @"assumption about storage for binary C string"); - STAssertEquals([charString length], 2, @"assumption about NSString internal storage of string"); + STAssertEquals(strlen(charSeq), (size_t)4, @"assumption about storage for binary C string"); + STAssertEquals([charString length], (NSUInteger)2, @"assumption about NSString internal storage of string"); const char *singleByteSeq = "Hello World!"; NSString *singleByteString = [NSString stringWithCString:singleByteSeq encoding:NSUTF8StringEncoding]; diff --git a/sequel-pro.xcodeproj/xcshareddata/xcschemes/Sequel Pro.xcscheme b/sequel-pro.xcodeproj/xcshareddata/xcschemes/Sequel Pro.xcscheme index e6b89ad7..579336f6 100644 --- a/sequel-pro.xcodeproj/xcshareddata/xcschemes/Sequel Pro.xcscheme +++ b/sequel-pro.xcodeproj/xcshareddata/xcschemes/Sequel Pro.xcscheme @@ -25,7 +25,7 @@ + + + + Date: Fri, 30 Jan 2015 19:29:43 +0100 Subject: Fix another runtime warning caused by the up&down conversion of IB files --- Interfaces/English.lproj/FieldEditorSheet.xib | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Interfaces/English.lproj/FieldEditorSheet.xib b/Interfaces/English.lproj/FieldEditorSheet.xib index 4772a1bc..45c07288 100644 --- a/Interfaces/English.lproj/FieldEditorSheet.xib +++ b/Interfaces/English.lproj/FieldEditorSheet.xib @@ -261,14 +261,6 @@ NSImage NSQuickLookTemplate - - NSImage - 0DC49F39-0140-4712-A530-2E252E2A7E0C - - - NSImage - C9E4BFB5-33F9-4FBA-8F09-BD08CCB0F9CA - _popUpItemAction: @@ -8248,8 +8240,6 @@ YES 3 - {128, 128} - {128, 128} {21, 16} {15, 15} -- cgit v1.2.3 From f2fc88bd1875d0dd6642c064c3528d0b5aeab09a Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 1 Feb 2015 18:20:19 +0100 Subject: Simplify catchall lexer rule --- Source/SPEditorTokens.l | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/SPEditorTokens.l b/Source/SPEditorTokens.l index a40105a1..8a7c317b 100644 --- a/Source/SPEditorTokens.l +++ b/Source/SPEditorTokens.l @@ -61,7 +61,6 @@ numeric ([+-]?(([0-9]+\.[0-9]+)|([0-9]*\.[0-9]+)|([0-9]+))(e[+-]?[0-9]+)?) ops "+"|"-"|"*"|"/" word [a-z_\.0-9À-゚@] variable @{1,2}[a-z_\.0-9À-゚$]+ -nonword [^a-z_0-9À-゚#\n\t\r] keyworda (G(R(OUP{s}BY|ANT(S)?)|E(NERAL|T_FORMAT|OMETRY(COLLECTION)?)|LOBAL)|B(Y(TE)?|TREE|I(GINT|N(LOG|ARY)|T)|O(TH|OL(EAN)?)|E(GIN|TWEEN|FORE)|LOB|ACKUP{s}TABLE)|H(IGH_PRIORITY|O(ST(S)?|UR(_(MI(NUTE|CROSECOND)|SECOND))?)|ELP|A(SH|NDLER|VING))|C(R(OSS|EATE)|H(ECK(SUM)?|A(R(SET|ACTER)?|NGE(D)?|IN))|IPHER|O(M(M(IT(TED)?|ENT)|P(RESSED|LETION|ACT))|N(S(TRAINT(_(SCHEMA|NAME|CATALOG))?|ISTENT)|NECTION|CURRENT|T(RIBUTORS|INUE|AINS)|DITION|VERT)|DE|L(UMN(S|_(NAME|FORMAT))?|LATE)|ALESCE{s}PARTITION)|U(R(RENT_(TIME(STAMP)?|DATE|USER)|SOR(_NAME)?)|BE)|L(IENT|OSE|ASS_ORIGIN)|A(S(CADE(D)?|E)|CHE{s}INDEX|TALOG_NAME|LL))|I(GNORE(_SERVER_IDS)?|MPORT{s}TABLESPACE|S(SUER|OLATION)?|N(S(TALL({s}PLUGIN)?|E(RT(_METHOD)?|NSITIVE))|N(O(BASE|DB)|ER)|T(1|2|8|3|O({s}(DUMP|OUT)FILE)?|4|E(RVAL|GER))?|ITIAL_SIZE|OUT|DEX(ES)?|VOKER|FILE)?|TERATE|O_THREAD|DENTIFIED|F)|D(ROP|YNAMIC|I(RECTORY|S(CARD{s}TABLESPACE|TINCT(ROW)?|K|ABLE{s}KEYS)|V)|O(UBLE)?|U(MPFILE|PLICATE|AL)|E(S(C(RIBE)?|_KEY_FILE)|C(IMAL|LARE)?|TERMINISTIC|F(INER|AULT)|L(ETE|AY(_KEY_WRITE|ED))|ALLOCATE)|A(Y(_(MI(NUTE|CROSECOND)|SECOND|HOUR))?|T(E(TIME)?|A(BASE(S)?|FILE)?)))|JOIN|E(RRORS|X(TEN(T_SIZE|DED)|I(STS|T)|P(LAIN|ANSION)|ECUTE)|SCAPE(D{s}BY)?|N(GINE(S)?|CLOSED{s}BY|D(S)?|UM|ABLE{s}KEYS)|VE(RY|NT)|LSE(IF)?|ACH)|K(ILL({s}(CONNECTION|QUERY))?|EY(S|_BLOCK_SIZE)?)|F(R(OM|AC_SECOND)|I(RST|XED|LE)|O(R(CE|EIGN)?|UND)|U(NCTION|LL(TEXT)?)|ETCH|L(OAT(8|4)?|USH)|A(ST|LSE))|A(G(GREGATE|AINST)|S(C(II)?|ENSITIVE)?|N(Y|D|ALYZE)|C(CESSIBLE|TION)|T|DD|UT(HORS|O(_INCREMENT|EXTEND_SIZE))|VG(_ROW_LENGTH)?|FTER|L(GORITHM|TER|L))) keywordl (R(TREE|IGHT|O(UTINE|W(S|_FORMAT)?|LL(BACK|UP))|E(GEXP|MOVE{s}PARTITIONING|BUILD{s}PARTITION|S(T(RICT|ORE{s}TABLE)|IGNAL|UME|ET)|NAME|COVER|TURN(S)?|ORGANIZE{s}PARTITION|D(O(_BUFFER_SIZE|FILE)|UNDANT)|P(EAT(ABLE)?|L(ICATION|ACE)|AIR)|VOKE|QUIRE|FERENCES|L(OAD|EASE|AY_(THREAD|LOG_(POS|FILE)))|A(D(S|_(ONLY|WRITE))?|L))|LIKE|ANGE)|M(YSQL_ERRNO|I(GRATE|N(_ROWS|UTE(_(MICROSECOND|SECOND))?)|CROSECOND|DDLEINT)|O(NTH|D(IF(Y|IES)|E)?)|U(TEX|LTI(PO(INT|LYGON)|LINESTRING))|E(RGE|MORY|SSAGE_TEXT|DIUM(BLOB|TEXT|INT)?)|A(X(_(ROWS|SIZE|CONNECTIONS_PER_HOUR|U(SER_CONNECTIONS|PDATES_PER_HOUR)|QUERIES_PER_HOUR)|VALUE)|STER(_(S(SL(_(C(IPHER|ERT|A(PATH)?)|VERIFY_SERVER_CERT|KEY))?|ERVER_ID)|H(OST|EARTBEAT_PERIOD)|CONNECT_RETRY|USER|P(ORT|ASSWORD)|LOG_(POS|FILE)))?|TCH))|N(CHAR|O(NE|_W(RITE_TO_BINLOG|AIT)|T|DEGROUP)?|DB(CLUSTER)?|U(MERIC|LL)|E(XT|W)|VARCHAR|A(ME(S)?|T(IONAL|URAL)))|O(R(DER{s}BY)?|N(({s}DUPLICATE{s}KEY{s}UPDATE)?|E(_SHOT)?|LINE)?|UT(ER|FILE)?|P(TI(MIZE|ON(S|ALLY)?)|EN)|FF(SET|LINE)|WNER|LD_PASSWORD)|P(R(I(MARY|VILEGES)|OCE(SS|DURE{s}(ANALYSE)?)|E(SERVE|CISION|PARE|V))|HASE|O(RT|INT|LYGON)|URGE|A(R(SER|TI(TION(S|ING)?|AL))|SSWORD|CK_KEYS))|QU(ICK|ERY|ARTER)|L(I(MIT|ST|NE(S(TRING)?|AR)|KE)|O(G(S|FILE({s}GROUP))|NG(BLOB|TEXT)?|C(K(S)?|AL(TIME(STAMP)?)?)|OP|W_PRIORITY|AD{s}(DATA|INDEX{s}INTO{s}CACHE|XML))|E(SS|VEL|FT|A(DING|VE(S)?))|A(ST|NGUAGE))) keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BINLOG|GRANTS|INNODB|P(RIVILEGES|ROFILE(S)?|ROCEDURE{s}CODE)|SLAVE{s}(HOSTS|STATUS)|TRIGGERS|VARIABLES|WARNINGS|(FULL{s})?PROCESSLIST|FIELDS|PLUGIN(S)?|STORAGE{s}ENGINES|TABLE{s}TYPES|CO(LUMNS|LLATION)|BINLOG{s}EVENTS))?|UTDOWN|ARE)|NAPSHOT|CHE(MA(S|_NAME)?|DULE(R)?)|T(R(ING|AIGHT_JOIN)|O(RAGE|P)|A(RT(S|ING{s}BY)?|TUS))|I(GN(ED|AL)|MPLE)|O(ME|NAME|CKET|UNDS)|U(B(CLASS_ORIGIN|JECT|PARTITION(S)?)|SPEND|PER)|P(ECIFIC|ATIAL)|E(R(IAL(IZABLE)?|VER)|SSION|NSITIVE|C(OND(_MICROSECOND)?|URITY)|T({s}(PASSWORD|NAMES|ONE_SHOT))?|PARATOR|LECT)|QL(STATE|_(MAX_JOIN_SIZE|B(IG_(RESULT|SELECTS|TABLES)|UFFER_RESULT)|S(MALL_RESULT|ELECT_LIMIT|LAVE_SKIP_COUNTER|AFE_UPDATES)|NO_CACHE|CA(CHE|LC_FOUND_ROWS)|T(SI_(M(INUTE|ONTH)|SECOND|HOUR|YEAR|DAY|QUARTER|FRAC_SECOND|WEEK)|HREAD)|QUOTE_SHOW_CREATE|WARNINGS|LO(G_(BIN|OFF|UPDATE)|W_PRIORITY_UPDATES)|AUTO_IS_NULL)|EXCEPTION|WARNING)?|L(OW|AVE)|AVEPOINT)|YEAR(_MONTH)?|T(R(IGGER(S)?|U(NCATE|E)|A(NSACTION|ILING))|H(EN|AN)|YPE|I(ME(STAMP(DIFF|ADD)?)?|NY(BLOB|TEXT|INT))|O|E(RMINATED{s}BY|XT|MP(TABLE|ORARY))|ABLE(S(PACE)?|_NAME)?)|ZEROFILL|U(S(ING|E(R(_RESOURCES)?|_FRM)?|AGE)|N(SIGNED|COMMITTED|TIL|I(NSTALL({s}PLUGIN)?|CODE|ON|QUE)|D(O(_BUFFER_SIZE|FILE)?|EFINED)|KNOWN|LOCK)|TC_(TIME(STAMP)?|DATE)|P(GRADE|DATE))|V(IEW|A(R(BINARY|YING|CHAR(ACTER)?|IABLES)|LUE(S)?))|W(R(ITE|APPER)|H(ILE|E(RE|N))|ITH({s}PARSER)?|ORK|EEK|A(RNINGS|IT))) @@ -115,7 +114,7 @@ keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BIN {word}+ { return SPT_WORD; } /* return any word */ -{nonword} { return SPT_OTHER; } /* return anything else */ +. { return SPT_OTHER; } /* return anything else */ -- cgit v1.2.3 From c25bb060a197deecc79dac86e24df8246a87db71 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 1 Feb 2015 18:36:22 +0100 Subject: Update lexer to reflect that backticks can actually escape themselves (won't cause visible changes) --- Source/SPEditorTokens.l | 2 +- Source/SPSQLTokenizer.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/SPEditorTokens.l b/Source/SPEditorTokens.l index 8a7c317b..e2d3099a 100644 --- a/Source/SPEditorTokens.l +++ b/Source/SPEditorTokens.l @@ -80,7 +80,7 @@ keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BIN \"([^"\\]|\\(.|[\n\r]))*\"? { return SPT_DOUBLE_QUOTED_TEXT; } /* double quoted strings */ '([^'\\]|\\(.|[\n\r]))*'? { return SPT_SINGLE_QUOTED_TEXT; } /* single quoted strings */ -`[^`]*`? { return SPT_BACKTICK_QUOTED_TEXT; } /* backtick quoted string */ +`(``|[^`])*`? { return SPT_BACKTICK_QUOTED_TEXT; } /* backtick quoted string */ "/*" { BEGIN(comment); return SPT_COMMENT; } /* beginning of a c style comment */ [^*]* { return SPT_COMMENT; } /* anything except * in a c cmnt */ diff --git a/Source/SPSQLTokenizer.l b/Source/SPSQLTokenizer.l index b9170edb..f33d373d 100644 --- a/Source/SPSQLTokenizer.l +++ b/Source/SPSQLTokenizer.l @@ -63,7 +63,7 @@ compend {s}"end" \"([^"\\]|\\(.|[\n\r]))*\"? { ; } '([^'\\]|\\(.|[\n\r]))*'? { ; } -`[^`]*`? { ; } +`(``|[^`])*`? { ; } "/*" { BEGIN(comment); } [^*]* { ; } -- cgit v1.2.3 From 60a5d64518f09af80059e2e293849ff6b0d6be75 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 1 Feb 2015 20:19:52 +0100 Subject: Change lexer definition of high bytes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flex does not(*) support UTF-8, therefore alpha [a-z_\.À-゚] has always been interpreted by flex as alpha [a-z_\.\xC3\x80-\xEF\xBE\x9F] I assume this is not what was indetend and the only reason it worked, is because C3 (195),BE (190) and 9F (159) are already covered by 80-EF (128-239). Incidentally this range would also cover the whole Unicode BMP in UTF8. This change should make it more obvious. (*) There were some patches in 2012 and 2014 but they don't seem to have been merged. --- Source/SPEditorTokens.l | 6 +++--- Source/SPSQLTokenizer.l | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SPEditorTokens.l b/Source/SPEditorTokens.l index e2d3099a..2ac99be8 100644 --- a/Source/SPEditorTokens.l +++ b/Source/SPEditorTokens.l @@ -56,11 +56,11 @@ size_t yyuoffset, yyuleng; %option case-insensitive s [ \t\n\r]+ -alpha [a-z_\.À-゚] +alpha [a-z_\.\x80-\xEF] numeric ([+-]?(([0-9]+\.[0-9]+)|([0-9]*\.[0-9]+)|([0-9]+))(e[+-]?[0-9]+)?) ops "+"|"-"|"*"|"/" -word [a-z_\.0-9À-゚@] -variable @{1,2}[a-z_\.0-9À-゚$]+ +word [a-z_\.0-9\x80-\xEF@] +variable @{1,2}[a-z_\.0-9\x80-\xEF$]+ keyworda (G(R(OUP{s}BY|ANT(S)?)|E(NERAL|T_FORMAT|OMETRY(COLLECTION)?)|LOBAL)|B(Y(TE)?|TREE|I(GINT|N(LOG|ARY)|T)|O(TH|OL(EAN)?)|E(GIN|TWEEN|FORE)|LOB|ACKUP{s}TABLE)|H(IGH_PRIORITY|O(ST(S)?|UR(_(MI(NUTE|CROSECOND)|SECOND))?)|ELP|A(SH|NDLER|VING))|C(R(OSS|EATE)|H(ECK(SUM)?|A(R(SET|ACTER)?|NGE(D)?|IN))|IPHER|O(M(M(IT(TED)?|ENT)|P(RESSED|LETION|ACT))|N(S(TRAINT(_(SCHEMA|NAME|CATALOG))?|ISTENT)|NECTION|CURRENT|T(RIBUTORS|INUE|AINS)|DITION|VERT)|DE|L(UMN(S|_(NAME|FORMAT))?|LATE)|ALESCE{s}PARTITION)|U(R(RENT_(TIME(STAMP)?|DATE|USER)|SOR(_NAME)?)|BE)|L(IENT|OSE|ASS_ORIGIN)|A(S(CADE(D)?|E)|CHE{s}INDEX|TALOG_NAME|LL))|I(GNORE(_SERVER_IDS)?|MPORT{s}TABLESPACE|S(SUER|OLATION)?|N(S(TALL({s}PLUGIN)?|E(RT(_METHOD)?|NSITIVE))|N(O(BASE|DB)|ER)|T(1|2|8|3|O({s}(DUMP|OUT)FILE)?|4|E(RVAL|GER))?|ITIAL_SIZE|OUT|DEX(ES)?|VOKER|FILE)?|TERATE|O_THREAD|DENTIFIED|F)|D(ROP|YNAMIC|I(RECTORY|S(CARD{s}TABLESPACE|TINCT(ROW)?|K|ABLE{s}KEYS)|V)|O(UBLE)?|U(MPFILE|PLICATE|AL)|E(S(C(RIBE)?|_KEY_FILE)|C(IMAL|LARE)?|TERMINISTIC|F(INER|AULT)|L(ETE|AY(_KEY_WRITE|ED))|ALLOCATE)|A(Y(_(MI(NUTE|CROSECOND)|SECOND|HOUR))?|T(E(TIME)?|A(BASE(S)?|FILE)?)))|JOIN|E(RRORS|X(TEN(T_SIZE|DED)|I(STS|T)|P(LAIN|ANSION)|ECUTE)|SCAPE(D{s}BY)?|N(GINE(S)?|CLOSED{s}BY|D(S)?|UM|ABLE{s}KEYS)|VE(RY|NT)|LSE(IF)?|ACH)|K(ILL({s}(CONNECTION|QUERY))?|EY(S|_BLOCK_SIZE)?)|F(R(OM|AC_SECOND)|I(RST|XED|LE)|O(R(CE|EIGN)?|UND)|U(NCTION|LL(TEXT)?)|ETCH|L(OAT(8|4)?|USH)|A(ST|LSE))|A(G(GREGATE|AINST)|S(C(II)?|ENSITIVE)?|N(Y|D|ALYZE)|C(CESSIBLE|TION)|T|DD|UT(HORS|O(_INCREMENT|EXTEND_SIZE))|VG(_ROW_LENGTH)?|FTER|L(GORITHM|TER|L))) keywordl (R(TREE|IGHT|O(UTINE|W(S|_FORMAT)?|LL(BACK|UP))|E(GEXP|MOVE{s}PARTITIONING|BUILD{s}PARTITION|S(T(RICT|ORE{s}TABLE)|IGNAL|UME|ET)|NAME|COVER|TURN(S)?|ORGANIZE{s}PARTITION|D(O(_BUFFER_SIZE|FILE)|UNDANT)|P(EAT(ABLE)?|L(ICATION|ACE)|AIR)|VOKE|QUIRE|FERENCES|L(OAD|EASE|AY_(THREAD|LOG_(POS|FILE)))|A(D(S|_(ONLY|WRITE))?|L))|LIKE|ANGE)|M(YSQL_ERRNO|I(GRATE|N(_ROWS|UTE(_(MICROSECOND|SECOND))?)|CROSECOND|DDLEINT)|O(NTH|D(IF(Y|IES)|E)?)|U(TEX|LTI(PO(INT|LYGON)|LINESTRING))|E(RGE|MORY|SSAGE_TEXT|DIUM(BLOB|TEXT|INT)?)|A(X(_(ROWS|SIZE|CONNECTIONS_PER_HOUR|U(SER_CONNECTIONS|PDATES_PER_HOUR)|QUERIES_PER_HOUR)|VALUE)|STER(_(S(SL(_(C(IPHER|ERT|A(PATH)?)|VERIFY_SERVER_CERT|KEY))?|ERVER_ID)|H(OST|EARTBEAT_PERIOD)|CONNECT_RETRY|USER|P(ORT|ASSWORD)|LOG_(POS|FILE)))?|TCH))|N(CHAR|O(NE|_W(RITE_TO_BINLOG|AIT)|T|DEGROUP)?|DB(CLUSTER)?|U(MERIC|LL)|E(XT|W)|VARCHAR|A(ME(S)?|T(IONAL|URAL)))|O(R(DER{s}BY)?|N(({s}DUPLICATE{s}KEY{s}UPDATE)?|E(_SHOT)?|LINE)?|UT(ER|FILE)?|P(TI(MIZE|ON(S|ALLY)?)|EN)|FF(SET|LINE)|WNER|LD_PASSWORD)|P(R(I(MARY|VILEGES)|OCE(SS|DURE{s}(ANALYSE)?)|E(SERVE|CISION|PARE|V))|HASE|O(RT|INT|LYGON)|URGE|A(R(SER|TI(TION(S|ING)?|AL))|SSWORD|CK_KEYS))|QU(ICK|ERY|ARTER)|L(I(MIT|ST|NE(S(TRING)?|AR)|KE)|O(G(S|FILE({s}GROUP))|NG(BLOB|TEXT)?|C(K(S)?|AL(TIME(STAMP)?)?)|OP|W_PRIORITY|AD{s}(DATA|INDEX{s}INTO{s}CACHE|XML))|E(SS|VEL|FT|A(DING|VE(S)?))|A(ST|NGUAGE))) keywords (X(OR|509|A)|S(MALLINT|SL|H(OW({s}(E(NGINE(S)?|RRORS)|M(ASTER|UTEX)|BINLOG|GRANTS|INNODB|P(RIVILEGES|ROFILE(S)?|ROCEDURE{s}CODE)|SLAVE{s}(HOSTS|STATUS)|TRIGGERS|VARIABLES|WARNINGS|(FULL{s})?PROCESSLIST|FIELDS|PLUGIN(S)?|STORAGE{s}ENGINES|TABLE{s}TYPES|CO(LUMNS|LLATION)|BINLOG{s}EVENTS))?|UTDOWN|ARE)|NAPSHOT|CHE(MA(S|_NAME)?|DULE(R)?)|T(R(ING|AIGHT_JOIN)|O(RAGE|P)|A(RT(S|ING{s}BY)?|TUS))|I(GN(ED|AL)|MPLE)|O(ME|NAME|CKET|UNDS)|U(B(CLASS_ORIGIN|JECT|PARTITION(S)?)|SPEND|PER)|P(ECIFIC|ATIAL)|E(R(IAL(IZABLE)?|VER)|SSION|NSITIVE|C(OND(_MICROSECOND)?|URITY)|T({s}(PASSWORD|NAMES|ONE_SHOT))?|PARATOR|LECT)|QL(STATE|_(MAX_JOIN_SIZE|B(IG_(RESULT|SELECTS|TABLES)|UFFER_RESULT)|S(MALL_RESULT|ELECT_LIMIT|LAVE_SKIP_COUNTER|AFE_UPDATES)|NO_CACHE|CA(CHE|LC_FOUND_ROWS)|T(SI_(M(INUTE|ONTH)|SECOND|HOUR|YEAR|DAY|QUARTER|FRAC_SECOND|WEEK)|HREAD)|QUOTE_SHOW_CREATE|WARNINGS|LO(G_(BIN|OFF|UPDATE)|W_PRIORITY_UPDATES)|AUTO_IS_NULL)|EXCEPTION|WARNING)?|L(OW|AVE)|AVEPOINT)|YEAR(_MONTH)?|T(R(IGGER(S)?|U(NCATE|E)|A(NSACTION|ILING))|H(EN|AN)|YPE|I(ME(STAMP(DIFF|ADD)?)?|NY(BLOB|TEXT|INT))|O|E(RMINATED{s}BY|XT|MP(TABLE|ORARY))|ABLE(S(PACE)?|_NAME)?)|ZEROFILL|U(S(ING|E(R(_RESOURCES)?|_FRM)?|AGE)|N(SIGNED|COMMITTED|TIL|I(NSTALL({s}PLUGIN)?|CODE|ON|QUE)|D(O(_BUFFER_SIZE|FILE)?|EFINED)|KNOWN|LOCK)|TC_(TIME(STAMP)?|DATE)|P(GRADE|DATE))|V(IEW|A(R(BINARY|YING|CHAR(ACTER)?|IABLES)|LUE(S)?))|W(R(ITE|APPER)|H(ILE|E(RE|N))|ITH({s}PARSER)?|ORK|EEK|A(RNINGS|IT))) diff --git a/Source/SPSQLTokenizer.l b/Source/SPSQLTokenizer.l index f33d373d..5b08f312 100644 --- a/Source/SPSQLTokenizer.l +++ b/Source/SPSQLTokenizer.l @@ -50,7 +50,7 @@ size_t yyuoffset, yyuleng; s [ \t\n\r] dkey "delimiter" scol ";" -dval [!-゚] +dval [!-\x7E\x80-\xEF] compstart "begin"{s} compend {s}"end" %x comment -- cgit v1.2.3 From 24fcf917473862ddabc2095447f3ec5c4e9081fd Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 1 Feb 2015 20:51:54 +0100 Subject: Rename utf8 and utf8mb4 * To reduce confusion (and create some, for those people not yet aware of the difference) I have renamed the utf8s to "UTF-8 Unicode BMP" resp. "UTF-8 Full Unicode" according to their supported character range. * Also *both* utf8 variants will now be at the top of the list when creating new tables/databases --- Interfaces/English.lproj/MainMenu.xib | 4 ++-- Interfaces/English.lproj/Preferences.xib | 4 ++-- Source/SPCharsetCollationHelper.m | 15 +++++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 73c3505d..22664443 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -1412,7 +1412,7 @@ - UTF-8 Unicode (utf8) + UTF-8 Unicode BMP (utf8) 1048576 2147483647 @@ -1422,7 +1422,7 @@ - 4-Byte UTF-8 Unicode (utf8mb4) + UTF-8 Full Unicode (utf8mb4) 1048576 2147483647 diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 590dde4e..4901f537 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -640,7 +640,7 @@ - UTF-8 Unicode (utf8) + UTF-8 Unicode BMP (utf8) 1048576 2147483647 @@ -652,7 +652,7 @@ - 4-Byte UTF-8 Unicode (utf8mb4) + UTF-8 Full Unicode (utf8mb4) 1048576 2147483647 diff --git a/Source/SPCharsetCollationHelper.m b/Source/SPCharsetCollationHelper.m index 14b0a987..378fb7cf 100644 --- a/Source/SPCharsetCollationHelper.m +++ b/Source/SPCharsetCollationHelper.m @@ -133,6 +133,8 @@ if (([encodings count] > 0) && [serverSupport supportsPost41CharacterSetHandling]) { + NSUInteger utf8encounters = 0; + for (NSDictionary *encoding in encodings) { NSString *charsetId = [encoding objectForKey:@"CHARACTER_SET_NAME"]; @@ -146,12 +148,9 @@ if(selectedCharset && [charsetId isEqualToString:selectedCharset]) selectedRef = menuItem; - // If the UTF8 entry has been encountered, promote it to the top of the list - if (promoteUTF8 && [charsetId isEqualToString:@"utf8"]) { - [[charsetButton menu] insertItem:[menuItem autorelease] atIndex:0]; - //only add a separator if there actually are more items other than utf8 (might not be true for mysql forks) - if([encodings count] > 1) - [[charsetButton menu] insertItem:[NSMenuItem separatorItem] atIndex:1]; + // If an UTF8 entry has been encountered, promote it to the top of the list + if (promoteUTF8 && [charsetId hasPrefix:@"utf8"]) { + [[charsetButton menu] insertItem:[menuItem autorelease] atIndex:(utf8encounters++)]; } else { [[charsetButton menu] addItem:[menuItem autorelease]]; @@ -159,6 +158,10 @@ } + //only add a separator if there actually are more items other than utf8 (might not be true for mysql forks) + if(utf8encounters && [encodings count] > utf8encounters) + [[charsetButton menu] insertItem:[NSMenuItem separatorItem] atIndex:utf8encounters]; + [charsetButton setEnabled:YES]; } -- cgit v1.2.3 From 19a1c9f81ec1ae6f5518babfb974ad7f01407b16 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 3 Feb 2015 23:01:42 +0100 Subject: Fix some minor compiler warnings --- Source/SPExportController+SharedPrivateAPI.h | 35 ++++++++++++++++++++++++++++ Source/SPExportController.m | 1 + Source/SPExportFileUtilities.m | 4 +--- Source/SPExportFilenameUtilities.m | 6 +++++ Source/SPExportInitializer.m | 6 +++++ Source/SPTablesList.m | 2 +- sequel-pro.xcodeproj/project.pbxproj | 2 ++ 7 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 Source/SPExportController+SharedPrivateAPI.h diff --git a/Source/SPExportController+SharedPrivateAPI.h b/Source/SPExportController+SharedPrivateAPI.h new file mode 100644 index 00000000..067c4645 --- /dev/null +++ b/Source/SPExportController+SharedPrivateAPI.h @@ -0,0 +1,35 @@ +// +// SPExportController+SharedPrivateAPI.h +// sequel-pro +// +// Created by Max Lohrmann on 03.02.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import "SPExportController.h" + +@interface SPExportController (SharedPrivateAPI) +- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; +@end diff --git a/Source/SPExportController.m b/Source/SPExportController.m index f650bab9..c13e4fc6 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -41,6 +41,7 @@ #import "SPDatabaseDocument.h" #import "SPThreadAdditions.h" #import "SPCustomQuery.h" +#import "SPExportController+SharedPrivateAPI.h" #import diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m index 778deb3e..0cecad91 100644 --- a/Source/SPExportFileUtilities.m +++ b/Source/SPExportFileUtilities.m @@ -36,6 +36,7 @@ #import "SPCustomQuery.h" #import "SPTableContent.h" #import "SPTableContentDelegate.h" +#import "SPExportController+SharedPrivateAPI.h" #import @@ -48,10 +49,7 @@ typedef enum SPExportErrorChoice; @interface SPExportController (SPExportFileUtilitiesPrivateAPI) - - (void)_reopenExportSheet; -- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; - @end @implementation SPExportController (SPExportFileUtilitiesPrivateAPI) diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m index b0070f31..df9d3a69 100644 --- a/Source/SPExportFilenameUtilities.m +++ b/Source/SPExportFilenameUtilities.m @@ -298,6 +298,12 @@ case SPDotExport: extension = @"dot"; break; + case SPPDFExport: + case SPHTMLExport: + case SPExcelExport: + default: + [NSException raise:NSInvalidArgumentException format:@"unsupported exportType=%lu",exportType]; + return nil; } if ([exportOutputCompressionFormatPopupButton indexOfSelectedItem] != SPNoCompression) { diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 26cdd0dc..7794d1e4 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -168,6 +168,12 @@ case SPDotExport: exportTypeLabel = @"Dot"; break; + case SPPDFExport: + case SPHTMLExport: + case SPExcelExport: + default: + [NSException raise:NSInvalidArgumentException format:@"unsupported exportType=%lu",exportType]; + return; } // Begin the export based on the source diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 76f6d1ce..74523da3 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -1275,7 +1275,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; { NSMutableArray *returnArray = [NSMutableArray array]; NSUInteger i; - NSInteger cnt = [[self tables] count]; + NSUInteger cnt = [[self tables] count]; for(i=0; i Date: Sun, 8 Feb 2015 04:40:59 +0100 Subject: Fix one case of "SSH input fields cut off" When the last selected favorite was "Quick Connect" with SSH, on the next launch SSH would be re-selected, but the fields other than SSH Host would be cut off. This was caused by a race condition between our window setup code and Cocoas window restoration code. Solved by disabling window restoration for now (didn't really work for us anyway). --- Source/SPWindowController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 0666f1a7..58afeb16 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -90,6 +90,12 @@ enum { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabDragStarted:) name:PSMTabDragDidBeginNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabDragStopped:) name:PSMTabDragDidEndNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateLineHidingViewState) name:SPWindowToolbarDidToggleNotification object:nil]; + + // Because we are a document-based app we automatically adopt window restoration on 10.7+. + // However that causes a race condition with our own window setup code. + // Remove this when we actually support restoration. + if([[self window] respondsToSelector:@selector(setRestorable:)]) + [[self window] setRestorable:NO]; } #pragma mark - -- cgit v1.2.3 From b00142a846ceda985516a0bdec3c1d6a9f47bdee Mon Sep 17 00:00:00 2001 From: "teng.liu" Date: Sun, 8 Feb 2015 18:18:35 +0800 Subject: fallback solution for NSString decode error --- .../Source/SPMySQLResult Categories/Data Conversion.m | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 357eb53f..0ed8a51e 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -239,6 +239,17 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt return returnString; } +static inline NSString * _convertStringDataSafely(const void *dataBytes, NSUInteger dataLength, NSStringEncoding aStringEncoding) +{ + NSString * result = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + + if (result == nil) { + return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; + } + + return result; +} + /** * Converts stored string data - which may contain nul bytes - to a native * Objective-C string, using the current class encoding. @@ -247,9 +258,9 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da { // Fast case - if not using a preview length, or if the data length is shorter, return the requested data. - if (previewLength == NSNotFound || dataLength <= previewLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; - } + if (previewLength == NSNotFound || dataLength <= previewLength) { + return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + } NSUInteger i = 0, characterLength = 0, byteLength = previewLength; uint16_t continuationStart, continuationEnd; @@ -394,7 +405,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // If returning the full string, use a fast path if (byteLength >= dataLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); } // Get a string using the calculated details -- cgit v1.2.3 From fa28b26e418f6f5c2f47ec78f9b7ef4910155b96 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 14 Feb 2015 21:45:08 +0100 Subject: Move some duplicate code into a new class (This also affects PSMSequelProTabStyle, but see the comment there why it is left unchanged) --- Source/SPFavoritesOutlineView.h | 5 +- Source/SPFavoritesOutlineView.m | 7 ++- Source/SPOSInfo.h | 50 +++++++++++++++++++ Source/SPOSInfo.m | 94 ++++++++++++++++++++++++++++++++++++ Source/SPSSHTunnel.m | 6 +-- Source/SPWindowController.h | 2 +- Source/SPWindowController.m | 7 +-- sequel-pro.xcodeproj/project.pbxproj | 6 +++ 8 files changed, 162 insertions(+), 15 deletions(-) create mode 100644 Source/SPOSInfo.h create mode 100644 Source/SPOSInfo.m diff --git a/Source/SPFavoritesOutlineView.h b/Source/SPFavoritesOutlineView.h index 8a671f3c..2c3d475c 100644 --- a/Source/SPFavoritesOutlineView.h +++ b/Source/SPFavoritesOutlineView.h @@ -28,10 +28,11 @@ // // More info at +#import "SPOSInfo.h" + @interface SPFavoritesOutlineView : NSOutlineView { - SInt32 systemVersion; - + BOOL isOSVersionAtLeast10_7_0; BOOL justGainedFocus; } diff --git a/Source/SPFavoritesOutlineView.m b/Source/SPFavoritesOutlineView.m index 01eb7b04..2e111925 100644 --- a/Source/SPFavoritesOutlineView.m +++ b/Source/SPFavoritesOutlineView.m @@ -39,8 +39,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; - (void)awakeFromNib { - systemVersion = 0; - Gestalt(gestaltSystemVersion, &systemVersion); + isOSVersionAtLeast10_7_0 = [SPOSInfo isOSVersionAtLeastMajor:10 minor:7 patch:0]; } - (BOOL)acceptsFirstResponder @@ -129,7 +128,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; NSRect superFrame = [super frameOfCellAtColumn:columnIndex row:rowIndex]; // On system versions lower than Lion, don't alter padding - if (systemVersion < 0x1070) { + if (!isOSVersionAtLeast10_7_0) { return superFrame; } @@ -159,7 +158,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; } // On versions of Lion or above, amend the padding appropriately - if (systemVersion >= 0x1070) { + if (isOSVersionAtLeast10_7_0) { return NSMakeRect(superFrame.origin.x + SPFavoritesOutlineViewUnindent, superFrame.origin.y, superFrame.size.width, superFrame.size.height); } diff --git a/Source/SPOSInfo.h b/Source/SPOSInfo.h new file mode 100644 index 00000000..8b5bb65b --- /dev/null +++ b/Source/SPOSInfo.h @@ -0,0 +1,50 @@ +// +// SPOSInfo.h +// sequel-pro +// +// Created by Max Lohrmann on 14.02.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import + +typedef struct { + NSInteger major; + NSInteger minor; + NSInteger patch; +} SPOSVersion; + +/** + * Compare two OS versions similar to strcmp() + * @param left One operand + * @param right The other operand + * @return A negative value if left < right, 0 is both are equal, a postive value if left > right + */ +int SPOSVersionCompare(SPOSVersion left, SPOSVersion right); + +@interface SPOSInfo : NSObject ++ (SPOSVersion)osVersion; ++ (BOOL)isOSVersionAtLeastMajor:(NSInteger)major minor:(NSInteger)minor patch:(NSInteger)patch; +@end diff --git a/Source/SPOSInfo.m b/Source/SPOSInfo.m new file mode 100644 index 00000000..5608e4cf --- /dev/null +++ b/Source/SPOSInfo.m @@ -0,0 +1,94 @@ +// +// SPOSInfo.m +// sequel-pro +// +// Created by Max Lohrmann on 14.02.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import "SPOSInfo.h" + +#if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10 +// This code is available since 10.8 but public only since 10.10 +typedef struct { + NSInteger major; + NSInteger minor; + NSInteger patch; +} NSOperatingSystemVersion; + +@interface NSProcessInfo () +- (NSOperatingSystemVersion)operatingSystemVersion; +- (BOOL)isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version; +@end + +#endif + +int SPOSVersionCompare(SPOSVersion left, SPOSVersion right) +{ + if(left.major != right.major) return (left.major < right.major)? -1 : 1; + if(left.minor != right.minor) return (left.minor < right.minor)? -1 : 1; + if(left.patch != right.patch) return (left.patch < right.patch)? -1 : 1; + return 0; +} + +@implementation SPOSInfo + ++ (SPOSVersion)osVersion +{ + NSProcessInfo *procInfo = [NSProcessInfo processInfo]; + if([procInfo respondsToSelector:@selector(operatingSystemVersion)]) { + NSOperatingSystemVersion nsVer = [procInfo operatingSystemVersion]; + //structs cannot be casted per C standard + SPOSVersion spVer = {nsVer.majorVersion,nsVer.minorVersion,nsVer.patchVersion}; + return spVer; + } + else { + SInt32 versionMajor = 0; + SInt32 versionMinor = 0; + SInt32 versionPatch = 0; + Gestalt(gestaltSystemVersionMajor, &versionMajor); + Gestalt(gestaltSystemVersionMinor, &versionMinor); + Gestalt(gestaltSystemVersionBugFix, &versionPatch); + + SPOSVersion spVer = {versionMajor,versionMinor,versionPatch}; + return spVer; + } +} + ++ (BOOL)isOSVersionAtLeastMajor:(NSInteger)major minor:(NSInteger)minor patch:(NSInteger)patch +{ + NSProcessInfo *procInfo = [NSProcessInfo processInfo]; + if([procInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]) { + NSOperatingSystemVersion nsVer = {major,minor,patch}; + return [procInfo isOperatingSystemAtLeastVersion:nsVer]; + } + else { + SPOSVersion runningVersion = [self osVersion]; + SPOSVersion referenceVersion = {major, minor, patch}; + return (SPOSVersionCompare(runningVersion, referenceVersion) >= 0); + } +} + +@end diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 3b58d331..e09d0ce2 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -35,6 +35,7 @@ #import "SPKeychain.h" #import "SPAlertSheets.h" #import "SPThreadAdditions.h" +#import "SPOSInfo.h" #import #import @@ -55,8 +56,7 @@ if (!theHost || !targetPort || !targetHost) return nil; if ((self = [super init])) { - SInt32 systemVersion = 0; - Gestalt(gestaltSystemVersion, &systemVersion); + BOOL isOSVersionAtLeast10_7_0 = [SPOSInfo isOSVersionAtLeastMajor:10 minor:7 patch:0]; // Store the connection settings as appropriate sshHost = [[NSString alloc] initWithString:theHost]; @@ -74,7 +74,7 @@ // Enable connection muxing on 10.7+, but only if a preference is enabled; this is because // muxing causes connection instability for a large number of users (see Issue #1457) - connectionMuxingEnabled = (systemVersion >= 0x1070) && [[NSUserDefaults standardUserDefaults] boolForKey:SPSSHEnableMuxingPreference]; + connectionMuxingEnabled = isOSVersionAtLeast10_7_0 && [[NSUserDefaults standardUserDefaults] boolForKey:SPSSHEnableMuxingPreference]; // Set up a connection for use by the tunnel process tunnelConnectionName = [[NSString alloc] initWithFormat:@"SequelPro-%lu", (unsigned long)[[NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]] hash]]; diff --git a/Source/SPWindowController.h b/Source/SPWindowController.h index 8697e738..c99a2ff2 100644 --- a/Source/SPWindowController.h +++ b/Source/SPWindowController.h @@ -37,7 +37,7 @@ IBOutlet NSTabView *tabView; NSClipView *titleBarLineHidingView; - SInt32 systemVersion; + BOOL isOSVersionAtLeast10_7_0; NSMenuItem *closeWindowMenuItem; NSMenuItem *closeTabMenuItem; diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 58afeb16..db94f5ce 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -63,11 +63,8 @@ enum { - (void)awakeFromNib { - systemVersion = 0; selectedTableDocument = nil; - Gestalt(gestaltSystemVersion, &systemVersion); - [[self window] setCollectionBehavior:[[self window] collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary]; // Add a line to the window to hide the line below the title bar when the toolbar is collapsed @@ -517,10 +514,10 @@ enum { { // Set the background colour to match the titlebar window state if ((([[self window] isMainWindow] || [[[self window] attachedSheet] isMainWindow]) && [NSApp isActive])) { - [titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(systemVersion >= 0x1070) ? 0.66f : 0.63f alpha:1.0]]; + [titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(isOSVersionAtLeast10_7_0) ? 0.66f : 0.63f alpha:1.0]]; } else { - [titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(systemVersion >= 0x1070) ? 0.87f : 0.84f alpha:1.0]]; + [titleBarLineHidingView setBackgroundColor:[NSColor colorWithCalibratedWhite:(isOSVersionAtLeast10_7_0) ? 0.87f : 0.84f alpha:1.0]]; } // If the window is fullscreen or the toolbar is showing, hide the view; otherwise show it diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 41e05352..86377750 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -188,6 +188,7 @@ 50D3C35D1A77217800B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; 50E217B618174280009D3580 /* SPFavoriteColorSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */; }; + 50EAB5B81A8FBB08008F627A /* SPOSInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; 580E8DB711EA774B000D8427 /* SequelProTabClose_Pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 580E8DAB11EA772C000D8427 /* SequelProTabClose_Pressed.png */; }; 580E8DB811EA774B000D8427 /* SequelProTabClose_Rollover.png in Resources */ = {isa = PBXBuildFile; fileRef = 580E8DAC11EA772C000D8427 /* SequelProTabClose_Rollover.png */; }; @@ -899,6 +900,8 @@ 50E217B218174246009D3580 /* SPColorSelectorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorSelectorView.m; sourceTree = ""; }; 50E217B418174280009D3580 /* SPFavoriteColorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFavoriteColorSupport.h; sourceTree = ""; }; 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFavoriteColorSupport.m; sourceTree = ""; }; + 50EAB5B61A8FBB08008F627A /* SPOSInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPOSInfo.h; sourceTree = ""; }; + 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPOSInfo.m; sourceTree = ""; }; 5806B76211A991EC00813A88 /* SPDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDocumentController.h; sourceTree = ""; }; 5806B76311A991EC00813A88 /* SPDocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDocumentController.m; sourceTree = ""; }; 580E8DAB11EA772C000D8427 /* SequelProTabClose_Pressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SequelProTabClose_Pressed.png; sourceTree = ""; }; @@ -2535,6 +2538,8 @@ 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */, 58DA8861103E15B5000B98DF /* SPLogger.h */, 58DA8862103E15B5000B98DF /* SPLogger.m */, + 50EAB5B61A8FBB08008F627A /* SPOSInfo.h */, + 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */, ); name = "Debugging & Support"; sourceTree = ""; @@ -3171,6 +3176,7 @@ BCA6271C1031B9D40047E5D5 /* SPTooltip.m in Sources */, 58DA8863103E15B5000B98DF /* SPLogger.m in Sources */, BC01BCCF104024BE006BDEE7 /* SPEncodingPopupAccessory.m in Sources */, + 50EAB5B81A8FBB08008F627A /* SPOSInfo.m in Sources */, 173C4366104455E0001F3A30 /* SPQueryFavoriteManager.m in Sources */, 173C44D81044A6B0001F3A30 /* SPOutlineView.m in Sources */, 17F5B1511048C4E400FC794F /* SPCSVExporter.m in Sources */, -- cgit v1.2.3 From 085b381858dcd3cda5c0b00527d3b7a77641345a Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 14 Feb 2015 23:05:52 +0100 Subject: Change look of the favorite color picker on 10.9+ --- Source/SPColorSelectorView.h | 2 + Source/SPColorSelectorView.m | 141 ++++++++++++++++++++++--------------------- 2 files changed, 75 insertions(+), 68 deletions(-) diff --git a/Source/SPColorSelectorView.h b/Source/SPColorSelectorView.h index b3d9325e..925034a3 100644 --- a/Source/SPColorSelectorView.h +++ b/Source/SPColorSelectorView.h @@ -57,6 +57,8 @@ IBOutlet id delegate; NSArray *colorList; + + BOOL isOSAtLeast10_9_0; } @property (nonatomic,readwrite,assign) NSInteger selectedTag; diff --git a/Source/SPColorSelectorView.m b/Source/SPColorSelectorView.m index f2eade86..ba577170 100644 --- a/Source/SPColorSelectorView.m +++ b/Source/SPColorSelectorView.m @@ -41,10 +41,13 @@ // More info at #import "SPColorSelectorView.h" +#import "SPOSInfo.h" @interface SPColorSelectorView (Private) - (void)setupTrackingAreas; +- (void)_drawDotBevelStyleWithGradient:(NSGradient *)gradient insideRect:(NSRect)colorSquareRect; +- (void)_drawDotFlatStyleWithColor:(NSColor *)color insideRect:(NSRect)colorSquareRect; @end @@ -86,6 +89,8 @@ enum trackingAreaIDs //set ourselves as observer of selectedTag (need to mark view dirty) [self addObserver:self forKeyPath:@"selectedTag" options:0 context:nil]; + + isOSAtLeast10_9_0 = [SPOSInfo isOSVersionAtLeastMajor:10 minor:9 patch:0]; } return self; @@ -126,9 +131,9 @@ enum trackingAreaIDs - (NSRect)rectForColorViewAtIndex:(NSInteger)index { CGFloat baseY = 2.0; - CGFloat baseX = 2.0; + CGFloat baseX = 3.0; - CGFloat marginR = 5.0; + CGFloat marginR = 7.0; CGFloat width = 16.0; CGFloat height = 16.0; @@ -138,46 +143,20 @@ enum trackingAreaIDs switch (index) { case kTrackingAreaNone: - returnRect = NSMakeRect(baseX, baseY, width, height); - break; - case kTrackingArea0: - returnRect = NSMakeRect(baseX + 1 * (width + marginR), baseY, width, height); - break; - case kTrackingArea1: - returnRect = NSMakeRect(baseX + 2 * (width + marginR), baseY, width, height); - break; - case kTrackingArea2: - returnRect = NSMakeRect(baseX + 3 * (width + marginR), baseY, width, height); - break; - case kTrackingArea3: - returnRect = NSMakeRect(baseX + 4 * (width + marginR), baseY, width, height); - break; - case kTrackingArea4: - returnRect = NSMakeRect(baseX + 5 * (width + marginR), baseY, width, height); - break; - case kTrackingArea5: - returnRect = NSMakeRect(baseX + 6 * (width + marginR), baseY, width, height); - break; - case kTrackingArea6: - returnRect = NSMakeRect(baseX + 7 * (width + marginR), baseY, width, height); + returnRect = NSMakeRect(baseX + (index + 1) * (width + marginR), baseY, width, height); break; } return returnRect; } -// ------------------------------------------------------------------------------- -// Returns the color gradient corresponding to the tag. These colours were -// chosen to appear similar to those in Aperture 3. -// ------------------------------------------------------------------------------- - - (NSGradient *)gradientForTag:(NSInteger)colorTag { NSGradient *gradient = nil; @@ -289,53 +268,79 @@ enum trackingAreaIDs [left setLineWidth:3.0]; [left setLineCapStyle:NSButtLineCapStyle]; - [left moveToPoint:NSMakePoint(colorSquareRect.origin.x + 4.0, colorSquareRect.origin.y + 4.0)]; + [left moveToPoint:NSMakePoint(colorSquareRect.origin.x + 4.0, colorSquareRect.origin.y + 4.0)]; [left lineToPoint:NSMakePoint(colorSquareRect.origin.x + 12.0, colorSquareRect.origin.y + 12.0)]; - [left moveToPoint:NSMakePoint(colorSquareRect.origin.x + 12.0, colorSquareRect.origin.y + 4.0)]; - [left lineToPoint:NSMakePoint(colorSquareRect.origin.x + 4.0, colorSquareRect.origin.y + 12.0)]; + [left moveToPoint:NSMakePoint(colorSquareRect.origin.x + 12.0, colorSquareRect.origin.y + 4.0)]; + [left lineToPoint:NSMakePoint(colorSquareRect.origin.x + 4.0, colorSquareRect.origin.y + 12.0)]; [left stroke]; } else { - // draw the gradient dot - NSGradient *gradient = [self gradientForTag:index]; - NSRect dotRect = NSInsetRect(colorSquareRect, 2.0, 2.0); - NSBezierPath *circlePath = [NSBezierPath bezierPathWithOvalInRect:dotRect]; - [gradient drawInBezierPath:circlePath angle:-90.0]; - - // draw a highlight - - // top edge outline - gradient = [[NSGradient alloc] initWithColorsAndLocations: - [NSColor colorWithCalibratedWhite:1.0 alpha:0.18], 0.0, - [NSColor colorWithCalibratedWhite:1.0 alpha:0.0], 0.6, nil]; - circlePath = [NSBezierPath bezierPathWithOvalInRect:NSInsetRect(dotRect, 1.0, 1.0)]; - [circlePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(dotRect.origin.x+1.0, dotRect.origin.y-2.0, dotRect.size.width-2.0, dotRect.size.height)]]; - [circlePath setWindingRule:NSEvenOddWindingRule]; - [gradient drawInBezierPath:circlePath angle:-90.0]; - [gradient release]; - - // top center gloss - gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.18] - endingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.0]]; - [gradient drawFromCenter:NSMakePoint(NSMidX(dotRect), NSMaxY(dotRect) - 2.0) - radius:0.0 - toCenter:NSMakePoint(NSMidX(dotRect), NSMaxY(dotRect) - 2.0) - radius:4.0 - options:0]; - [gradient release]; - - // draw a dark outline - circlePath = [NSBezierPath bezierPathWithOvalInRect:dotRect]; - gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.12] - endingColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.46]]; - [circlePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSInsetRect(dotRect, 1.0, 1.0)]]; - [circlePath setWindingRule:NSEvenOddWindingRule]; - [gradient drawInBezierPath:circlePath angle:-90.0]; - [gradient release]; + if(!isOSAtLeast10_9_0) { + NSGradient *gradient = [self gradientForTag:index]; + [self _drawDotBevelStyleWithGradient:gradient insideRect:colorSquareRect]; + } + else { + NSColor *baseColor = (NSColor *)[colorList objectAtIndex:index]; + [self _drawDotFlatStyleWithColor:baseColor insideRect:colorSquareRect]; + } } } } +- (void)_drawDotBevelStyleWithGradient:(NSGradient *)gradient insideRect:(NSRect)colorSquareRect +{ + // draw the gradient dot + NSRect dotRect = NSInsetRect(colorSquareRect, 2.0, 2.0); + NSBezierPath *circlePath = [NSBezierPath bezierPathWithOvalInRect:dotRect]; + [gradient drawInBezierPath:circlePath angle:-90.0]; + + // draw a highlight + + // top edge outline + NSGradient *grad = [[NSGradient alloc] initWithColorsAndLocations: + [NSColor colorWithCalibratedWhite:1.0 alpha:0.18], 0.0, + [NSColor colorWithCalibratedWhite:1.0 alpha:0.0], 0.6, nil]; + circlePath = [NSBezierPath bezierPathWithOvalInRect:NSInsetRect(dotRect, 1.0, 1.0)]; + [circlePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(dotRect.origin.x+1.0, dotRect.origin.y-2.0, dotRect.size.width-2.0, dotRect.size.height)]]; + [circlePath setWindingRule:NSEvenOddWindingRule]; + [grad drawInBezierPath:circlePath angle:-90.0]; + [grad release]; + + // top center gloss + NSGradient *grad2 = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.18] + endingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.0]]; + [grad2 drawFromCenter:NSMakePoint(NSMidX(dotRect), NSMaxY(dotRect) - 2.0) + radius:0.0 + toCenter:NSMakePoint(NSMidX(dotRect), NSMaxY(dotRect) - 2.0) + radius:4.0 + options:0]; + [grad2 release]; + + // draw a dark outline + circlePath = [NSBezierPath bezierPathWithOvalInRect:dotRect]; + NSGradient *grad3 = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.12] + endingColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.46]]; + [circlePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSInsetRect(dotRect, 1.0, 1.0)]]; + [circlePath setWindingRule:NSEvenOddWindingRule]; + [grad3 drawInBezierPath:circlePath angle:-90.0]; + [grad3 release]; +} + +- (void)_drawDotFlatStyleWithColor:(NSColor *)color insideRect:(NSRect)colorSquareRect +{ + CGFloat h,s,b,a; + [color getHue:&h saturation:&s brightness:&b alpha:&a]; + + NSRect dotRect = NSInsetRect(colorSquareRect, 2.0, 2.0); + NSBezierPath *circlePath = [NSBezierPath bezierPathWithOvalInRect:dotRect]; + [[NSColor colorWithCalibratedHue:h saturation:s*1.21 brightness:b*1.1 alpha:a] set]; + [circlePath fill]; + + [[color shadowWithLevel:0.15f] set]; + [circlePath setLineWidth:1.0f]; + [circlePath stroke]; +} + #pragma mark - #pragma mark Mouse Handling -- cgit v1.2.3 From baa1593d4bd84b2eebc41821d5ff2b70013371bf Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 15 Feb 2015 02:59:14 +0100 Subject: Add basic color highlighting in favorites list --- Source/SPConnectionControllerDelegate.m | 8 ++++++ Source/SPFavoriteTextFieldCell.h | 2 ++ Source/SPFavoriteTextFieldCell.m | 45 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index a28a27b7..8cef86e9 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -32,6 +32,7 @@ #ifndef SP_CODA #import "SPFavoritesController.h" #import "SPTableTextFieldCell.h" +#import "SPFavoriteTextFieldCell.h" #import "SPPreferenceController.h" #import "SPGeneralPreferencePane.h" #import "SPAppController.h" @@ -39,6 +40,7 @@ #import "SPGroupNode.h" #import "SPTreeNode.h" #import "SPFavoritesOutlineView.h" +#import "SPFavoriteColorSupport.h" #endif #ifndef SP_CODA @@ -171,6 +173,12 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; } else { [(SPTableTextFieldCell *)cell setImage:[NSImage imageNamed:SPDatabaseImage]]; + NSColor *bgColor = nil; + NSNumber *colorIndexObj = [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteColorIndexKey]; + if(colorIndexObj != nil) { + bgColor = [[SPFavoriteColorSupport sharedInstance] colorForIndex:[colorIndexObj integerValue]]; + } + [(SPFavoriteTextFieldCell *)cell setLabelColor:bgColor]; } } diff --git a/Source/SPFavoriteTextFieldCell.h b/Source/SPFavoriteTextFieldCell.h index afc32bcb..931d767d 100644 --- a/Source/SPFavoriteTextFieldCell.h +++ b/Source/SPFavoriteTextFieldCell.h @@ -38,4 +38,6 @@ - (BOOL)drawsDividerUnderCell; - (void)setDrawsDividerUnderCell:(BOOL)drawsDivider; +@property(copy)NSColor *labelColor; + @end diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m index 41511c8c..c5ec9150 100644 --- a/Source/SPFavoriteTextFieldCell.m +++ b/Source/SPFavoriteTextFieldCell.m @@ -29,6 +29,9 @@ // More info at #import "SPFavoriteTextFieldCell.h" +#import "SPOSInfo.h" + +extern BOOL isOSAtLeast10_10_0(void); @implementation SPFavoriteTextFieldCell @@ -46,6 +49,7 @@ SPFavoriteTextFieldCell *cell = (SPFavoriteTextFieldCell *)[super copyWithZone:zone]; cell->drawsDividerUnderCell = drawsDividerUnderCell; + cell->labelColor = nil; //TODO copying the color sometimes causes a drawing bug return cell; } @@ -68,8 +72,37 @@ drawsDividerUnderCell = drawsDivider; } +@synthesize labelColor; + #pragma mark - +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + if([self labelColor]) { + CGFloat round = (cellFrame.size.height/2); + NSBezierPath *bg = [NSBezierPath bezierPathWithRoundedRect:cellFrame xRadius:round yRadius:round]; + + if(isOSAtLeast10_10_0()) { + CGFloat h,s,b,a; + [[self labelColor] getHue:&h saturation:&s brightness:&b alpha:&a]; + + [[NSColor colorWithCalibratedHue:h saturation:s*1.21 brightness:b*1.1 alpha:a] set]; + [bg fill]; + } + else { + NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations: + [[self labelColor] highlightWithLevel:0.33], 0.0, + [self labelColor], 0.5, + [[self labelColor] shadowWithLevel:0.15], 1.0, nil]; + [gradient drawInBezierPath:bg angle:90.0]; + [gradient release]; + } + } + + [super drawWithFrame:cellFrame inView:controlView]; +} + + /** * Draws the actual cell, with a divider if appropriate. */ @@ -110,4 +143,16 @@ } } +- (void)dealloc +{ + [self setLabelColor:nil]; + + [super dealloc]; +} + @end + +BOOL isOSAtLeast10_10_0() { + const BOOL value = [SPOSInfo isOSVersionAtLeastMajor:10 minor:10 patch:0]; + return value; +} -- cgit v1.2.3 From 3fce6977d519fa80a96fcfa7baa476a3675a70da Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 15 Feb 2015 03:08:31 +0100 Subject: Fix compile error on older SDKs --- Source/SPOSInfo.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/SPOSInfo.m b/Source/SPOSInfo.m index 5608e4cf..8d91c067 100644 --- a/Source/SPOSInfo.m +++ b/Source/SPOSInfo.m @@ -33,9 +33,9 @@ #if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10 // This code is available since 10.8 but public only since 10.10 typedef struct { - NSInteger major; - NSInteger minor; - NSInteger patch; + NSInteger majorVersion; + NSInteger minorVersion; + NSInteger patchVersion; } NSOperatingSystemVersion; @interface NSProcessInfo () -- cgit v1.2.3 From 3d18994b788dc9563bba804e2eec56cd035bae09 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 15 Feb 2015 03:15:28 +0100 Subject: Fix compiler compatibility issue with older Xcode versions --- Source/SPFavoriteTextFieldCell.h | 1 + Source/SPFavoriteTextFieldCell.m | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/SPFavoriteTextFieldCell.h b/Source/SPFavoriteTextFieldCell.h index 931d767d..0e900636 100644 --- a/Source/SPFavoriteTextFieldCell.h +++ b/Source/SPFavoriteTextFieldCell.h @@ -33,6 +33,7 @@ @interface SPFavoriteTextFieldCell : ImageAndTextCell { BOOL drawsDividerUnderCell; + NSColor *labelColor; } - (BOOL)drawsDividerUnderCell; diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m index c5ec9150..00c05da1 100644 --- a/Source/SPFavoriteTextFieldCell.m +++ b/Source/SPFavoriteTextFieldCell.m @@ -78,22 +78,22 @@ extern BOOL isOSAtLeast10_10_0(void); - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { - if([self labelColor]) { + if(labelColor) { CGFloat round = (cellFrame.size.height/2); NSBezierPath *bg = [NSBezierPath bezierPathWithRoundedRect:cellFrame xRadius:round yRadius:round]; if(isOSAtLeast10_10_0()) { CGFloat h,s,b,a; - [[self labelColor] getHue:&h saturation:&s brightness:&b alpha:&a]; + [labelColor getHue:&h saturation:&s brightness:&b alpha:&a]; [[NSColor colorWithCalibratedHue:h saturation:s*1.21 brightness:b*1.1 alpha:a] set]; [bg fill]; } else { NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations: - [[self labelColor] highlightWithLevel:0.33], 0.0, - [self labelColor], 0.5, - [[self labelColor] shadowWithLevel:0.15], 1.0, nil]; + [labelColor highlightWithLevel:0.33], 0.0, + labelColor, 0.5, + [labelColor shadowWithLevel:0.15], 1.0, nil]; [gradient drawInBezierPath:bg angle:90.0]; [gradient release]; } -- cgit v1.2.3 From 2fda43e6a54c0c7532d80b9f3f86987ceb772342 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 15 Feb 2015 22:05:37 +0100 Subject: Refined the look of $(see last commit) on systems < 10.10 a bit --- Source/SPFavoriteTextFieldCell.m | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m index 00c05da1..cf9f6a05 100644 --- a/Source/SPFavoriteTextFieldCell.m +++ b/Source/SPFavoriteTextFieldCell.m @@ -90,12 +90,54 @@ extern BOOL isOSAtLeast10_10_0(void); [bg fill]; } else { + // Draw main background gradient NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations: [labelColor highlightWithLevel:0.33], 0.0, labelColor, 0.5, [labelColor shadowWithLevel:0.15], 1.0, nil]; [gradient drawInBezierPath:bg angle:90.0]; [gradient release]; + + //replace the shadow color of the highlighted item (the default is dark blue) + if([self isHighlighted]) { + NSMutableAttributedString *mas = [[self attributedStringValue] mutableCopy]; + NSShadow *strShadow = [mas attribute:NSShadowAttributeName atIndex:0 effectiveRange:NULL]; + if(strShadow) { + [strShadow setShadowColor:[labelColor shadowWithLevel:0.4]]; + [self setAttributedStringValue:mas]; + } + [mas release]; + } + + // Add a little border at the top half (technically this is an inner shadow) + CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; + + NSShadow* shadow = [[NSShadow alloc] init]; + [shadow setShadowColor:labelColor]; + [shadow setShadowOffset: NSMakeSize(0.1, -1.2)]; + [shadow setShadowBlurRadius: 1]; + + [NSGraphicsContext saveGraphicsState]; + NSRectClip([bg bounds]); + CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL); + + CGContextSetAlpha(context, [[shadow shadowColor] alphaComponent]); + CGContextBeginTransparencyLayer(context, NULL); + { + [shadow set]; + + CGContextSetBlendMode(context, kCGBlendModeSourceOut); + CGContextBeginTransparencyLayer(context, NULL); + + [[shadow shadowColor] setFill]; + [bg fill]; + + CGContextEndTransparencyLayer(context); + } + CGContextEndTransparencyLayer(context); + [NSGraphicsContext restoreGraphicsState]; + + [shadow release]; } } -- cgit v1.2.3 From b75d0c396376e0d82eabdfe971436ec1b97a61cf Mon Sep 17 00:00:00 2001 From: "teng.liu" Date: Mon, 16 Feb 2015 17:39:28 +0800 Subject: move the string method to SPMySQLStringAdditions --- .../Source/SPMySQLResult Categories/Data Conversion.m | 15 ++------------- .../SPMySQLFramework/Source/SPMySQLStringAdditions.h | 1 + .../SPMySQLFramework/Source/SPMySQLStringAdditions.m | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 0ed8a51e..639ff0b9 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -239,17 +239,6 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt return returnString; } -static inline NSString * _convertStringDataSafely(const void *dataBytes, NSUInteger dataLength, NSStringEncoding aStringEncoding) -{ - NSString * result = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; - - if (result == nil) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; - } - - return result; -} - /** * Converts stored string data - which may contain nul bytes - to a native * Objective-C string, using the current class encoding. @@ -259,7 +248,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // Fast case - if not using a preview length, or if the data length is shorter, return the requested data. if (previewLength == NSNotFound || dataLength <= previewLength) { - return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; } NSUInteger i = 0, characterLength = 0, byteLength = previewLength; @@ -405,7 +394,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // If returning the full string, use a fast path if (byteLength >= dataLength) { - return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; } // Get a string using the calculated details diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h index bb29c02b..60832c53 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h @@ -33,5 +33,6 @@ - (NSString *)mySQLBacktickQuotedString; - (NSString *)mySQLTickQuotedString; ++ (NSString *)stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding; @end diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m index 39688ea8..f987c98b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m @@ -52,4 +52,18 @@ return [NSString stringWithFormat: @"'%@'", [self stringByReplacingOccurrencesOfString:@"'" withString:@"''"]]; } +/** + * Returns the string for the bytes according to the encoding, decode in ASCII if failed + */ ++ (NSString *) stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding +{ + NSString * string = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + + if (string == nil) { + return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; + } + + return string; +} + @end -- cgit v1.2.3 From 5f3c003919903c597b2d6aeb7fcc064b0d6d9ef3 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 19 Feb 2015 18:11:59 +0100 Subject: Fix a bug that could cause items in the favorite list to be color-labeled when they don't have a label assigned --- Source/SPConnectionControllerDelegate.m | 19 +++++++++++-------- Source/SPFavoriteTextFieldCell.m | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 8cef86e9..f0813292 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -147,38 +147,41 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { - SPTreeNode *node = (SPTreeNode *)item; + SPTreeNode *node = (SPTreeNode *)item; + SPFavoriteTextFieldCell *favoriteCell = (SPFavoriteTextFieldCell *)cell; // Draw entries with the small system font by default - [(SPTableTextFieldCell *)cell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [cell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; // Set an image as appropriate; the quick connect image for that entry, no image for other // top-level items, the folder image for group nodes, or the database image for other nodes. if (![[node parentNode] parentNode]) { if (node == quickConnectItem) { if ([outlineView rowForItem:item] == [outlineView selectedRow]) { - [(SPTableTextFieldCell *)cell setImage:[NSImage imageNamed:SPQuickConnectImageWhite]]; + [favoriteCell setImage:[NSImage imageNamed:SPQuickConnectImageWhite]]; } else { - [(SPTableTextFieldCell *)cell setImage:[NSImage imageNamed:SPQuickConnectImage]]; + [favoriteCell setImage:[NSImage imageNamed:SPQuickConnectImage]]; } } else { - [(SPTableTextFieldCell *)cell setImage:nil]; + [favoriteCell setImage:nil]; } + [favoriteCell setLabelColor:nil]; } else { if ([node isGroup]) { - [(SPTableTextFieldCell *)cell setImage:folderImage]; + [favoriteCell setImage:folderImage]; + [favoriteCell setLabelColor:nil]; } else { - [(SPTableTextFieldCell *)cell setImage:[NSImage imageNamed:SPDatabaseImage]]; + [favoriteCell setImage:[NSImage imageNamed:SPDatabaseImage]]; NSColor *bgColor = nil; NSNumber *colorIndexObj = [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteColorIndexKey]; if(colorIndexObj != nil) { bgColor = [[SPFavoriteColorSupport sharedInstance] colorForIndex:[colorIndexObj integerValue]]; } - [(SPFavoriteTextFieldCell *)cell setLabelColor:bgColor]; + [favoriteCell setLabelColor:bgColor]; } } diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m index cf9f6a05..5eb6c103 100644 --- a/Source/SPFavoriteTextFieldCell.m +++ b/Source/SPFavoriteTextFieldCell.m @@ -49,7 +49,7 @@ extern BOOL isOSAtLeast10_10_0(void); SPFavoriteTextFieldCell *cell = (SPFavoriteTextFieldCell *)[super copyWithZone:zone]; cell->drawsDividerUnderCell = drawsDividerUnderCell; - cell->labelColor = nil; //TODO copying the color sometimes causes a drawing bug + cell->labelColor = [labelColor copyWithZone:zone]; return cell; } -- cgit v1.2.3 From 89fb7e74a72b44a59d15117d4a6a2a9913bee591 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 3 Mar 2015 21:08:20 +0100 Subject: Fix an issue with connection color and cloned connections The red (first) connection color would not be duplicated to another tab, when choosing "Open Table in New X" from the context menu (issue reported by Kyle via e-mail). --- Source/SPDatabaseDocument.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index a14a6f03..7f531f60 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4441,9 +4441,9 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; { BOOL returnConnection = [[detailsToReturn objectForKey:@"connection"] boolValue]; BOOL includePasswords = [[detailsToReturn objectForKey:@"password"] boolValue]; - BOOL returnSession = [[detailsToReturn objectForKey:@"session"] boolValue]; - BOOL returnHistory = [[detailsToReturn objectForKey:@"history"] boolValue]; - BOOL returnQuery = [[detailsToReturn objectForKey:@"query"] boolValue]; + BOOL returnSession = [[detailsToReturn objectForKey:@"session"] boolValue]; + BOOL returnHistory = [[detailsToReturn objectForKey:@"history"] boolValue]; + BOOL returnQuery = [[detailsToReturn objectForKey:@"query"] boolValue]; if (!returnConnection && !returnSession && !returnHistory && !returnQuery) return nil; NSMutableDictionary *stateDetails = [NSMutableDictionary dictionary]; @@ -4482,7 +4482,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [connection setObject:[self name] forKey:@"name"]; [connection setObject:[self host] forKey:@"host"]; [connection setObject:[self user] forKey:@"user"]; - if([connectionController colorIndex]) + if([connectionController colorIndex] >= 0) [connection setObject:[NSNumber numberWithInteger:[connectionController colorIndex]] forKey:SPFavoriteColorIndexKey]; if([connectionController port] && [[connectionController port] length]) [connection setObject:[NSNumber numberWithInteger:[[connectionController port] integerValue]] forKey:@"port"]; -- cgit v1.2.3 From ed38f229a052a678d3a5022afd3806b1c3b434cf Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 4 Mar 2015 01:44:12 +0100 Subject: !!! Update mysql client libs to 5.5.42 This enables SHA256 client certificates (issue #2071) and disables SSL2 and SSL3 connections. Please test carefully! --- .../MySQL Client Libraries/include/mysql_version.h | 11 ++++++----- .../MySQL Client Libraries/lib/libmysqlclient.a | Bin 7884800 -> 7917176 bytes 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h index 350e9f1c..7a8578ad 100644 --- a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h +++ b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h @@ -1,6 +1,7 @@ -/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB - Use is subject to license terms - This file is public domain and comes with NO WARRANTY of any kind */ +/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB + & Detron HB, 1996, 1999-2004, 2007 MySQL AB. + This file is public domain and comes with NO WARRANTY of any kind +*/ /* Version numbers for protocol & mysqld */ @@ -10,11 +11,11 @@ #include #else #define PROTOCOL_VERSION 10 -#define MYSQL_SERVER_VERSION "5.5.33" +#define MYSQL_SERVER_VERSION "5.5.42" #define MYSQL_BASE_VERSION "mysqld-5.5" #define MYSQL_SERVER_SUFFIX_DEF "" #define FRM_VER 6 -#define MYSQL_VERSION_ID 50533 +#define MYSQL_VERSION_ID 50542 #define MYSQL_PORT 3306 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a index aad3f2a3..aa0d6109 100644 Binary files a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a and b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a differ -- cgit v1.2.3 From e2a21022e4c6e61673a7014ccb29ba20a5378686 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 7 Mar 2015 15:40:26 +0800 Subject: Add copies of the nightly build scripts, albeit missing vital details and passwords --- Scripts/nightlybuildscript.sh | 161 +++++++++++++++++++++++++++++++++++ Scripts/nightlybuildupload.sh | 21 +++++ sequel-pro.xcodeproj/project.pbxproj | 6 +- 3 files changed, 187 insertions(+), 1 deletion(-) create mode 100755 Scripts/nightlybuildscript.sh create mode 100644 Scripts/nightlybuildupload.sh diff --git a/Scripts/nightlybuildscript.sh b/Scripts/nightlybuildscript.sh new file mode 100755 index 00000000..0655af44 --- /dev/null +++ b/Scripts/nightlybuildscript.sh @@ -0,0 +1,161 @@ +#!/bin/bash +# A script to update the Sequel Pro trunk located at a specified location, compile it, build onto a disk image, and upload to the nightlies server. +# This will be called by buildbot with the first parameter being the VCS revision. + +# Note that changes to this script will NOT update the nightly builder without manual deployment; +# this script is compiled to an encrypted binary on a builder VM. + +# Compiling this script with shc is quite straightforward - /usr/local/bin/shc -T -f , then move. + +# Hacky constants +GIT_DIR=/Users/spbuildbot/buildbot/sequel-pro-10_7/build/ +BUILD_DIR=/Users/spbuildbot/buildbot/sequel-pro-10_7/build/build/Release +PRIVATE_KEY_LOC='LOCATION NOT COMMITTED' +NIGHTLY_ICON_LOC=/Users/spbuildbot/Documents/nightly-icon.icns +NIGHTLY_KEYCHAIN_LOC=/Users/spbuildbot/Library/Keychains/spnightly.keychain +NIGHTLY_KEYCHAIN_PASSWORD='PASSWORD NOT COMMITTED' + +# Ensure a revision hash was passed in +REVISION_HASH=`echo "$1" | grep "\([0-9a-f]*\)"` +if [ "$REVISION_HASH" == "" ] +then + echo "Unable to extract revision hash from first argument; cancelling nightly build." >&2 + exit 1 +fi +SHORT_HASH=${REVISION_HASH:0:10} + +# Build a numeric revision for bundle version etc +svn2git_migration_compensation=480 +cd "$GIT_DIR" +NUMERIC_REVISION=$((`git log --oneline | wc -l` + $svn2git_migration_compensation)) + +echo "Starting nightly build for hash $SHORT_HASH ($REVISION_HASH), bundle version $NUMERIC_REVISION... " + +# Abort if the required paths do not exist +if [ ! -e "$PRIVATE_KEY_LOC" ] +then + echo "Unable to locate private key; cancelling nightly build." >&2 + exit 1 +fi +cd "$BUILD_DIR" +if [ `pwd` != "$BUILD_DIR" ] +then + echo "Unable to change to nightly build directory; cancelling build." >&2 + exit 1 +fi + +echo "Cleaning remains of any previous nightly builds..." + +# Delete any previous disk images and translation files +rm -f *.dmg &> /dev/null +rm -rf disttemp &> /dev/null +rm -f languagetranslations.zip &> /dev/null +rm -rf languagetranslations &> /dev/null + +echo "Downloading localizations to merge in..." + +# Download the latest language translations, and copy them into the Resources directory +curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip +unzip -q languagetranslations.zip -d languagetranslations +find languagetranslations/Resources \( -name "*.lproj" \) | while read FILE; do + printf "\tCopying localization: $(basename ${FILE})\n" + cp -R "$FILE" "Sequel Pro.app/Contents/Resources/" +done + +echo "Copying nightly icon" + +# Copy in the nightly icon +cp -f "$NIGHTLY_ICON_LOC" Sequel\ Pro.app/Contents/Resources/appicon.icns + +echo "Updating version strings" + +# Update some version strings and info, rather messily +php -r '$infoplistloc = "'$BUILD_DIR'/Sequel Pro.app/Contents/Info.plist"; + $infoplist = file_get_contents($infoplistloc); + $infoplist = preg_replace("/(\CFBundleShortVersionString\<\/key\>\s*\n?\r?\s*\)[^<]*(\<\/string\>)/i", "\\1Nightly build for revision '$SHORT_HASH'\\2", $infoplist); + $infoplist = preg_replace("/(\CFBundleVersion\<\/key\>\s*\n?\r?\s*)\[^<]*(\<\/string\>)/i", "\\1'$NUMERIC_REVISION'\\2", $infoplist); + $infoplist = preg_replace("/(\NSHumanReadableCopyright\<\/key\>\s*\n?\r?\s*\)[^<]*(\<\/string\>)/i", "\\1Nightly build for revision '$SHORT_HASH'\\2", $infoplist); + $infoplist = preg_replace("/(\SUFeedURL\<\/key\>\s*\n?\r?\s*\)[^<]*(\<\/string\>)/i", "\\1http://nightly.sequelpro.com/nightly-app-releases.php\\2", $infoplist); + file_put_contents($infoplistloc, $infoplist);' + +# Update versions in localised string files +php -r '$englishstringsloc = "/'$BUILD_DIR'/Sequel Pro.app/Contents/Resources/English.lproj/InfoPlist.strings"; + $englishstrings = file_get_contents($englishstringsloc); + $englishstrings = mb_convert_encoding($englishstrings, "UTF-8", "UTF-16"); + $englishstrings = preg_replace("/version [^\,\"]+/iu", "nightly build for r'$SHORT_HASH'", $englishstrings); + $englishstrings = mb_convert_encoding($englishstrings, "UTF-16", "UTF-8"); + file_put_contents($englishstringsloc, $englishstrings);' + +echo "Signing build..." + +# Code sign and verify the nightly +security unlock-keychain -p "$NIGHTLY_KEYCHAIN_PASSWORD" "$NIGHTLY_KEYCHAIN_LOC" +codesign -f --keychain "$NIGHTLY_KEYCHAIN_LOC" -s 'Developer ID Application: MJ Media' -r "../../Resources/sprequirement.bin" "Sequel Pro.app/Contents/Resources/SequelProTunnelAssistant" +codesign -f --keychain "$NIGHTLY_KEYCHAIN_LOC" -s 'Developer ID Application: MJ Media' -r "../../Resources/sprequirement.bin" "Sequel Pro.app" +security lock-keychain "$NIGHTLY_KEYCHAIN_LOC" +VERIFYERRORS=`codesign --verify "Sequel Pro.app" 2>&1` +VERIFYERRORS+=`codesign --verify "Sequel Pro.app/Contents/Resources/SequelProTunnelAssistant" 2>&1` +if [ "$VERIFYERRORS" != '' ] +then + echo "Signing verification threw an error: $VERIFYERRORS" >&2 + exit 1 +fi + +echo "Build signed and verified successfully" +echo "Building disk image..." + +# Build the disk image +mkdir disttemp +cp -R -p Sequel\ Pro.app disttemp +SetFile -a B disttemp/Sequel\ Pro.app +hdiutil create -fs HFS+ -volname "Sequel Pro Nightly (r"$SHORT_HASH")" -srcfolder disttemp disttemp.dmg +hdiutil convert disttemp.dmg -format UDBZ -o Sequel_Pro_r"$SHORT_HASH".dmg +rm -rf disttemp* + +# Make sure it was created +if [ ! -e "Sequel_Pro_r${SHORT_HASH}.dmg" ] +then + echo "Disk image was not built successfully!" >&2 + exit 1 +fi + +echo "Signing disk image" + +# Sign the disk image +SIGNATURE=`openssl dgst -sha1 -binary < "Sequel_Pro_r${SHORT_HASH}.dmg" | openssl dgst -dss1 -sign "$PRIVATE_KEY_LOC" | openssl enc -base64 | tr -d "\n"` + +echo "Disk image ready (hashed as $SIGNATURE)" +echo "Uploading disk image..." + +# Upload the disk image +scp -q -P 32100 Sequel_Pro_r"$SHORT_HASH".dmg spnightlyuploader@sequelpro.com:nightlybuilds +RETURNVALUE=$? +if [ $RETURNVALUE -eq 0 ] +then + echo "Successfully uploaded disk image" + ssh spnightlyuploader@sequelpro.com -p 32100 chmod 666 nightlybuilds/Sequel_Pro_r"$SHORT_HASH".dmg +fi + +# Clean up +echo "Cleaning up" +rm -f languagetranslations.zip &> /dev/null +rm -rf languagetranslations &> /dev/null + +# Check the upload status +if [ $RETURNVALUE -ne 0 ] +then + echo "Nightly upload failed" + exit 1 +fi + +# Use curl to post the signature to the server +echo "Informing nightly server about new build..." +BUILD_ACTIVATE_OUTPUT=`curl --silent -F "filename=Sequel_Pro_r${SHORT_HASH}.dmg" -F "build_hash=$SIGNATURE" -F "build_id=$NUMERIC_REVISION" -F "full_revision=$REVISION_HASH" http://sequelpro.com/nightly/build.php?action=hash-submit` +if [ "$BUILD_ACTIVATE_OUTPUT" != 'Successfully updated.' ] +then + echo "Unexpected status when informing nightly server about new build: " + echo "$BUILD_ACTIVATE_OUTPUT" + exit 1 +fi + +echo "Done!" \ No newline at end of file diff --git a/Scripts/nightlybuildupload.sh b/Scripts/nightlybuildupload.sh new file mode 100644 index 00000000..7bf8f875 --- /dev/null +++ b/Scripts/nightlybuildupload.sh @@ -0,0 +1,21 @@ +#!/usr/bin/expect + +# Note that changes to this script will NOT update the nightly builder without manual deployment + +# Quiet this script +log_user 0 + +# A script to upload the specified Sequel Pro build to the nightlies server, as another minor security hurdle. +# This will be called by the build script with the first parameter being the VCS revision, second passphrase + +# Ensure a revision number was passed in +set REVISION_NUMBER [lindex $argv 0] +set PASSPHRASE [lindex $argv 1] + +# Perform the upload +spawn scp -q -P 32100 /Users/spbuildbot/buildbot/sequel-pro/build/build/Release/Sequel_Pro_r${REVISION_NUMBER}.dmg sequelpro@sequelpro.com:public_html/nightly +expect "Enter passphrase for key '/Users/spbuildbot/.ssh/id_rsa': " +send "${PASSPHRASE}\r" +expect eof +catch wait result +exit [lindex $result 3] diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 86377750..8c3d5989 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -1017,6 +1017,8 @@ 589582141154F8F400EDCC28 /* SPMainThreadTrampoline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPMainThreadTrampoline.m; sourceTree = ""; }; 589ED05A11E0ACD100C1DCEA /* DMLocalizedNib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DMLocalizedNib.m; sourceTree = ""; }; 58A137CC123ED5E6000B1B75 /* titlebarlock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = titlebarlock.png; sourceTree = ""; }; + 58A2F3791AAAE1BE0018141B /* nightlybuildupload.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = nightlybuildupload.sh; sourceTree = ""; }; + 58A2F37B1AAAE1C80018141B /* nightlybuildscript.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = nightlybuildscript.sh; sourceTree = ""; }; 58A8A72411A0148400B95749 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainWindow.xib; sourceTree = ""; }; 58A8A78F11A036C000B95749 /* SPWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPWindowController.h; sourceTree = ""; }; 58A8A79011A036C000B95749 /* SPWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPWindowController.m; sourceTree = ""; }; @@ -1686,6 +1688,8 @@ 178934980F30CDA10097539A /* trim-application.sh */, 174A345112DA4ED000DB0ADE /* create-test-stubs.pl */, 588593F30F7AEC9500ED0E67 /* package-application.sh */, + 58A2F37B1AAAE1C80018141B /* nightlybuildscript.sh */, + 58A2F3791AAAE1BE0018141B /* nightlybuildupload.sh */, ); path = Scripts; sourceTree = ""; @@ -2654,7 +2658,7 @@ name = "Unit Tests"; productName = "Unit Tests"; productReference = 380F4ED90FC0B50500B0BFD7 /* Unit Tests.octest */; - productType = "com.apple.product-type.bundle"; + productType = "com.apple.product-type.bundle.ocunit-test"; }; 584754C1120A04560057631F /* Sequel Pro QLGenerator */ = { isa = PBXNativeTarget; -- cgit v1.2.3 From 96b765ffbcb6c7fda058fbe8028b2e128007134a Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 7 Mar 2015 20:48:55 +0100 Subject: Added an internal algorithm for fuzzy string matching * This works similar to a regex matching "abc" as /a.*b.*c/ (ie. all characters of $needle need to be contained in $haystack in the correct order but not neccesarily consecutive). Additionaly some unicode equivalencies are handled. * Changed a tiny helper function from ObjC to plain C --- Source/SPStringAdditions.h | 19 +++++++ Source/SPStringAdditions.m | 101 +++++++++++++++++++++++++++++++++---- UnitTests/SPStringAdditionsTests.h | 1 + UnitTests/SPStringAdditionsTests.m | 69 +++++++++++++++++++++++++ 4 files changed, 179 insertions(+), 11 deletions(-) diff --git a/Source/SPStringAdditions.h b/Source/SPStringAdditions.h index 3296326f..c6871e2a 100644 --- a/Source/SPStringAdditions.h +++ b/Source/SPStringAdditions.h @@ -81,4 +81,23 @@ static inline id NSMutableAttributedStringAttributeAtIndex(NSMutableAttributedSt - (CGFloat)levenshteinDistanceWithWord:(NSString *)stringB; +/** + * Checks if the string other is contained in self on a per-character basis. + * In regex-speak that would mean "abc" is matched as /a.*b.*c/ (not anchored). + * This is a SEARCH function, NOT a MATCHING function! + * Namely the following options will be applied when matching: + * NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch|NSDiacriticInsensitiveSearch + * Additionaly this method might match even when it should not. + * + * @param other String to match against self + * @param submatches Pass the pointer to a variable that will be set to an NSArray * + * of NSNumber *s of NSRanges. This will only be the case if + * the method also returns YES. The variable will not be modified + * otherwise. + * Pass NULL if you don't care for the ranges. + * The object will be set to autorelase. + * @return YES if self contains all characters from other in the order given in other + * @warning This method is NOT thread-safe (probably), NOT constant-time and DOES NOT check binary equivalence + */ +- (BOOL)nonConsecutivelySearchString:(NSString *)other matchingRanges:(NSArray **)submatches; @end diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index 29b4144d..0c623af7 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -31,11 +31,7 @@ #import "SPStringAdditions.h" #import "RegexKitLite.h" -@interface NSString (PrivateAPI) - -- (NSInteger)_smallestOf:(NSInteger)a andOf:(NSInteger)b andOf:(NSInteger)c; - -@end +static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c); @implementation NSString (SPStringAdditions) @@ -426,9 +422,9 @@ cost = ([stringA characterAtIndex:i - 1] == [stringB characterAtIndex:j - 1]) ? 0 : 1; d[j * n + i] = - [self _smallestOf:d[(j - 1) * n + i] + 1 - andOf:d[j * n + i - 1] + 1 - andOf:d[(j - 1) * n + i -1] + cost]; + _smallestOf(d[(j - 1) * n + i] + 1, + d[j * n + i - 1] + 1, + d[(j - 1) * n + i -1] + cost); } distance = d[n * m - 1]; @@ -468,10 +464,95 @@ } } +- (BOOL)nonConsecutivelySearchString:(NSString *)other matchingRanges:(NSArray **)submatches +{ + NSStringCompareOptions opts = NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch|NSWidthInsensitiveSearch; + BOOL recordMatches = (submatches != NULL); //for readability + NSRange selfRange = NSMakeRange(0, [self length]); + + //shortcut: * a longer string can never be contained in a shorter one. + // * nil can never match in a string. + // * an empty other can never match if self is non-empty + if(([other length] > [self length]) || (!other) || ([self length] && ![other length])) + return NO; + + //handle the simple case via the default algorithm + if ([self compare:other options:opts] == NSOrderedSame) { + if(recordMatches) { + *submatches = [NSArray arrayWithObject:[NSValue valueWithRange:selfRange]]; + } + return YES; + } + + // for now let's save the overhead of NSArray and NSValues + NSRange *tmpMatchStore = recordMatches? calloc([other length], sizeof(NSRange)) : NULL; + __block NSUInteger matchCount = 0; + __block NSRange searchRange = selfRange; + + //this looks a bit silly but is basically Apples approach to handling multibyte charsets + void (^it)(NSString *,NSRange,NSRange,BOOL *) = ^(NSString *substring,NSRange substringRange,NSRange enclosingRange,BOOL *stop) { + //look for the current character of other in the remaining part of self + NSRange found = [self rangeOfString:substring options:opts range:searchRange]; + if(found.location == NSNotFound) { + matchCount = 0; //reset match count to "no match" + *stop = YES; + return; + } + if(recordMatches) + tmpMatchStore[matchCount] = found; + matchCount++; + //move the next search past the current match + searchRange.location = found.location + found.length; + searchRange.length = [self length] - searchRange.location; + }; + + [other enumerateSubstringsInRange:NSMakeRange(0, [other length]) + options:NSStringEnumerationByComposedCharacterSequences + usingBlock:it]; + + if(matchCount && recordMatches) { + //we want to re-combine sub-matches that are actually consecutive + + //This algorithm uses a simple look-behind for merges: + // Object 1 checks if it continues object 0. If so, 1 and 0 will merge + // and be placed in the slot of 0 (slot 1 is now invalid). + // Then object 2 checks if it continues object 0. If it does not, it is + // placed in slot 1. + // Object 3 then checks if it continues object 1 and so on... + NSUInteger mergeTarget = 0; + for (NSUInteger i = 1; i < matchCount; i++ ) { + NSRange prev = tmpMatchStore[mergeTarget]; + NSRange this = tmpMatchStore[i]; + //if the previous match ends right before this match begins we can merge them + if(prev.location + prev.length == this.location) { + NSRange mergedRange = NSMakeRange(prev.location, prev.length+this.length); + tmpMatchStore[mergeTarget] = mergedRange; + } + //otherwise we have to move on to the next and make ourselves the new base + else { + if(++mergeTarget != i) + tmpMatchStore[mergeTarget] = this; + } + } + + NSMutableArray *combinedArray = [NSMutableArray arrayWithCapacity:mergeTarget+1]; + for (NSUInteger j = 0; j <= mergeTarget; j++) { + [combinedArray addObject:[NSValue valueWithRange:tmpMatchStore[j]]]; + } + + *submatches = combinedArray; + } + + free(tmpMatchStore); // free(NULL) is safe as per OS X man page + return (matchCount > 0); +} + +@end + /** * Returns the minimum of a, b and c. */ -- (NSInteger)_smallestOf:(NSInteger)a andOf:(NSInteger)b andOf:(NSInteger)c +static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c) { NSInteger min = a; @@ -481,5 +562,3 @@ return min; } - -@end diff --git a/UnitTests/SPStringAdditionsTests.h b/UnitTests/SPStringAdditionsTests.h index d6854dbe..56b5c6f9 100644 --- a/UnitTests/SPStringAdditionsTests.h +++ b/UnitTests/SPStringAdditionsTests.h @@ -35,5 +35,6 @@ - (void)testStringByRemovingCharactersInSet; - (void)testStringWithNewUUID; - (void)testCreateViewSyntaxPrettifier; +- (void)testNonConsecutivelySearchStringMatchingRanges; @end diff --git a/UnitTests/SPStringAdditionsTests.m b/UnitTests/SPStringAdditionsTests.m index af22df77..f455066f 100644 --- a/UnitTests/SPStringAdditionsTests.m +++ b/UnitTests/SPStringAdditionsTests.m @@ -86,4 +86,73 @@ STAssertEqualObjects([actualSyntax description], [expectedSyntax description], @"Actual view syntax '%@' does not equal expected syntax '%@'", actualSyntax, expectedSyntax); } +- (void)testNonConsecutivelySearchStringMatchingRanges +{ + //basic tests + { + NSArray *matches = nil; + STAssertTrue([@"" nonConsecutivelySearchString:@"" matchingRanges:&matches], @"Equality of empty strings"); + STAssertTrue(([matches count] == 1) && NSEqualRanges(NSMakeRange(0, 0), [(NSValue *)[matches objectAtIndex:0] rangeValue]), @"Returned matches in empty string"); + } + + { + NSArray *matches = (void *)0xdeadbeef; + STAssertFalse([@"" nonConsecutivelySearchString:@"R" matchingRanges:&matches], @"Inequality with empty left side"); + STAssertTrue((matches == (void *)0xdeadbeef), @"out variable not touched by mismatch"); + } + + STAssertFalse([@"L" nonConsecutivelySearchString:@"" matchingRanges:NULL], @"Inequality with empty right side"); + + { + NSArray *matches = nil; + STAssertTrue([@"left" nonConsecutivelySearchString:@"le" matchingRanges:&matches], @"Anchored match left"); + STAssertTrue(([matches count] == 1) && NSEqualRanges(NSMakeRange(0, 2), [(NSValue *)[matches objectAtIndex:0] rangeValue]), @"Returned matches in anchored left match"); + } + + { + NSArray *matches = nil; + STAssertTrue([@"right" nonConsecutivelySearchString:@"ht" matchingRanges:&matches], @"Anchored match right"); + STAssertTrue(([matches count] == 1) && NSEqualRanges(NSMakeRange(3, 2), [(NSValue *)[matches objectAtIndex:0] rangeValue]), @"Returned matches in anchroed right match"); + } + + STAssertFalse([@"ht" nonConsecutivelySearchString:@"right" matchingRanges:NULL], @"Left and Right are not commutative"); + + //real tests + { + NSArray *matches = nil; + STAssertTrue([@"... is not secure anymore!" nonConsecutivelySearchString:@"NSA" matchingRanges:&matches], @"Non-consecutive match, ignoring case"); + STAssertTrue(([matches count] == 3) && + (NSEqualRanges(NSMakeRange(7, 1), [(NSValue *)[matches objectAtIndex:0] rangeValue])) && + (NSEqualRanges(NSMakeRange(11, 1), [(NSValue *)[matches objectAtIndex:1] rangeValue])) && + (NSEqualRanges(NSMakeRange(18, 1), [(NSValue *)[matches objectAtIndex:2] rangeValue])), @"Returned matches in non-consecutive string"); + } + + STAssertFalse([@"Deoxyribonucleic Acid" nonConsecutivelySearchString:@"DNS" matchingRanges:NULL], @"Non-consecutive mismatch"); + + { + NSArray *matches = nil; + STAssertTrue([@"Turn left, then right at the corner" nonConsecutivelySearchString:@"left right" matchingRanges:&matches], @"Partly consecutive match"); + STAssertTrue(([matches count] == 3) && + (NSEqualRanges(NSMakeRange(5, 4), [(NSValue *)[matches objectAtIndex:0] rangeValue])) && + (NSEqualRanges(NSMakeRange(10, 1), [(NSValue *)[matches objectAtIndex:1] rangeValue])) && + (NSEqualRanges(NSMakeRange(16, 5), [(NSValue *)[matches objectAtIndex:2] rangeValue])), @"Returned matches in partly-consecutive string"); + } + + //advanced tests + + // LATIN CAPITAL LETTER A == LATIN SMALL LETTER A + // LATIN SMALL LETTER O WITH DIAERESIS == LATIN SMALL LETTER O + // FULLWIDTH LATIN SMALL LETTER b == LATIN SMALL LETTER B + STAssertTrue([@"A:\xC3\xB6:\xEF\xBD\x82" nonConsecutivelySearchString:@"aob" matchingRanges:NULL], @"Fuzzy matching of defined characters"); + + //all bytes on the right are contained on the left, but on a character level "ä" is not contained in "Hütte Ф" + STAssertFalse([@"H\xC3\xBCtte \xD0\xA4" nonConsecutivelySearchString:@"\xC3\xA4" matchingRanges:NULL], @"Mismatch of composed characters with same prefix"); + + // ":😥:𠘄:" vs "😄" (according to wikipedia "𠘄" is the arachic variant of "印") + // TECHNICALLY THIS SHOULD NOT MATCH! + // However Apple doesn't correctly handle characters in the 4-Byte UTF range, so let's use this test to check for changes in Apples behaviour :) + STAssertTrue([@":\xF0\x9F\x98\x84:\xF0\xA0\x98\x84:" nonConsecutivelySearchString:@"\xF0\x9F\x98\x84" matchingRanges:NULL], @"Mismatch of composed characters (4-byte) with same prefix"); + +} + @end -- cgit v1.2.3 From a9f5656e9649cf67bae7c6362bb5366f9dde3b44 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 7 Mar 2015 22:20:41 +0100 Subject: Fuzzy search for "Go to database" --- Source/SPGotoDatabaseController.m | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/SPGotoDatabaseController.m b/Source/SPGotoDatabaseController.m index 5e8a4fb2..23b43ee2 100644 --- a/Source/SPGotoDatabaseController.m +++ b/Source/SPGotoDatabaseController.m @@ -185,21 +185,27 @@ nil]; for (NSString *db in unfilteredList) { - // Let's just assume it is in the users interest (most of the time) for searches to be CI. - NSRange match = [db rangeOfString:filter options:NSCaseInsensitiveSearch]; - - if (match.location == NSNotFound) continue; - + + NSArray *matches = nil; + BOOL hasMatch = [db nonConsecutivelySearchString:filter matchingRanges:&matches]; + + if(!hasMatch) continue; + // Should we check for exact match AND have not yet found one? if (exactMatch && !*exactMatch) { - if (match.location == 0 && match.length == [db length]) { - *exactMatch = YES; + if([matches count] == 1) { + NSRange match = [(NSValue *)[matches objectAtIndex:0] rangeValue]; + if (match.location == 0 && match.length == [db length]) { + *exactMatch = YES; + } } } NSMutableAttributedString *attrMatch = [[NSMutableAttributedString alloc] initWithString:db]; - [attrMatch setAttributes:attrs range:match]; + for (NSValue *matchValue in matches) { + [attrMatch setAttributes:attrs range:[matchValue rangeValue]]; + } [filteredList addObject:[attrMatch autorelease]]; } -- cgit v1.2.3 From b15c7fb2d407ec8751a2579a7a68bbd8a037ccfe Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 8 Mar 2015 23:49:40 +0100 Subject: xibLocalizationPostprocessor changes * Can now also reverse the key replacement: Pass in an original IB strings file and a translated strings file in the DMLocalizedNib format and it will generate a translated IB strings file --- Source/xibLocalizationPostprocessor.m | 74 +++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/Source/xibLocalizationPostprocessor.m b/Source/xibLocalizationPostprocessor.m index ad2e152d..8efa545a 100644 --- a/Source/xibLocalizationPostprocessor.m +++ b/Source/xibLocalizationPostprocessor.m @@ -5,20 +5,37 @@ #import +NSDictionary *load_kv_pairs(NSString *input); int main(int argc, const char *argv[]) { NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init]; { - if (argc != 3) { - fprintf(stderr, "Usage: %s inputfile outputfile\n", argv[0]); + if (argc != 3 && argc != 4) { + fprintf(stderr, "Usage: xibLocalizationPostprocessor inputfile outputfile (Replace IB keys with their English string value)\n"); + fprintf(stderr, " xibLocalizationPostprocessor transfile inputfile outputfile (Reverse mode: Change English keys back to IB keys in translation)\n"); exit (-1); } + + NSUInteger inputFileIndex = 1; + NSDictionary *translatedStrings = nil; + if(argc == 4) { + NSError *error = nil; + NSStringEncoding usedEncoding; + NSString *translatedFile = [NSString stringWithContentsOfFile:[NSString stringWithUTF8String:argv[1]] usedEncoding:&usedEncoding error:&error]; + if (error) { + fprintf(stderr, "Error reading transfile %s: %s\n", argv[1], error.localizedDescription.UTF8String); + exit (-1); + } + translatedStrings = load_kv_pairs(translatedFile); + + inputFileIndex++; + } NSError *error = nil; NSStringEncoding usedEncoding; - NSString *rawXIBStrings = [NSString stringWithContentsOfFile:[NSString stringWithUTF8String:argv[1]] usedEncoding:&usedEncoding error:&error]; + NSString *rawXIBStrings = [NSString stringWithContentsOfFile:[NSString stringWithUTF8String:argv[inputFileIndex]] usedEncoding:&usedEncoding error:&error]; if (error) { - fprintf(stderr, "Error reading %s: %s\n", argv[1], error.localizedDescription.UTF8String); + fprintf(stderr, "Error reading inputfile %s: %s\n", argv[inputFileIndex], error.localizedDescription.UTF8String); exit (-1); } @@ -44,9 +61,20 @@ int main(int argc, const char *argv[]) [outputStrings appendString:lastComment]; [outputStrings appendString:@"\n"]; } - NSString *stringNeedingLocalization = [line substringFromIndex:NSMaxRange(quoteEqualsQuoteRange)]; // chop off leading: "blah" = " + NSString *stringNeedingLocalization = [line substringFromIndex:NSMaxRange(quoteEqualsQuoteRange)]; // chop off leading: "blah" = " stringNeedingLocalization = [stringNeedingLocalization substringToIndex:stringNeedingLocalization.length - 2]; // chop off trailing: "; - [outputStrings appendFormat:@"\"%@\" = \"%@\";\n\n", stringNeedingLocalization, stringNeedingLocalization]; + if(translatedStrings) { + NSString *translation = [translatedStrings objectForKey:stringNeedingLocalization]; + if(!translation) { + fprintf(stderr, "Warning: key \"%s\" not found in transfile.\n",[stringNeedingLocalization UTF8String]); + translation = stringNeedingLocalization; //fallback to untranslated + } + [outputStrings appendFormat:@"%@\" = \"%@\";\n\n", [line substringToIndex:quoteEqualsQuoteRange.location], translation]; + } + else { + [outputStrings appendFormat:@"\"%@\" = \"%@\";\n\n", stringNeedingLocalization, stringNeedingLocalization]; + } + continue; } } @@ -54,9 +82,39 @@ int main(int argc, const char *argv[]) NSLog(@"Warning: skipped garbage input line %lu, contents: \"%@\"", (unsigned long)lineCount, line); } - if (outputStrings.length && ![outputStrings writeToFile:[NSString stringWithUTF8String:argv[2]] atomically:NO encoding:usedEncoding error:&error]) { - fprintf(stderr, "Error writing %s: %s\n", argv[2], error.localizedDescription.UTF8String); + if (outputStrings.length && ![outputStrings writeToFile:[NSString stringWithUTF8String:argv[inputFileIndex+1]] atomically:NO encoding:usedEncoding error:&error]) { + fprintf(stderr, "Error writing %s: %s\n", argv[inputFileIndex+1], error.localizedDescription.UTF8String); exit (-1); } } [autoreleasePool release]; } + +NSDictionary *load_kv_pairs(NSString *input) +{ + NSDictionary *result = [NSMutableDictionary dictionary]; + __block NSUInteger lineCount = 0; + [input enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + lineCount++; + + if (line.length == 0 || [line hasPrefix:@"/*"]) { + return; + } + + if ([line hasPrefix:@"\""] && [line hasSuffix:@"\";"]) { // eg: "136.title" = "Quit Library"; + + NSRange quoteEqualsQuoteRange = [line rangeOfString:@"\" = \""]; + if (quoteEqualsQuoteRange.length && NSMaxRange(quoteEqualsQuoteRange) < line.length - 1) { + NSRange keyRange = NSMakeRange(1,quoteEqualsQuoteRange.location - 1); //the first " is always at pos. 0 (we checked that above) + NSString *key = [line substringWithRange:keyRange]; + NSString *value = [line substringFromIndex:NSMaxRange(quoteEqualsQuoteRange)]; // chop off leading: "blah" = " + value = [value substringToIndex:[value length] - 2]; // chop off trailing: "; + [result setValue:value forKey:key]; + return; + } + } + + NSLog(@"Warning: skipped garbage trans line %lu, contents: \"%@\"", (unsigned long)lineCount, line); + + }]; + return result; +} -- cgit v1.2.3 From 784876380b871b6d85978a705e2477e7b7d2d984 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 9 Mar 2015 00:00:43 +0100 Subject: Minimal refactoring Replaced some (range.location + range.length) with NSMaxRange(range) --- .../SPMySQLFramework/Source/SPMySQLStreamingResultStore.m | 8 ++++---- Source/SPCustomQuery.m | 2 +- Source/SPDataStorage.m | 6 +++--- Source/SPNarrowDownCompletion.m | 2 +- Source/SPQueryFavoriteManager.m | 4 ++-- Source/SPStringAdditions.m | 10 +++++----- Source/SPTableData.m | 2 +- Source/SPTableStructure.m | 2 +- Source/SPTextView.m | 4 ++-- Source/SPTextViewAdditions.m | 10 +++++----- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m index 447cf19b..86a6b2b5 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m @@ -630,8 +630,8 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult { // Throw an exception if the range is out of bounds - if (rangeToRemove.location + rangeToRemove.length > numberOfRows) { - [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(rangeToRemove.location + rangeToRemove.length), (unsigned long long)numberOfRows]; + if (NSMaxRange(rangeToRemove) > numberOfRows) { + [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(NSMaxRange(rangeToRemove)), (unsigned long long)numberOfRows]; } // Lock the data mutex @@ -639,14 +639,14 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult // Free rows in the range NSUInteger i; - for (i = rangeToRemove.location; i < rangeToRemove.location + rangeToRemove.length; i++) { + for (i = rangeToRemove.location; i < NSMaxRange(rangeToRemove); i++) { SPMySQLStreamingResultStoreFreeRowData(dataStorage[i]); } numberOfRows -= rangeToRemove.length; // Renumber all subsequent indices to fill the gap size_t pointerSize = sizeof(SPMySQLStreamingResultStoreRowData *); - memmove(dataStorage + rangeToRemove.location, dataStorage + rangeToRemove.location + rangeToRemove.length, (numberOfRows - rangeToRemove.location) * pointerSize); + memmove(dataStorage + rangeToRemove.location, dataStorage + NSMaxRange(rangeToRemove), (numberOfRows - rangeToRemove.location) * pointerSize); // Unlock the mutex pthread_mutex_unlock(&dataLock); diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 8b3897fe..70ff07ff 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3152,7 +3152,7 @@ aRange = NSMakeRange(0,0); NSInteger safeCnt = 0; // safety counter - not more than 200 loops allowed while(1){ - aRange = [desc rangeOfRegex:@"\\s((https?|ftp|file)://.*?html)" options:RKLNoOptions inRange:NSMakeRange(aRange.location+aRange.length, [desc length]-aRange.location-aRange.length) capture:1 error:&err1]; + aRange = [desc rangeOfRegex:@"\\s((https?|ftp|file)://.*?html)" options:RKLNoOptions inRange:NSMakeRange(NSMaxRange(aRange), [desc length]-aRange.location-aRange.length) capture:1 error:&err1]; if(aRange.location != NSNotFound) { aUrl = [desc substringWithRange:aRange]; [desc replaceCharactersInRange:aRange withString:[NSString stringWithFormat:@"%@", aUrl, aUrl]]; diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m index 3db04159..dd5e87a5 100644 --- a/Source/SPDataStorage.m +++ b/Source/SPDataStorage.m @@ -357,12 +357,12 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore { // Throw an exception if the range is out of bounds - if (rangeToRemove.location + rangeToRemove.length > SPMySQLResultStoreGetRowCount(dataStorage)) { - [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(rangeToRemove.location + rangeToRemove.length), SPMySQLResultStoreGetRowCount(dataStorage)]; + if (NSMaxRange(rangeToRemove) > SPMySQLResultStoreGetRowCount(dataStorage)) { + [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(NSMaxRange(rangeToRemove)), SPMySQLResultStoreGetRowCount(dataStorage)]; } // Remove the rows from the edited list and underlying storage - NSUInteger i = MIN(editedRowCount, rangeToRemove.location + rangeToRemove.length); + NSUInteger i = MIN(editedRowCount, NSMaxRange(rangeToRemove)); while (--i >= rangeToRemove.location) { editedRowCount--; [editedRows removePointerAtIndex:i]; diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index d5391644..b9dba0e4 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -1025,7 +1025,7 @@ if (scanPosition + attributeResultRange.length == currentLength) break; // A match was found - retrieve the location - NSUInteger matchStart = attributeResultRange.location+attributeResultRange.length; + NSUInteger matchStart = NSMaxRange(attributeResultRange); if ([[theView textStorage] attribute:kSPAutoCompletePlaceholderName atIndex:matchStart longestEffectiveRange:&attributeResultRange inRange:NSMakeRange(matchStart, currentLength - matchStart)]) { [theView shouldChangeTextInRange:attributeResultRange replacementString:@""]; [[theView textStorage] deleteCharactersInRange:attributeResultRange]; diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 6522b884..a715bd93 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -413,7 +413,7 @@ // Check whether the selection range lies within the snippet if (selRange.location != NSNotFound && selRange.location > matchedRange.location + 1 - && selRange.location + selRange.length < matchedRange.location + matchedRange.length) + && NSMaxRange(selRange) < NSMaxRange(matchedRange)) { selectionInsideSnippet = YES; } @@ -423,7 +423,7 @@ NSInteger snippetNumber = [[queryString substringWithRange:snippetNumberRange] integerValue]; [snippetNumbers setObject:@YES forKey:[NSNumber numberWithInteger:snippetNumber]]; - rangeStart = matchedRange.location + matchedRange.length; + rangeStart = NSMaxRange(matchedRange); } // If the selection is not inside a snippet, wrap it inside the snippet syntax. diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index 0c623af7..0254dc36 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -322,7 +322,7 @@ static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c); NSMutableArray *lineRangesArray = [NSMutableArray array]; // Check that the range supplied is valid - if not return an empty array. - if (aRange.location == NSNotFound || aRange.location + aRange.length > [self length]) { + if (aRange.location == NSNotFound || NSMaxRange(aRange) > [self length]) { return lineRangesArray; } @@ -332,9 +332,9 @@ static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c); [lineRangesArray addObject:NSStringFromRange(currentLineRange)]; // Loop through until the line end matches or surpasses the end of the specified range - while (currentLineRange.location + currentLineRange.length < aRange.location + aRange.length) + while (NSMaxRange(currentLineRange) < NSMaxRange(aRange)) { - currentLineRange = [self lineRangeForRange:NSMakeRange(currentLineRange.location + currentLineRange.length, 0)]; + currentLineRange = [self lineRangeForRange:NSMakeRange(NSMaxRange(currentLineRange), 0)]; [lineRangesArray addObject:NSStringFromRange(currentLineRange)]; } @@ -502,7 +502,7 @@ static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c); tmpMatchStore[matchCount] = found; matchCount++; //move the next search past the current match - searchRange.location = found.location + found.length; + searchRange.location = NSMaxRange(found); searchRange.length = [self length] - searchRange.location; }; @@ -524,7 +524,7 @@ static NSInteger _smallestOf(NSInteger a, NSInteger b, NSInteger c); NSRange prev = tmpMatchStore[mergeTarget]; NSRange this = tmpMatchStore[i]; //if the previous match ends right before this match begins we can merge them - if(prev.location + prev.length == this.location) { + if(NSMaxRange(prev) == this.location) { NSRange mergedRange = NSMakeRange(prev.location, prev.length+this.length); tmpMatchStore[mergeTarget] = mergedRange; } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 320a0b66..bdd1f1db 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -780,7 +780,7 @@ charsetDefinitionRange = [createTableParser rangeOfString:@"CHARACTER SET=" options:NSCaseInsensitiveSearch]; } if (charsetDefinitionRange.location != NSNotFound) { - stringStart = charsetDefinitionRange.location + charsetDefinitionRange.length; + stringStart = NSMaxRange(charsetDefinitionRange); for (i = stringStart; i < [createTableParser length]; i++) { if ([createTableParser characterAtIndex:i] == ' ') break; } diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 32739eb3..992ecdcf 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -912,7 +912,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; // UNSIGNED keyword. NSRange range = [queryString rangeOfString:[NSString stringWithFormat:@"%@ %@", [[theRow objectForKey:@"name"] backtickQuotedString], theRowType] options:NSLiteralSearch]; - NSInteger insertionIndex = (range.location + range.length); + NSInteger insertionIndex = NSMaxRange(range); // If the field definition's data type includes the length then we must take this into // account when inserting the UNSIGNED keyword. Add 2 to the index to accommodate the diff --git a/Source/SPTextView.m b/Source/SPTextView.m index f50ed939..12d6ed13 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -772,8 +772,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS backtickMode+=1; leftBacktick = YES; } - if([[self string] length] > parseRange.location+parseRange.length) { - if([[self string] characterAtIndex:parseRange.location+parseRange.length] == '`') { + if([[self string] length] > NSMaxRange(parseRange)) { + if([[self string] characterAtIndex:NSMaxRange(parseRange)] == '`') { backtickMode+=2; parseRange.length++; // adjust parse string for right ` rightBacktick = YES; diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 7272de1d..56103a53 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -247,7 +247,7 @@ // if no selection place the caret at the end of the current word { NSRange newRange = [self getRangeForCurrentWord]; - [self setSelectedRange:NSMakeRange(newRange.location + newRange.length, 0)]; + [self setSelectedRange:NSMakeRange(NSMaxRange(newRange), 0)]; } } @@ -269,7 +269,7 @@ // if no selection place the caret at the end of the current word { NSRange newRange = [self getRangeForCurrentWord]; - [self setSelectedRange:NSMakeRange(newRange.location + newRange.length, 0)]; + [self setSelectedRange:NSMakeRange(NSMaxRange(newRange), 0)]; } } @@ -291,7 +291,7 @@ // if no selection place the caret at the end of the current word { NSRange newRange = [self getRangeForCurrentWord]; - [self setSelectedRange:NSMakeRange(newRange.location + newRange.length, 0)]; + [self setSelectedRange:NSMakeRange(NSMaxRange(newRange), 0)]; } } @@ -312,7 +312,7 @@ // if no selection place the caret at the end of the current word { NSRange newRange = [self getRangeForCurrentWord]; - [self setSelectedRange:NSMakeRange(newRange.location + newRange.length, 0)]; + [self setSelectedRange:NSMakeRange(NSMaxRange(newRange), 0)]; } } @@ -335,7 +335,7 @@ // if no selection place the caret at the end of the current word { NSRange newRange = [self getRangeForCurrentWord]; - [self setSelectedRange:NSMakeRange(newRange.location + newRange.length, 0)]; + [self setSelectedRange:NSMakeRange(NSMaxRange(newRange), 0)]; } } -- cgit v1.2.3 From 8b1ff9c9b8a996ff0c6321e58709c25f0c5763c1 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 9 Mar 2015 21:28:28 +0100 Subject: Update nightly build script for temporary translation workaround, improve xibLocalizationPostprocessor robustness --- Scripts/nightlybuildscript.sh | 34 +++++++++++++++++++++++++++++++--- Source/xibLocalizationPostprocessor.m | 16 +++++++++------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/Scripts/nightlybuildscript.sh b/Scripts/nightlybuildscript.sh index 0655af44..ca312f64 100755 --- a/Scripts/nightlybuildscript.sh +++ b/Scripts/nightlybuildscript.sh @@ -44,6 +44,9 @@ then exit 1 fi +IBSTRINGSDIR=ibstrings +XIB_BASE="$GIT_DIR/Interfaces/English.lproj" + echo "Cleaning remains of any previous nightly builds..." # Delete any previous disk images and translation files @@ -51,15 +54,40 @@ rm -f *.dmg &> /dev/null rm -rf disttemp &> /dev/null rm -f languagetranslations.zip &> /dev/null rm -rf languagetranslations &> /dev/null +rm -rf $IBSTRINGSDIR &> /dev/null -echo "Downloading localizations to merge in..." +echo "Creating IB strings files for rekeying..." +mkdir -p $IBSTRINGSDIR/English.lproj +find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do + printf "\t$(basename ${FILE})\n" + ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings" +done +echo "Downloading localizations to merge in..." # Download the latest language translations, and copy them into the Resources directory curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip unzip -q languagetranslations.zip -d languagetranslations + +echo "Rekeying localization files, translating xibs, merging localizations..." find languagetranslations/Resources \( -name "*.lproj" \) | while read FILE; do - printf "\tCopying localization: $(basename ${FILE})\n" - cp -R "$FILE" "Sequel Pro.app/Contents/Resources/" + loc=`basename "$FILE"` + mkdir "$IBSTRINGSDIR/$loc" + printf "\tRekeying localization: $loc\n" + find "$FILE" \( -name "*.strings" \) | while read STRFILE; do + file=`basename "$STRFILE" .strings` + printf "\t\tFile: $file\n" + ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings" + xibfile="$XIB_BASE/$file.xib" + transfile="$IBSTRINGSDIR/$loc/$file.strings" + if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then + $BUILD_DIR/xibLocalizationPostprocessor "$STRFILE" "$ibkeyfile" "$transfile" + #we no longer need the original file and don't want to copy it + rm -f "$STRFILE" + ibtool "$xibfile" --import-strings-file "$transfile" --compile "languagetranslations/Resources/$loc/$file.nib" + fi + done + printf "\tCopying localization: $loc\n" + cp -R "$FILE" "Sequel Pro.app/Contents/Resources/" done echo "Copying nightly icon" diff --git a/Source/xibLocalizationPostprocessor.m b/Source/xibLocalizationPostprocessor.m index 8efa545a..1806d6b2 100644 --- a/Source/xibLocalizationPostprocessor.m +++ b/Source/xibLocalizationPostprocessor.m @@ -92,29 +92,31 @@ int main(int argc, const char *argv[]) NSDictionary *load_kv_pairs(NSString *input) { NSDictionary *result = [NSMutableDictionary dictionary]; - __block NSUInteger lineCount = 0; - [input enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { + + NSUInteger lineCount = 0; + //don't try [NSString enumerateLines...] here. It supports some obscure Unicode line breaks! + for (NSString *line in [input componentsSeparatedByString:@"\n"]) { lineCount++; if (line.length == 0 || [line hasPrefix:@"/*"]) { - return; + continue; } if ([line hasPrefix:@"\""] && [line hasSuffix:@"\";"]) { // eg: "136.title" = "Quit Library"; NSRange quoteEqualsQuoteRange = [line rangeOfString:@"\" = \""]; - if (quoteEqualsQuoteRange.length && NSMaxRange(quoteEqualsQuoteRange) < line.length - 1) { + if (quoteEqualsQuoteRange.location != NSNotFound && quoteEqualsQuoteRange.length && NSMaxRange(quoteEqualsQuoteRange) < line.length - 1) { NSRange keyRange = NSMakeRange(1,quoteEqualsQuoteRange.location - 1); //the first " is always at pos. 0 (we checked that above) NSString *key = [line substringWithRange:keyRange]; NSString *value = [line substringFromIndex:NSMaxRange(quoteEqualsQuoteRange)]; // chop off leading: "blah" = " value = [value substringToIndex:[value length] - 2]; // chop off trailing: "; [result setValue:value forKey:key]; - return; + continue; } } NSLog(@"Warning: skipped garbage trans line %lu, contents: \"%@\"", (unsigned long)lineCount, line); - - }]; + } + return result; } -- cgit v1.2.3 From 8cc66aa348870e6cdf086500515848b07ea5aa06 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 12 Mar 2015 02:17:31 +0100 Subject: Fix Sequel Pro forgetting database charset when renaming or copying a database (#2082) (While we're at it, also removed some duplicate CREATE DATABASE code) --- Source/SPDatabaseAction.h | 27 +++++++++++++++++++++++ Source/SPDatabaseAction.m | 45 ++++++++++++++++++++++++++++++++++++++ Source/SPDatabaseCopy.h | 16 ++++---------- Source/SPDatabaseCopy.m | 34 ++++++++++------------------- Source/SPDatabaseDocument.h | 2 ++ Source/SPDatabaseDocument.m | 38 +++++++++++++++++--------------- Source/SPDatabaseRename.h | 8 +++---- Source/SPDatabaseRename.m | 53 ++++++++++++++++----------------------------- 8 files changed, 132 insertions(+), 91 deletions(-) diff --git a/Source/SPDatabaseAction.h b/Source/SPDatabaseAction.h index 00de9065..52af621f 100644 --- a/Source/SPDatabaseAction.h +++ b/Source/SPDatabaseAction.h @@ -31,6 +31,14 @@ @class SPTablesList; @class SPMySQLConnection; +@interface SPCreateDatabaseInfo : NSObject + +@property (readwrite,retain) NSString *databaseName; +@property (readwrite,retain) NSString *defaultEncoding; +@property (readwrite,retain) NSString *defaultCollation; + +@end + @interface SPDatabaseAction : NSObject { NSWindow *messageWindow; @@ -53,4 +61,23 @@ */ @property (readwrite, assign) SPTablesList *tablesList; +/** + * This method creates a new database. + * + * @param dbInfo database name/charset/collation (charset, collation may be nil) + * @return success + * @see createDatabase:withEncoding:collation: + */ +- (BOOL)createDatabase:(SPCreateDatabaseInfo *)dbInfo; + +/** + * This method creates a new database. + * + * @param database name of the new database to be created + * @param encoding charset of the new database (can be nil to skip) + * @param collation sorting collation of the new database (can be nil. Will be ignored if encoding == nil) + * @return YES on success, otherwise NO + */ +- (BOOL)createDatabase:(NSString *)database withEncoding:(NSString *)encoding collation:(NSString *)collation; + @end diff --git a/Source/SPDatabaseAction.m b/Source/SPDatabaseAction.m index 998aff95..f5ed8b60 100644 --- a/Source/SPDatabaseAction.m +++ b/Source/SPDatabaseAction.m @@ -30,10 +30,55 @@ #import "SPDatabaseAction.h" +#import + +@implementation SPCreateDatabaseInfo + +@synthesize databaseName; +@synthesize defaultEncoding; +@synthesize defaultCollation; + +- (void)dealloc +{ + [self setDatabaseName:nil]; + [self setDefaultEncoding:nil]; + [self setDefaultCollation:nil]; + [super dealloc]; +} + +@end + +#pragma mark - + @implementation SPDatabaseAction @synthesize connection; @synthesize messageWindow; @synthesize tablesList; +- (BOOL)createDatabase:(SPCreateDatabaseInfo *)dbInfo +{ + return [self createDatabase:[dbInfo databaseName] + withEncoding:[dbInfo defaultEncoding] + collation:[dbInfo defaultCollation]]; +} + +- (BOOL)createDatabase:(NSString *)database withEncoding:(NSString *)encoding collation:(NSString *)collation +{ + NSParameterAssert(database != nil && [database length] > 0); + + NSMutableString *query = [NSMutableString stringWithFormat:@"CREATE DATABASE %@", [database backtickQuotedString]]; + + if([encoding length]) { // [nil length] == 0 + [query appendFormat:@" DEFAULT CHARACTER SET = %@",[encoding backtickQuotedString]]; + if([collation length]) { + [query appendFormat:@" DEFAULT COLLATE = %@",[collation backtickQuotedString]]; + } + } + + [connection queryString:query]; + + return ![connection queryErrored]; +} + @end diff --git a/Source/SPDatabaseCopy.h b/Source/SPDatabaseCopy.h index 081378e2..3adf7fa0 100644 --- a/Source/SPDatabaseCopy.h +++ b/Source/SPDatabaseCopy.h @@ -38,18 +38,10 @@ /** * This method clones an existing database. * - * @param NSString sourceDatabaseName the name of the source database - * @param NSString targetDatabaseName the name of the target database - * @result BOOL success + * @param sourceDatabase information tuple about source database + * @param targetDatabaseName the name of the target database + * @result success */ -- (BOOL)copyDatabaseFrom:(NSString *)sourceDatabaseName to:(NSString *)targetDatabaseName withContent:(BOOL)copyWithContent; - -/** - * This method creates a new database. - * - * @param NSString newDatabaseName name of the new database to be created - * @return BOOL YES on success, otherwise NO - */ -- (BOOL)createDatabase:(NSString *)newDatabaseName; +- (BOOL)copyDatabaseFrom:(SPCreateDatabaseInfo *)sourceDatabase to:(NSString *)targetDatabaseName withContent:(BOOL)copyWithContent; @end diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m index 5ea0a2d5..94a5e896 100644 --- a/Source/SPDatabaseCopy.m +++ b/Source/SPDatabaseCopy.m @@ -35,46 +35,34 @@ @implementation SPDatabaseCopy -- (BOOL)copyDatabaseFrom:(NSString *)sourceDatabaseName to:(NSString *)targetDatabaseName withContent:(BOOL)copyWithContent +- (BOOL)copyDatabaseFrom:(SPCreateDatabaseInfo *)sourceDatabase to:(NSString *)targetDatabaseName withContent:(BOOL)copyWithContent { NSArray *tables = nil; // Check whether the source database exists and the target database doesn't. - BOOL sourceExists = [[connection databases] containsObject:sourceDatabaseName]; + BOOL sourceExists = [[connection databases] containsObject:[sourceDatabase databaseName]]; BOOL targetExists = [[connection databases] containsObject:targetDatabaseName]; - if (sourceExists && !targetExists) { - - // Retrieve the list of tables/views/funcs/triggers from the source database - tables = [connection tablesFromDatabase:sourceDatabaseName]; - } - else { + if (!sourceExists || targetExists) return NO; - } - + + // Retrieve the list of tables/views/funcs/triggers from the source database + tables = [connection tablesFromDatabase:[sourceDatabase databaseName]]; + // Abort if database creation failed - if (![self createDatabase:targetDatabaseName]) return NO; + if (![self createDatabase:targetDatabaseName + withEncoding:[sourceDatabase defaultEncoding] + collation:[sourceDatabase defaultCollation]]) return NO; SPTableCopy *dbActionTableCopy = [[SPTableCopy alloc] init]; [dbActionTableCopy setConnection:connection]; - BOOL success = [dbActionTableCopy copyTables:tables from:sourceDatabaseName to:targetDatabaseName withContent:copyWithContent]; + BOOL success = [dbActionTableCopy copyTables:tables from:[sourceDatabase databaseName] to:targetDatabaseName withContent:copyWithContent]; [dbActionTableCopy release]; return success; } -- (BOOL)createDatabase:(NSString *)newDatabaseName -{ - NSString *createStatement = [NSString stringWithFormat:@"CREATE DATABASE %@", [newDatabaseName backtickQuotedString]]; - - [connection queryString:createStatement]; - - if ([connection queryErrored]) return NO; - - return YES; -} - @end diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index 0cd485b9..23b22d4a 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -56,6 +56,7 @@ @class SPMySQLConnection; @class SPCharsetCollationHelper; @class SPGotoDatabaseController; +@class SPCreateDatabaseInfo; #import "SPDatabaseContentViewDelegate.h" #import "SPConnectionControllerDelegateProtocol.h" @@ -451,6 +452,7 @@ #endif - (NSArray *)allTableNames; - (SPTablesList *)tablesListInstance; +- (SPCreateDatabaseInfo *)createDatabaseInfo; #ifndef SP_CODA /* method decls */ // Notification center methods diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 7f531f60..506e78f6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2769,6 +2769,17 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return tablesListInstance; } +- (SPCreateDatabaseInfo *)createDatabaseInfo +{ + SPCreateDatabaseInfo *dbInfo = [[SPCreateDatabaseInfo alloc] init]; + + [dbInfo setDatabaseName:[self database]]; + [dbInfo setDefaultEncoding:[databaseDataInstance getDatabaseDefaultCharacterSet]]; + [dbInfo setDefaultCollation:[databaseDataInstance getDatabaseDefaultCollation]]; + + return [dbInfo autorelease]; +} + #pragma mark - #pragma mark Notification center methods @@ -5903,7 +5914,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; BOOL copyWithContent = [copyDatabaseDataButton state] == NSOnState; - if ([dbActionCopy copyDatabaseFrom:[self database] to:[databaseCopyNameField stringValue] withContent:copyWithContent]) { + if ([dbActionCopy copyDatabaseFrom:[self createDatabaseInfo] to:[databaseCopyNameField stringValue] withContent:copyWithContent]) { [self selectDatabase:[databaseCopyNameField stringValue] item:nil]; } else { @@ -5934,7 +5945,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [dbActionRename setConnection:[self getConnection]]; [dbActionRename setMessageWindow:parentWindow]; - if ([dbActionRename renameDatabaseFrom:[self database] to:newDatabaseName]) { + if ([dbActionRename renameDatabaseFrom:[self createDatabaseInfo] to:newDatabaseName]) { [self setDatabases:self]; [self selectDatabase:newDatabaseName item:nil]; } @@ -5974,25 +5985,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // As we're amending identifiers, ensure UTF8 if (![[mySQLConnection encoding] isEqualToString:@"utf8"]) [mySQLConnection setEncoding:@"utf8"]; - NSString *createStatement = [NSString stringWithFormat:@"CREATE DATABASE %@", [[databaseNameField stringValue] backtickQuotedString]]; - - // If there is an encoding selected other than the default we must specify it in CREATE DATABASE statement - NSString *encodingName = [addDatabaseCharsetHelper selectedCharset]; - if (encodingName) - createStatement = [NSString stringWithFormat:@"%@ DEFAULT CHARACTER SET %@", createStatement, [encodingName backtickQuotedString]]; + SPDatabaseAction *dbAction = [[SPDatabaseAction alloc] init]; + [dbAction setConnection:mySQLConnection]; + BOOL res = [dbAction createDatabase:[databaseNameField stringValue] + withEncoding:[addDatabaseCharsetHelper selectedCharset] + collation:[addDatabaseCharsetHelper selectedCollation]]; + [dbAction release]; - // If there is a collation selected other than the default we must specify it in the CREATE DATABASE statement - NSString *collationName = [addDatabaseCharsetHelper selectedCollation]; - if (collationName) - createStatement = [NSString stringWithFormat:@"%@ DEFAULT COLLATE %@", createStatement, [collationName backtickQuotedString]]; - - // Create the database - [mySQLConnection queryString:createStatement]; - - if ([mySQLConnection queryErrored]) { + if (!res) { // An error occurred SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Couldn't create database.\nMySQL said: %@", @"message of panel when creation of db failed"), [mySQLConnection lastErrorMessage]]); - return; } diff --git a/Source/SPDatabaseRename.h b/Source/SPDatabaseRename.h index 2f9cb4db..becf460e 100644 --- a/Source/SPDatabaseRename.h +++ b/Source/SPDatabaseRename.h @@ -38,10 +38,10 @@ /** * This method renames an existing database. * - * @param NSString sourceDatabaseName the name of the source database - * @param NSString targetDatabaseName the name of the target database - * @result BOOL success + * @param sourceDatabase information tuple about the source database + * @param targetDatabase the name of the target database + * @result success */ -- (BOOL)renameDatabaseFrom:(NSString *)sourceDatabase to:(NSString *)targetDatabase; +- (BOOL)renameDatabaseFrom:(SPCreateDatabaseInfo *)sourceDatabase to:(NSString *)targetDatabase; @end diff --git a/Source/SPDatabaseRename.m b/Source/SPDatabaseRename.m index b07f513d..04f71182 100644 --- a/Source/SPDatabaseRename.m +++ b/Source/SPDatabaseRename.m @@ -37,7 +37,6 @@ @interface SPDatabaseRename () -- (BOOL)_createDatabase:(NSString *)database; - (BOOL)_dropDatabase:(NSString *)database; - (void)_moveTables:(NSArray *)tables fromDatabase:(NSString *)sourceDatabase toDatabase:(NSString *)targetDatabase; @@ -47,52 +46,38 @@ @implementation SPDatabaseRename -- (BOOL)renameDatabaseFrom:(NSString *)sourceDatabase to:(NSString *)targetDatabase +- (BOOL)renameDatabaseFrom:(SPCreateDatabaseInfo *)sourceDatabase to:(NSString *)targetDatabase { - NSArray *tables = nil; - NSArray *views = nil; - // Check, whether the source database exists and the target database doesn't - BOOL sourceExists = [[connection databases] containsObject:sourceDatabase]; + BOOL sourceExists = [[connection databases] containsObject:[sourceDatabase databaseName]]; BOOL targetExists = [[connection databases] containsObject:targetDatabase]; - if (sourceExists && !targetExists) { - tables = [tablesList allTableNames]; - views = [tablesList allViewNames]; - } - else { - return NO; - } - - BOOL success = [self _createDatabase:targetDatabase]; + if (!sourceExists || targetExists) return NO; + + NSArray *tables = [tablesList allTableNames]; + NSArray *views = [tablesList allViewNames]; - [self _moveTables:tables fromDatabase:sourceDatabase toDatabase:targetDatabase]; + BOOL success = [self createDatabase:targetDatabase + withEncoding:[sourceDatabase defaultEncoding] + collation:[sourceDatabase defaultCollation]]; - tables = [connection tablesFromDatabase:sourceDatabase]; - + [self _moveTables:tables fromDatabase:[sourceDatabase databaseName] toDatabase:targetDatabase]; + +#warning Section disabled because it might destroy data (views, functions, events, ...) +/* + tables = [connection tablesFromDatabase:[sourceDatabase databaseName]]; + if ([tables count] == 0) { - [self _dropDatabase:sourceDatabase]; - } - + [self _dropDatabase:[sourceDatabase databaseName]]; + } +*/ + return success; } #pragma mark - #pragma mark Private API -/** - * This method creates a new database. - * - * @param NSString newDatabaseName name of the new database to be created - * @return BOOL YES on success, otherwise NO - */ -- (BOOL)_createDatabase:(NSString *)database -{ - [connection queryString:[NSString stringWithFormat:@"CREATE DATABASE %@", [database backtickQuotedString]]]; - - return ![connection queryErrored]; -} - /** * This method drops a database. * -- cgit v1.2.3 From 6af24620e1126fe08e573ebf4dce93444ac140cb Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 12 Mar 2015 02:21:19 +0100 Subject: Missed a special case in the previous commit --- Source/SPDatabaseAction.h | 2 +- Source/SPDatabaseAction.m | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SPDatabaseAction.h b/Source/SPDatabaseAction.h index 52af621f..137a8737 100644 --- a/Source/SPDatabaseAction.h +++ b/Source/SPDatabaseAction.h @@ -75,7 +75,7 @@ * * @param database name of the new database to be created * @param encoding charset of the new database (can be nil to skip) - * @param collation sorting collation of the new database (can be nil. Will be ignored if encoding == nil) + * @param collation sorting collation of the new database (can be nil) * @return YES on success, otherwise NO */ - (BOOL)createDatabase:(NSString *)database withEncoding:(NSString *)encoding collation:(NSString *)collation; diff --git a/Source/SPDatabaseAction.m b/Source/SPDatabaseAction.m index f5ed8b60..c7f5dbf9 100644 --- a/Source/SPDatabaseAction.m +++ b/Source/SPDatabaseAction.m @@ -71,9 +71,9 @@ if([encoding length]) { // [nil length] == 0 [query appendFormat:@" DEFAULT CHARACTER SET = %@",[encoding backtickQuotedString]]; - if([collation length]) { - [query appendFormat:@" DEFAULT COLLATE = %@",[collation backtickQuotedString]]; - } + } + if([collation length]) { + [query appendFormat:@" DEFAULT COLLATE = %@",[collation backtickQuotedString]]; } [connection queryString:query]; -- cgit v1.2.3 From f86e21e8296a5c368fb547b93ff0390dec0f5785 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 12 Mar 2015 02:28:28 +0100 Subject: =?UTF-8?q?Well,=20and=20then=20there=20was=20backwards=20compatib?= =?UTF-8?q?ility=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPDatabaseAction.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/SPDatabaseAction.h b/Source/SPDatabaseAction.h index 137a8737..7ca8d402 100644 --- a/Source/SPDatabaseAction.h +++ b/Source/SPDatabaseAction.h @@ -32,6 +32,11 @@ @class SPMySQLConnection; @interface SPCreateDatabaseInfo : NSObject +{ + NSString *databaseName; + NSString *defaultEncoding; + NSString *defaultCollation; +} @property (readwrite,retain) NSString *databaseName; @property (readwrite,retain) NSString *defaultEncoding; -- cgit v1.2.3 From 0dc8d023f39c1bd03f51e62d90b6be7693955e53 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 16 Mar 2015 21:48:15 +0100 Subject: Updated OCMock framework and added a unit test --- .../A/Headers/NSNotificationCenter+OCMAdditions.h | 23 ++++-- .../OCMock.framework/Versions/A/Headers/OCMArg.h | 33 ++++++-- .../Versions/A/Headers/OCMConstraint.h | 39 +++++++-- .../Versions/A/Headers/OCMLocation.h | 36 ++++++++ .../Versions/A/Headers/OCMMacroState.h | 45 ++++++++++ .../Versions/A/Headers/OCMRecorder.h | 39 +++++++++ .../Versions/A/Headers/OCMStubRecorder.h | 56 +++++++++++++ .../OCMock.framework/Versions/A/Headers/OCMock.h | 84 +++++++++++++++++-- .../Versions/A/Headers/OCMockObject.h | 49 +++++++++-- .../Versions/A/Headers/OCMockRecorder.h | 28 ------- Frameworks/OCMock.framework/Versions/A/OCMock | Bin 291796 -> 191360 bytes .../Versions/A/Resources/Info.plist | 20 ++++- .../Versions/A/Resources/License.txt | 15 ---- .../A/Resources/en.lproj/InfoPlist.strings | Bin 0 -> 92 bytes Source/SPConstants.h | 3 + Source/SPDatabaseAction.m | 5 +- UnitTests/SPDatabaseActionTest.m | 92 +++++++++++++++++++++ sequel-pro.xcodeproj/project.pbxproj | 14 ++++ 18 files changed, 503 insertions(+), 78 deletions(-) create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h create mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h delete mode 100644 Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h delete mode 100644 Frameworks/OCMock.framework/Versions/A/Resources/License.txt create mode 100644 Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings create mode 100644 UnitTests/SPDatabaseActionTest.m diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h index ae2e37d0..c20a9c2b 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h @@ -1,15 +1,26 @@ -//--------------------------------------------------------------------------------------- -// $Id: NSNotificationCenter+OCMAdditions.h$ -// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2009-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import -@class OCMockObserver; +@class OCObserverMockObject; @interface NSNotificationCenter(OCMAdditions) -- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; @end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h index a775f39f..d53437cb 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h @@ -1,7 +1,18 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2009-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import @@ -10,15 +21,21 @@ // constraining arguments + (id)any; ++ (SEL)anySelector; + (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; + (id)isNil; + (id)isNotNil; ++ (id)isEqual:(id)value; + (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; // manipulating arguments + (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; // internal use only @@ -27,4 +44,10 @@ @end #define OCMOCK_ANY [OCMArg any] -#define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(typeof(variable))] + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + #define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) +#else + #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] +#endif diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h index 0bab7775..777966ab 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h @@ -1,21 +1,34 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2007-2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2007-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import + @interface OCMConstraint : NSObject -+ (id)constraint; ++ (instancetype)constraint; - (BOOL)evaluate:(id)value; // if you are looking for any, isNil, etc, they have moved to OCMArg -+ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; -+ (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; -// try to use [OCMArg checkWith...] instead of constraintWithSelector in here @end @@ -44,5 +57,15 @@ @end +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + + #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h new file mode 100644 index 00000000..e510db7a --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h new file mode 100644 index 00000000..4b2d6350 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +@end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h new file mode 100644 index 00000000..f56d2ca4 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; + +- (OCMInvocationMatcher *)invocationMatcher; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h new file mode 100644 index 00000000..890c9ef3 --- /dev/null +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import "OCMRecorder.h" + + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; })) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +@end + + + diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h index e18de58a..f0083b35 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h @@ -1,10 +1,84 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import -#import +#import +#import #import #import +#import +#import #import + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + invocation; \ + [OCMMacroState endStubMacro]; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + invocation; \ + [OCMMacroState endExpectMacro]; \ + ); \ +}) + +#define ClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + invocation; \ + [OCMMacroState endVerifyMacro]; \ + ); \ +}) + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h index 87e7b82e..63f2bae2 100644 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h +++ b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h @@ -1,17 +1,36 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- +/* + * Copyright (c) 2004-2014 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ #import +@class OCMLocation; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + @interface OCMockObject : NSProxy { BOOL isNice; BOOL expectationOrderMatters; - NSMutableArray *recorders; + NSMutableArray *stubs; NSMutableArray *expectations; NSMutableArray *exceptions; + NSMutableArray *invocations; } + (id)mockForClass:(Class)aClass; @@ -23,19 +42,33 @@ + (id)observerMock; -- (id)init; +- (instancetype)init; - (void)setExpectationOrderMatters:(BOOL)flag; - (id)stub; - (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; -- (void)verify; +- (void)stopMocking; // internal use only -- (id)getNewRecorder; +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; + - (BOOL)handleInvocation:(NSInvocation *)anInvocation; - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; @end + diff --git a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h b/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h deleted file mode 100644 index 7463a3f4..00000000 --- a/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h +++ /dev/null @@ -1,28 +0,0 @@ -//--------------------------------------------------------------------------------------- -// $Id$ -// Copyright (c) 2004-2009 by Mulle Kybernetik. See License file for details. -//--------------------------------------------------------------------------------------- - -#import - -@interface OCMockRecorder : NSProxy -{ - id signatureResolver; - NSInvocation *recordedInvocation; - NSMutableArray *invocationHandlers; -} - -- (id)initWithSignatureResolver:(id)anObject; - -- (BOOL)matchesInvocation:(NSInvocation *)anInvocation; -- (void)releaseInvocation; - -- (id)andReturn:(id)anObject; -- (id)andReturnValue:(NSValue *)aValue; -- (id)andThrow:(NSException *)anException; -- (id)andPost:(NSNotification *)aNotification; -- (id)andCall:(SEL)selector onObject:(id)anObject; - -- (NSArray *)invocationHandlers; - -@end diff --git a/Frameworks/OCMock.framework/Versions/A/OCMock b/Frameworks/OCMock.framework/Versions/A/OCMock index 303e9337..3fb5afb5 100755 Binary files a/Frameworks/OCMock.framework/Versions/A/OCMock and b/Frameworks/OCMock.framework/Versions/A/OCMock differ diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist index 4634d14c..20bc2603 100644 --- a/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist +++ b/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist @@ -2,6 +2,8 @@ + BuildMachineOSBuild + 13F34 CFBundleDevelopmentRegion English CFBundleExecutable @@ -15,12 +17,26 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.29 + 1.0 CFBundleSignature ???? CFBundleVersion 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6A2008a + DTPlatformVersion + GM + DTSDKBuild + 14A382 + DTSDKName + macosx10.10 + DTXcode + 0611 + DTXcodeBuild + 6A2008a NSHumanReadableCopyright - Copyright © 2004-2009 Mulle Kybernetik. + Copyright © 2004-2013 Mulle Kybernetik. diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/License.txt b/Frameworks/OCMock.framework/Versions/A/Resources/License.txt deleted file mode 100644 index e2c13960..00000000 --- a/Frameworks/OCMock.framework/Versions/A/Resources/License.txt +++ /dev/null @@ -1,15 +0,0 @@ - - Copyright (c) 2004-2009 by Mulle Kybernetik. All rights reserved. - - Permission to use, copy, modify and distribute this software and its documentation - is hereby granted, provided that both the copyright notice and this permission - notice appear in all copies of the software, derivative works or modified versions, - and any portions thereof, and that both notices appear in supporting documentation, - and that credit is given to Mulle Kybernetik in all documents and publicity - pertaining to direct or indirect use of this code or its derivatives. - - THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE - SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS - "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY - DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE - OR OF ANY DERIVATIVE WORK. \ No newline at end of file diff --git a/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings b/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..5e45963c Binary files /dev/null and b/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings differ diff --git a/Source/SPConstants.h b/Source/SPConstants.h index a2df5bde..728d213a 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -642,3 +642,6 @@ void _SPClear(id *addr); #if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10 typedef NSUInteger NSCellHitResult; #endif + +// Stolen from Stack Overflow: http://stackoverflow.com/questions/969130 +#define SPLog(fmt, ...) NSLog((@"%s:%d: " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) diff --git a/Source/SPDatabaseAction.m b/Source/SPDatabaseAction.m index c7f5dbf9..413e2378 100644 --- a/Source/SPDatabaseAction.m +++ b/Source/SPDatabaseAction.m @@ -65,7 +65,10 @@ - (BOOL)createDatabase:(NSString *)database withEncoding:(NSString *)encoding collation:(NSString *)collation { - NSParameterAssert(database != nil && [database length] > 0); + if(![database length]) { + SPLog(@"'database' should not be nil or empty!"); + return NO; + } NSMutableString *query = [NSMutableString stringWithFormat:@"CREATE DATABASE %@", [database backtickQuotedString]]; diff --git a/UnitTests/SPDatabaseActionTest.m b/UnitTests/SPDatabaseActionTest.m new file mode 100644 index 00000000..f7704df5 --- /dev/null +++ b/UnitTests/SPDatabaseActionTest.m @@ -0,0 +1,92 @@ +// +// SPDatabaseActionTest.m +// sequel-pro +// +// Created by Max Lohrmann on 12.03.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import +#import + + +#import "SPDatabaseAction.h" +#import + + +@interface SPDatabaseActionTest : SenTestCase + +- (void)testCreateDatabase_01_emptyName; +- (void)testCreateDatabase_02_allParams; +- (void)testCreateDatabase_03_nameOnly; + +@end + +@implementation SPDatabaseActionTest + +- (void)testCreateDatabase_01_emptyName +{ + id mockConnection = OCMStrictClassMock([SPMySQLConnection class]); + //OCMStrictClassMock would fail on any call, which is desired here + + SPDatabaseAction *createDb = [[[SPDatabaseAction alloc] init] autorelease]; + [createDb setConnection:mockConnection]; + STAssertFalse([createDb createDatabase:@"" withEncoding:nil collation:nil],@"create database = NO with empty db name"); + + OCMVerifyAll(mockConnection); +} + + +- (void)testCreateDatabase_02_allParams +{ + id mockConnection = OCMStrictClassMock([SPMySQLConnection class]); + + OCMExpect([mockConnection queryString:@"CREATE DATABASE `target_name` DEFAULT CHARACTER SET = `utf8` DEFAULT COLLATE = `utf8_bin_ci`"]); + OCMStub([mockConnection queryErrored]).andReturn(NO); + + SPDatabaseAction *createDb = [[[SPDatabaseAction alloc] init] autorelease]; + [createDb setConnection:mockConnection]; + + STAssertTrue([createDb createDatabase:@"target_name" withEncoding:@"utf8" collation:@"utf8_bin_ci"], @"create database return"); + + OCMVerifyAll(mockConnection); +} + +- (void)testCreateDatabase_03_nameOnly +{ + id mockConnection = OCMStrictClassMock([SPMySQLConnection class]); + + OCMExpect([mockConnection queryString:@"CREATE DATABASE `target_name`"]); + OCMStub([mockConnection queryErrored]).andReturn(NO); + + SPDatabaseAction *createDb = [[[SPDatabaseAction alloc] init] autorelease]; + [createDb setConnection:mockConnection]; + + STAssertTrue([createDb createDatabase:@"target_name" withEncoding:@"" collation:nil], @"create database return"); + + OCMVerifyAll(mockConnection); +} + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 8c3d5989..afc3e3f3 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -188,6 +188,12 @@ 50D3C35D1A77217800B5429C /* SPParserUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 50D3C3501A77135F00B5429C /* SPParserUtils.c */; }; 50E217B318174246009D3580 /* SPColorSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B218174246009D3580 /* SPColorSelectorView.m */; }; 50E217B618174280009D3580 /* SPFavoriteColorSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */; }; + 50EA92641AB23EAD008D3C4F /* SPDatabaseCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */; }; + 50EA92651AB23EC8008D3C4F /* SPDatabaseAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */; }; + 50EA92661AB23ED3008D3C4F /* SPMySQL.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 584D876815140D3500F24774 /* SPMySQL.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 50EA92671AB23EE1008D3C4F /* SPMySQL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 584D876815140D3500F24774 /* SPMySQL.framework */; }; + 50EA92681AB23EFC008D3C4F /* SPTableCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1141A388117BBFF200126A28 /* SPTableCopy.m */; }; + 50EA926A1AB246B8008D3C4F /* SPDatabaseActionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */; }; 50EAB5B81A8FBB08008F627A /* SPOSInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; 580E8DB711EA774B000D8427 /* SequelProTabClose_Pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 580E8DAB11EA772C000D8427 /* SequelProTabClose_Pressed.png */; }; @@ -551,6 +557,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 50EA92661AB23ED3008D3C4F /* SPMySQL.framework in Copy Frameworks */, 17E20E0012D660C3007F75A6 /* OCMock.framework in Copy Frameworks */, ); name = "Copy Frameworks"; @@ -900,6 +907,7 @@ 50E217B218174246009D3580 /* SPColorSelectorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPColorSelectorView.m; sourceTree = ""; }; 50E217B418174280009D3580 /* SPFavoriteColorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFavoriteColorSupport.h; sourceTree = ""; }; 50E217B518174280009D3580 /* SPFavoriteColorSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFavoriteColorSupport.m; sourceTree = ""; }; + 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseActionTest.m; sourceTree = ""; }; 50EAB5B61A8FBB08008F627A /* SPOSInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPOSInfo.h; sourceTree = ""; }; 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPOSInfo.m; sourceTree = ""; }; 5806B76211A991EC00813A88 /* SPDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDocumentController.h; sourceTree = ""; }; @@ -1265,6 +1273,7 @@ files = ( 1717F9DB1558114D0065C036 /* OCMock.framework in Frameworks */, 1717FA43155831600065C036 /* libicucore.dylib in Frameworks */, + 50EA92671AB23EE1008D3C4F /* SPMySQL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1378,6 +1387,7 @@ 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */, 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */, 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */, + 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */, ); name = "Database Actions"; sourceTree = ""; @@ -3050,6 +3060,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 50EA92681AB23EFC008D3C4F /* SPTableCopy.m in Sources */, + 50EA926A1AB246B8008D3C4F /* SPDatabaseActionTest.m in Sources */, + 50EA92651AB23EC8008D3C4F /* SPDatabaseAction.m in Sources */, + 50EA92641AB23EAD008D3C4F /* SPDatabaseCopy.m in Sources */, 50D3C35D1A77217800B5429C /* SPParserUtils.c in Sources */, 380F4EF50FC0B68F00B0BFD7 /* SPStringAdditionsTests.m in Sources */, 1760599F1336199D0098E162 /* SPMenuAdditionsTests.m in Sources */, -- cgit v1.2.3 From 73919a3bc0b80ee45c284045dbeac47846331bff Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 16 Mar 2015 21:57:22 +0100 Subject: Remove .h files for unit tests There is really no point in having them as unit tests don't have an interface someone would want to #import. (and they are disabled right now anyway ;)) --- UnitTests/SPDatabaseCopyTest.h | 40 ---------------------------- UnitTests/SPDatabaseCopyTest.m | 11 +++++++- UnitTests/SPDatabaseRenameTest.h | 40 ---------------------------- UnitTests/SPDatabaseRenameTest.m | 11 +++++++- UnitTests/SPMenuAdditionsTests.h | 45 -------------------------------- UnitTests/SPMenuAdditionsTests.m | 17 +++++++++++- UnitTests/SPMutableArrayAdditionsTests.h | 42 ----------------------------- UnitTests/SPMutableArrayAdditionsTests.m | 14 +++++++++- UnitTests/SPStringAdditionsTests.h | 40 ---------------------------- UnitTests/SPStringAdditionsTests.m | 12 ++++++++- UnitTests/SPTableCopyTest.h | 39 --------------------------- UnitTests/SPTableCopyTest.m | 12 +++++++-- sequel-pro.xcodeproj/project.pbxproj | 12 --------- 13 files changed, 70 insertions(+), 265 deletions(-) delete mode 100644 UnitTests/SPDatabaseCopyTest.h delete mode 100644 UnitTests/SPDatabaseRenameTest.h delete mode 100644 UnitTests/SPMenuAdditionsTests.h delete mode 100644 UnitTests/SPMutableArrayAdditionsTests.h delete mode 100644 UnitTests/SPStringAdditionsTests.h delete mode 100644 UnitTests/SPTableCopyTest.h diff --git a/UnitTests/SPDatabaseCopyTest.h b/UnitTests/SPDatabaseCopyTest.h deleted file mode 100644 index 2ed193a3..00000000 --- a/UnitTests/SPDatabaseCopyTest.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// SPDatabaseCopyTest.h -// sequel-pro -// -// Created by David Rekowski. -// Copyright (c) 2010 David Rekowski. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#define USE_APPLICATION_UNIT_TEST 1 - -#import - -@interface SPDatabaseCopyTest : SenTestCase - -- (void)testCopyDatabase; -- (void)testCreateDatabase; - -@end diff --git a/UnitTests/SPDatabaseCopyTest.m b/UnitTests/SPDatabaseCopyTest.m index 2ab44bea..036a1869 100644 --- a/UnitTests/SPDatabaseCopyTest.m +++ b/UnitTests/SPDatabaseCopyTest.m @@ -28,14 +28,23 @@ // // More info at +#define USE_APPLICATION_UNIT_TEST 1 + #import +#import #import "SPAlertSheets.h" -#import "SPDatabaseCopyTest.h" #import "SPDatabaseCopy.h" #import "SPTableCopy.h" #import "SPLogger.h" +@interface SPDatabaseCopyTest : SenTestCase + +- (void)testCopyDatabase; +- (void)testCreateDatabase; + +@end + @implementation SPDatabaseCopyTest - (SPDatabaseCopy *)getDatabaseCopyFixture diff --git a/UnitTests/SPDatabaseRenameTest.h b/UnitTests/SPDatabaseRenameTest.h deleted file mode 100644 index 138b0e11..00000000 --- a/UnitTests/SPDatabaseRenameTest.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// SPDatabaseRenameTest.h -// sequel-pro -// -// Created by David Rekowski. -// Copyright (c) 2010 David Rekowski. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#define USE_APPLICATION_UNIT_TEST 1 - -#import - -@interface SPDatabaseRenameTest : SenTestCase - -- (void)testRenameDatabase; -- (void)testCreateDatabase; - -@end diff --git a/UnitTests/SPDatabaseRenameTest.m b/UnitTests/SPDatabaseRenameTest.m index ce826e13..0c29ad0a 100644 --- a/UnitTests/SPDatabaseRenameTest.m +++ b/UnitTests/SPDatabaseRenameTest.m @@ -28,12 +28,21 @@ // // More info at -#import "SPDatabaseRenameTest.h" +#define USE_APPLICATION_UNIT_TEST 1 + #import "SPDatabaseRename.h" #import "SPTableCopy.h" #import "SPLogger.h" #import +#import + +@interface SPDatabaseRenameTest : SenTestCase + +- (void)testRenameDatabase; +- (void)testCreateDatabase; + +@end @implementation SPDatabaseRenameTest diff --git a/UnitTests/SPMenuAdditionsTests.h b/UnitTests/SPMenuAdditionsTests.h deleted file mode 100644 index fbc4d653..00000000 --- a/UnitTests/SPMenuAdditionsTests.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// SPMenuAdditionsTests.h -// sequel-pro -// -// Created by Stuart Connolly (stuconnolly.com) on March 20, 2011. -// Copyright (c) 2011 Stuart Connolly. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#import - -/** - * @class SPMenuAdditionsTests SPMenuAdditionsTests.h - * - * @author Stuart Connolly http://stuconnolly.com/ - * - * SPMenuAdditionsTests tests class. - */ -@interface SPMenuAdditionsTests : SenTestCase -{ - NSMenu *menu; -} - -@end diff --git a/UnitTests/SPMenuAdditionsTests.m b/UnitTests/SPMenuAdditionsTests.m index e33920e7..83647e6f 100644 --- a/UnitTests/SPMenuAdditionsTests.m +++ b/UnitTests/SPMenuAdditionsTests.m @@ -28,9 +28,24 @@ // // More info at -#import "SPMenuAdditionsTests.h" #import "SPMenuAdditions.h" +#import + +/** + * @class SPMenuAdditionsTests SPMenuAdditionsTests.h + * + * @author Stuart Connolly http://stuconnolly.com/ + * + * SPMenuAdditionsTests tests class. + */ +@interface SPMenuAdditionsTests : SenTestCase +{ + NSMenu *menu; +} + +@end + static NSString *SPTestMenuItemTitle = @"Menu Item"; @implementation SPMenuAdditionsTests diff --git a/UnitTests/SPMutableArrayAdditionsTests.h b/UnitTests/SPMutableArrayAdditionsTests.h deleted file mode 100644 index d96ef285..00000000 --- a/UnitTests/SPMutableArrayAdditionsTests.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// SPMutableArrayAdditionsTests.h -// sequel-pro -// -// Created by Stuart Connolly (stuconnolly.com) on February 2, 2011. -// Copyright (c) 2011 Stuart Connolly. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#import - -/** - * @class SPMutableArrayAdditionsTest SPMutableArrayAdditionsTest.h - * - * @author Stuart Connolly http://stuconnolly.com/ - * - * SPMutableArrayAdditions tests class. - */ -@interface SPMutableArrayAdditionsTests : SenTestCase - -@end diff --git a/UnitTests/SPMutableArrayAdditionsTests.m b/UnitTests/SPMutableArrayAdditionsTests.m index a2890d8f..e09f00a4 100644 --- a/UnitTests/SPMutableArrayAdditionsTests.m +++ b/UnitTests/SPMutableArrayAdditionsTests.m @@ -28,9 +28,21 @@ // // More info at -#import "SPMutableArrayAdditionsTests.h" #import "SPMutableArrayAdditions.h" +#import + +/** + * @class SPMutableArrayAdditionsTest SPMutableArrayAdditionsTest.h + * + * @author Stuart Connolly http://stuconnolly.com/ + * + * SPMutableArrayAdditions tests class. + */ +@interface SPMutableArrayAdditionsTests : SenTestCase + +@end + @implementation SPMutableArrayAdditionsTests /** diff --git a/UnitTests/SPStringAdditionsTests.h b/UnitTests/SPStringAdditionsTests.h deleted file mode 100644 index 56b5c6f9..00000000 --- a/UnitTests/SPStringAdditionsTests.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// SPStringAdditionsTests.h -// sequel-pro -// -// Created by Jim Knight on May 17, 2009. -// Copyright (c) 2009 Jim Knight. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#import - -@interface SPStringAdditionsTests : SenTestCase - -- (void)testStringByRemovingCharactersInSet; -- (void)testStringWithNewUUID; -- (void)testCreateViewSyntaxPrettifier; -- (void)testNonConsecutivelySearchStringMatchingRanges; - -@end diff --git a/UnitTests/SPStringAdditionsTests.m b/UnitTests/SPStringAdditionsTests.m index f455066f..b0528ec7 100644 --- a/UnitTests/SPStringAdditionsTests.m +++ b/UnitTests/SPStringAdditionsTests.m @@ -28,10 +28,20 @@ // // More info at -#import "SPStringAdditionsTests.h" #import "SPStringAdditions.h" #import "RegexKitLite.h" +#import + +@interface SPStringAdditionsTests : SenTestCase + +- (void)testStringByRemovingCharactersInSet; +- (void)testStringWithNewUUID; +- (void)testCreateViewSyntaxPrettifier; +- (void)testNonConsecutivelySearchStringMatchingRanges; + +@end + @implementation SPStringAdditionsTests /** diff --git a/UnitTests/SPTableCopyTest.h b/UnitTests/SPTableCopyTest.h deleted file mode 100644 index 29c5eea4..00000000 --- a/UnitTests/SPTableCopyTest.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// SPTableCopyTest.h -// sequel-pro -// -// Created by David Rekowski. -// Copyright (c) 2010 David Rekowski. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#define USE_APPLICATION_UNIT_TEST 1 - -#import - -@interface SPTableCopyTest : SenTestCase - -- (void)testCopyTableFromToWithData; - -@end diff --git a/UnitTests/SPTableCopyTest.m b/UnitTests/SPTableCopyTest.m index 099066bc..76a2fe45 100644 --- a/UnitTests/SPTableCopyTest.m +++ b/UnitTests/SPTableCopyTest.m @@ -29,10 +29,18 @@ // More info at #import "SPTableCopy.h" -#import "SPTableCopyTest.h" +#import +#import #import -#import + +#define USE_APPLICATION_UNIT_TEST 1 + +@interface SPTableCopyTest : SenTestCase + +- (void)testCopyTableFromToWithData; + +@end @implementation SPTableCopyTest diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index afc3e3f3..3d3be25d 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -596,19 +596,16 @@ /* Begin PBXFileReference section */ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 112730541180788A000737FD /* SPTableCopyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableCopyTest.h; sourceTree = ""; }; 112730551180788A000737FD /* SPTableCopyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableCopyTest.m; sourceTree = ""; }; 1141A387117BBFF200126A28 /* SPTableCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableCopy.h; sourceTree = ""; }; 1141A388117BBFF200126A28 /* SPTableCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableCopy.m; sourceTree = ""; }; 1198F5B11174EDD500670590 /* SPDatabaseCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCopy.h; sourceTree = ""; }; 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopy.m; sourceTree = ""; }; - 1198F5C21174EF3F00670590 /* SPDatabaseCopyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCopyTest.h; sourceTree = ""; }; 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopyTest.m; sourceTree = ""; }; 11B55BFC1189E3B2009EF465 /* SPDatabaseAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseAction.h; sourceTree = ""; }; 11B55BFD1189E3B2009EF465 /* SPDatabaseAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseAction.m; sourceTree = ""; }; 11C2109C1180E70800758039 /* SPDatabaseRename.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRename.h; sourceTree = ""; }; 11C2109D1180E70800758039 /* SPDatabaseRename.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseRename.m; sourceTree = ""; }; - 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRenameTest.h; sourceTree = ""; }; 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseRenameTest.m; sourceTree = ""; }; 11D44DEF118F5887002AA43C /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Frameworks/OCMock.framework; sourceTree = ""; }; 17005CB116D6CF0000AF81F4 /* SPTableTriggersDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableTriggersDelegate.h; sourceTree = ""; }; @@ -685,7 +682,6 @@ 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 = ""; }; - 1760599D1336199D0098E162 /* SPMenuAdditionsTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPMenuAdditionsTests.h; sourceTree = ""; }; 1760599E1336199D0098E162 /* SPMenuAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPMenuAdditionsTests.m; 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 = ""; }; @@ -745,7 +741,6 @@ 1798F19A1550185B004B0AB8 /* SPTreeNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTreeNode.m; sourceTree = ""; }; 1798F19C15501892004B0AB8 /* SPFlippedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPFlippedView.h; sourceTree = ""; }; 1798F19D15501892004B0AB8 /* SPFlippedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFlippedView.m; sourceTree = ""; }; - 1798F1C1155018D4004B0AB8 /* SPMutableArrayAdditionsTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPMutableArrayAdditionsTests.h; sourceTree = ""; }; 1798F1C2155018D4004B0AB8 /* SPMutableArrayAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPMutableArrayAdditionsTests.m; sourceTree = ""; }; 179ECEC611F265EE009C6A40 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; 179F15040F7C433C00579954 /* SPEditorTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPEditorTokens.h; sourceTree = ""; }; @@ -877,7 +872,6 @@ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 380F4ED90FC0B50500B0BFD7 /* Unit Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Unit Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 380F4EF30FC0B68F00B0BFD7 /* SPStringAdditionsTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPStringAdditionsTests.h; sourceTree = ""; }; 380F4EF40FC0B68F00B0BFD7 /* SPStringAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPStringAdditionsTests.m; sourceTree = ""; }; 384582C30FB95FF800DDACB6 /* func-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "func-small.png"; sourceTree = ""; }; 384582C60FB9603600DDACB6 /* proc-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "proc-small.png"; sourceTree = ""; }; @@ -1381,11 +1375,8 @@ 1198F5B41174EDDE00670590 /* Database Actions */ = { isa = PBXGroup; children = ( - 112730541180788A000737FD /* SPTableCopyTest.h */, 112730551180788A000737FD /* SPTableCopyTest.m */, - 1198F5C21174EF3F00670590 /* SPDatabaseCopyTest.h */, 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */, - 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */, 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */, 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */, ); @@ -1940,11 +1931,8 @@ 17DC886A126B378A00E9AAEC /* Category Additions */ = { isa = PBXGroup; children = ( - 380F4EF30FC0B68F00B0BFD7 /* SPStringAdditionsTests.h */, 380F4EF40FC0B68F00B0BFD7 /* SPStringAdditionsTests.m */, - 1760599D1336199D0098E162 /* SPMenuAdditionsTests.h */, 1760599E1336199D0098E162 /* SPMenuAdditionsTests.m */, - 1798F1C1155018D4004B0AB8 /* SPMutableArrayAdditionsTests.h */, 1798F1C2155018D4004B0AB8 /* SPMutableArrayAdditionsTests.m */, ); name = "Category Additions"; -- cgit v1.2.3 From cdf6fa551b9ccfe9980baa6cb9de368b99ab985e Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 16 Mar 2015 22:09:49 +0100 Subject: Revert part of e2a21022e4c6e61673a7014ccb29ba20a5378686 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Yes, Apple. We all love you for denying the existence of any previous version one day after your latest and greatest™ software is released... --- sequel-pro.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 3d3be25d..ccbb99e5 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -2656,7 +2656,7 @@ name = "Unit Tests"; productName = "Unit Tests"; productReference = 380F4ED90FC0B50500B0BFD7 /* Unit Tests.octest */; - productType = "com.apple.product-type.bundle.ocunit-test"; + productType = "com.apple.product-type.bundle"; }; 584754C1120A04560057631F /* Sequel Pro QLGenerator */ = { isa = PBXNativeTarget; -- cgit v1.2.3 From 9f2e5a6b0fafeec8f94dfa00414b0016b12194ba Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 17 Mar 2015 01:37:41 +0100 Subject: Allow selection of SSH client binary in prefs Hey, I was against this, but if you want it... - just don't blame me for what might happen :shipit: --- .../Source/SPMySQLConnectionProxy.h | 11 +- Interfaces/English.lproj/Preferences.xib | 907 +++++++++++++++++++-- Source/SPConstants.h | 1 + Source/SPConstants.m | 1 + Source/SPNetworkPreferencePane.h | 14 +- Source/SPNetworkPreferencePane.m | 66 ++ Source/SPSSHTunnel.m | 34 +- 7 files changed, 969 insertions(+), 65 deletions(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h index a6f84567..3622b312 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h @@ -33,11 +33,12 @@ * Connection proxy state constants. */ typedef enum { - SPMySQLProxyIdle = 0, - SPMySQLProxyConnecting = 1, - SPMySQLProxyWaitingForAuth = 2, - SPMySQLProxyConnected = 3, - SPMySQLProxyForwardingFailed = 4 + SPMySQLProxyIdle = 0, + SPMySQLProxyConnecting = 1, + SPMySQLProxyWaitingForAuth = 2, + SPMySQLProxyConnected = 3, + SPMySQLProxyForwardingFailed = 4, + SPMySQLProxyLaunchFailed = 5 } SPMySQLConnectionProxyState; diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 4901f537..b39ec8a5 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -3,12 +3,12 @@ 1060 13F34 - 6254 + 6751 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 6254 + 6751 NSBox @@ -88,9 +88,12 @@ {580, 50} - + 256 {580, 172} + + + {{0, 0}, {1920, 1178}} {580, 72} @@ -560,7 +563,7 @@ YES - + 268 @@ -568,7 +571,6 @@ 268 {{201, 121}, {254, 26}} - YES @@ -940,7 +942,6 @@ 268 {{202, 214}, {362, 18}} - YES @@ -970,7 +971,6 @@ 268 {{11, 242}, {187, 17}} - YES @@ -990,7 +990,6 @@ 268 {{201, 236}, {254, 26}} - YES @@ -1024,7 +1023,6 @@ 268 {{17, 85}, {182, 17}} - YES @@ -1044,7 +1042,6 @@ 268 {{17, 127}, {182, 17}} - YES @@ -1064,7 +1061,6 @@ 268 {{202, 84}, {360, 18}} - YES @@ -1089,7 +1085,6 @@ 268 {{202, 62}, {360, 18}} - YES @@ -1114,7 +1109,6 @@ 1036 {{202, 156}, {360, 5}} - {0, 0} @@ -1138,7 +1132,6 @@ 12 {{204, 108}, {358, 5}} - {0, 0} @@ -1162,7 +1155,6 @@ 12 {{204, 53}, {357, 5}} - {0, 0} @@ -1186,7 +1178,6 @@ 268 {{17, 23}, {181, 17}} - YES @@ -1206,7 +1197,6 @@ 268 {{203, 20}, {38, 22}} - YES @@ -1262,7 +1252,6 @@ 268 {{247, 23}, {316, 17}} - YES 68157504 @@ -1281,7 +1270,6 @@ 268 {{201, 169}, {254, 26}} - YES @@ -1406,7 +1394,6 @@ 268 {{17, 175}, {182, 17}} - YES @@ -1426,7 +1413,6 @@ 12 {{202, 204}, {360, 5}} - {0, 0} @@ -1447,8 +1433,6 @@ {580, 280} - - NSView @@ -2025,7 +2009,7 @@ NSView - + 268 @@ -2033,7 +2017,6 @@ 268 {{230, 174}, {332, 28}} - _NS:9 {250, 750} @@ -2065,7 +2048,6 @@ 268 {{202, 208}, {360, 18}} - YES @@ -2090,7 +2072,6 @@ 12 {{202, 136}, {360, 5}} - {0, 0} @@ -2114,7 +2095,6 @@ 268 {{202, 150}, {360, 18}} - YES @@ -2139,7 +2119,6 @@ 268 {{202, 110}, {360, 18}} - YES @@ -2164,7 +2143,6 @@ 268 {{230, 87}, {332, 18}} - YES @@ -2189,7 +2167,6 @@ 268 {{230, 41}, {332, 18}} - YES @@ -2214,7 +2191,6 @@ 268 {{230, 64}, {332, 18}} - YES @@ -2239,7 +2215,6 @@ 268 {{230, 18}, {332, 18}} - YES 67108864 @@ -2260,8 +2235,6 @@ {580, 244} - - NSView @@ -2537,14 +2510,88 @@ AQAAAAA NSView - + 268 + + + 268 + {{224, 19}, {222, 19}} + + + + _NS:526 + {251, 750} + YES + + 67108928 + 272632320 + /path/to/ssh/binary + + _NS:526 + + + + + NO + 1 + + + + 268 + {{452, 19}, {109, 19}} + + + + _NS:9 + YES + + -2080374784 + 134217728 + Change… + + YES + 12 + 2586 + + _NS:9 + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 268 + {{16, 19}, {204, 19}} + + + + YES + + 67108928 + 71304192 + SSH Client: + + + + + + NO + 1 + 268 - {{17, 56}, {204, 17}} + {{17, 90}, {204, 17}} + + YES 67108928 @@ -2561,8 +2608,10 @@ AQAAAAA 268 - {{224, 19}, {338, 18}} + {{224, 53}, {338, 18}} + + YES -2080374784 @@ -2584,8 +2633,10 @@ AQAAAAA 268 - {{226, 54}, {50, 22}} + {{226, 88}, {50, 22}} + + YES -1804599231 @@ -2636,8 +2687,10 @@ AQAAAAA 268 - {{281, 57}, {282, 17}} + {{281, 91}, {282, 17}} + + YES 67108928 @@ -2651,11 +2704,37 @@ AQAAAAA NO 1 + + + 12 + {{226, 44}, {334, 5}} + + + + {0, 0} + + 67108864 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + 12 - {{226, 43}, {334, 5}} + {{226, 77}, {334, 5}} + + {0, 0} 67108864 @@ -2674,11 +2753,14 @@ AQAAAAA NO - {580, 93} + {580, 127} + + + NSView - + 268 @@ -2686,6 +2768,7 @@ AQAAAAA 268 {{469, 291}, {15, 22}} + YES @@ -2706,6 +2789,7 @@ AQAAAAA 268 {{439, 293}, {23, 19}} + YES @@ -2763,6 +2847,7 @@ AQAAAAA 268 {{270, 294}, {162, 18}} + YES @@ -2787,6 +2872,7 @@ AQAAAAA 268 {{144, 24}, {101, 14}} + YES @@ -2806,6 +2892,7 @@ AQAAAAA 268 {{49, 24}, {93, 14}} + YES @@ -2833,7 +2920,8 @@ AQAAAAA 256 {220, 286} - + + YES NO YES @@ -2918,6 +3006,7 @@ AQAAAAA {{1, 1}, {220, 286}} + @@ -2928,6 +3017,7 @@ AQAAAAA -2147483392 {{-100, -100}, {15, 102}} + NO @@ -2939,6 +3029,7 @@ AQAAAAA -2147483392 {{-100, -100}, {223, 15}} + NO 1 @@ -2949,7 +3040,8 @@ AQAAAAA {{20, 50}, {222, 288}} - + + 133122 @@ -2964,6 +3056,7 @@ AQAAAAA 268 {{20, 19}, {24, 24}} + YES @@ -3088,6 +3181,7 @@ AQAAAAA 268 {{439, 20}, {23, 19}} + YES @@ -3146,6 +3240,7 @@ AQAAAAA 268 {{269, 22}, {164, 16}} + YES @@ -3165,6 +3260,8 @@ AQAAAAA 268 {{469, 18}, {15, 22}} + + YES 67895328 @@ -3184,6 +3281,7 @@ AQAAAAA 268 {{17, 362}, {182, 17}} + YES @@ -3203,6 +3301,7 @@ AQAAAAA 268 {{433, 353}, {133, 32}} + YES @@ -3225,6 +3324,7 @@ AQAAAAA 268 {{204, 360}, {207, 22}} + YES @@ -3245,6 +3345,7 @@ AQAAAAA 268 {{270, 322}, {292, 18}} + YES @@ -3269,6 +3370,7 @@ AQAAAAA 268 {{270, 267}, {292, 18}} + YES @@ -3293,6 +3395,7 @@ AQAAAAA 268 {{270, 209}, {292, 18}} + YES @@ -3317,6 +3420,7 @@ AQAAAAA 268 {{270, 238}, {292, 18}} + YES @@ -3341,6 +3445,7 @@ AQAAAAA 268 {{270, 162}, {292, 18}} + YES @@ -3365,6 +3470,7 @@ AQAAAAA 268 {{270, 51}, {292, 18}} + YES @@ -3389,6 +3495,7 @@ AQAAAAA 268 {{270, 79}, {292, 18}} + YES @@ -3413,6 +3520,7 @@ AQAAAAA 268 {{270, 134}, {292, 18}} + YES @@ -3437,6 +3545,7 @@ AQAAAAA 268 {{370, 109}, {29, 19}} + YES @@ -3495,6 +3604,7 @@ AQAAAAA 268 {{269, 111}, {96, 14}} + YES @@ -3514,6 +3624,7 @@ AQAAAAA 268 {{405, 107}, {15, 22}} + YES @@ -3534,6 +3645,7 @@ AQAAAAA 268 {{423, 111}, {140, 14}} + YES @@ -3553,6 +3665,7 @@ AQAAAAA -2147483380 {{269, 1}, {292, 18}} + YES @@ -3577,6 +3690,7 @@ AQAAAAA 268 {{370, 184}, {29, 19}} + YES @@ -3635,6 +3749,7 @@ AQAAAAA 268 {{269, 186}, {96, 14}} + YES @@ -3654,6 +3769,7 @@ AQAAAAA 268 {{405, 182}, {15, 22}} + YES @@ -3674,6 +3790,7 @@ AQAAAAA 268 {{423, 186}, {140, 14}} + YES @@ -3693,6 +3810,7 @@ AQAAAAA 12 {{204, 349}, {356, 5}} + {0, 0} @@ -3713,6 +3831,8 @@ AQAAAAA {580, 400} + + NSView @@ -3748,6 +3868,7 @@ AQAAAAA 274 {{2, 42}, {575, 34}} + YES 67108864 @@ -3763,6 +3884,7 @@ AQAAAAA {579, 83} + NSView @@ -3951,6 +4073,128 @@ AQAAAAA + + + 268 + + + + 268 + {{275, 16}, {135, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Change… + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{-2, 0}, {408, 14}} + + + + _NS:526 + {251, 750} + YES + + 67108864 + 272629760 + Enter the full absolute path to your SSH binary. + + _NS:526 + + + + + NO + YES + 1 + + + + 268 + {{0, 22}, {273, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + System default + _NS:9 + + YES + + + + NO + 1 + + + {404, 44} + + + + _NS:9 + + + + + 268 + + + + 266 + {{18, 18}, {273, 18}} + + + + YES + + 67108864 + 0 + Show hidden files + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + {309, 54} + + + + _NS:9 + + NO @@ -5439,6 +5683,46 @@ AQAAAAA 2154 + + + sshClientPickerView + + + + gUn-jl-Tfb + + + + sshClientPath + + + + eUn-5b-NBa + + + + pickSSHClient: + + + + zcA-5j-KFq + + + + pickSSHClientViaFileBrowser: + + + + w0e-lI-UbS + + + + hiddenFileView + + + + r1S-eS-uJK + value: values.CustomQuerySoftIndent @@ -5601,21 +5885,63 @@ AQAAAAA - value: values.SPCustomQueryEditorCompleteWithBackticks - + value: values.SSHClientPath + - + - value: values.SPCustomQueryEditorCompleteWithBackticks + value: values.SSHClientPath value - values.SPCustomQueryEditorCompleteWithBackticks + values.SSHClientPath + + NSNullPlaceholder + System default + 2 - ZhP-mB-7aF + 89d-3h-dgq - + + + value: values.KeySelectionHiddenFilesVisibility + + + + + + value: values.KeySelectionHiddenFilesVisibility + value + values.KeySelectionHiddenFilesVisibility + + + + + + + 2 + + + WP6-C7-FqP + + + + value: values.SPCustomQueryEditorCompleteWithBackticks + + + + + + value: values.SPCustomQueryEditorCompleteWithBackticks + value + values.SPCustomQueryEditorCompleteWithBackticks + 2 + + + ZhP-mB-7aF + + @@ -6271,6 +6597,10 @@ AQAAAAA + + + + Network @@ -7782,6 +8112,122 @@ AQAAAAA + + HWX-AV-xGx + + + + + 9CM-2a-2JU + + + + + + + + 4Us-KF-Ysj + + + + + Rsg-4x-YV2 + + + + + + + + MhF-tS-nrE + + + + + GcY-yy-sZn + + + + + + + + 29D-bG-y15 + + + + + D6L-76-0Ik + + + + + + + + Pick SSH client binary Accessory View + + + yQV-9I-7us + + + + + + + + eS9-G4-zgt + + + + + ZHD-xB-ee1 + + + + + + + + yLf-F5-exv + + + + + hEB-5Q-jZ8 + + + + + + + + 1nt-aH-gM4 + + + + + GEn-6y-U3F + + + + + + Show Hidden Files Accessory View + + + bAQ-gF-4V2 + + + + + + + + apR-gz-ej3 + + + @@ -8011,6 +8457,7 @@ AQAAAAA 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 @@ -8074,6 +8521,7 @@ AQAAAAA 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 @@ -8097,6 +8545,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8165,6 +8614,8 @@ AQAAAAA 0 + + {-460, 486.5} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8237,11 +8688,31 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {-482, -2} + com.apple.InterfaceBuilder.CocoaPlugin + + {-609.5, 138} + 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 + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -8519,11 +8990,65 @@ AQAAAAA SPNetworkPreferencePane SPPreferencePane + + id + id + + + + pickSSHClient: + id + + + pickSSHClientViaFileBrowser: + id + + + + NSView + NSTextField + NSView + + + + hiddenFileView + NSView + + + sshClientPath + NSTextField + + + sshClientPickerView + NSView + + IBProjectSource ../Source/SPNetworkPreferencePane.h + + SPNetworkPreferencePane + + id + id + + + + pickSSHClient: + id + + + pickSSHClientViaFileBrowser: + id + + + + IBProjectSource + ../Source/SPNetworkPreferencePane.m + + SPNotificationsPreferencePane SPPreferencePane @@ -8672,6 +9197,284 @@ AQAAAAA + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSDateFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSDateFormatter.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSNumberFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSNumberFormatter.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSStepper + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSStepper.h + + + + NSStepperCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSStepperCell.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSViewController + NSResponder + + view + NSView + + + view + + view + NSView + + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + SUUpdater NSObject diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 728d213a..38e05cc5 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -428,6 +428,7 @@ extern NSString *SPHiddenKeyFileVisibilityKey; extern NSString *SPSelectionDetailTypeIndexed; extern NSString *SPSelectionDetailTypePrimaryKeyed; extern NSString *SPSSHEnableMuxingPreference; +extern NSString *SPSSHClientPath; // URLs extern NSString *SPDonationsURL; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 292acb3c..fad42bc6 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -229,6 +229,7 @@ NSString *SPHiddenKeyFileVisibilityKey = @"KeySelectionHiddenFilesVisi NSString *SPSelectionDetailTypeIndexed = @"SelectionDetailTypeNSIndexSet"; NSString *SPSelectionDetailTypePrimaryKeyed = @"SelectionDetailTypePrimaryKeyedDetails"; NSString *SPSSHEnableMuxingPreference = @"SSHMultiplexingEnabled"; +NSString *SPSSHClientPath = @"SSHClientPath"; // URLs NSString *SPDonationsURL = @"http://www.sequelpro.com/donate/"; diff --git a/Source/SPNetworkPreferencePane.h b/Source/SPNetworkPreferencePane.h index dc99b3e2..37408c32 100644 --- a/Source/SPNetworkPreferencePane.h +++ b/Source/SPNetworkPreferencePane.h @@ -37,6 +37,16 @@ * * Network preference pane controller. */ -@interface SPNetworkPreferencePane : SPPreferencePane - +@interface SPNetworkPreferencePane : SPPreferencePane +{ + IBOutlet NSView *sshClientPickerView; + IBOutlet NSTextField *sshClientPath; + IBOutlet NSView *hiddenFileView; + +@private + NSAlert *_currentAlert; + NSOpenPanel *_currentFilePanel; +} +- (IBAction)pickSSHClientViaFileBrowser:(id)sender; +- (IBAction)pickSSHClient:(id)sender; @end diff --git a/Source/SPNetworkPreferencePane.m b/Source/SPNetworkPreferencePane.m index d3e2f52f..376ba39f 100644 --- a/Source/SPNetworkPreferencePane.m +++ b/Source/SPNetworkPreferencePane.m @@ -30,6 +30,10 @@ #import "SPNetworkPreferencePane.h" +@interface SPNetworkPreferencePane (Private) +- (void)updateHiddenFiles; +@end + @implementation SPNetworkPreferencePane #pragma mark - @@ -65,4 +69,66 @@ return NO; } +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if([SPHiddenKeyFileVisibilityKey isEqualTo:keyPath]) { + [self updateHiddenFiles]; + } +} + +- (void)updateHiddenFiles +{ + [_currentFilePanel setShowsHiddenFiles:[prefs boolForKey:SPHiddenKeyFileVisibilityKey]]; +} + +- (IBAction)pickSSHClientViaFileBrowser:(id)sender +{ + _currentFilePanel = [NSOpenPanel openPanel]; + [_currentFilePanel setCanChooseFiles:YES]; + [_currentFilePanel setCanChooseDirectories:NO]; + [_currentFilePanel setAllowsMultipleSelection:NO]; + [_currentFilePanel setAccessoryView:hiddenFileView]; + [self updateHiddenFiles]; + + [prefs addObserver:self + forKeyPath:SPHiddenKeyFileVisibilityKey + options:NSKeyValueObservingOptionNew + context:NULL]; + + [_currentFilePanel beginSheetModalForWindow:[_currentAlert window] completionHandler:^(NSInteger result) { + if(result == NSFileHandlingPanelOKButton) [sshClientPath setStringValue:[[_currentFilePanel URL] path]]; + + [prefs removeObserver:self forKeyPath:SPHiddenKeyFileVisibilityKey]; + + _currentFilePanel = nil; + }]; +} + +- (IBAction)pickSSHClient:(id)sender +{ + //take value from user defaults + NSString *oldPath = [prefs stringForKey:SPSSHClientPath]; + if([oldPath length]) [sshClientPath setStringValue:oldPath]; + + // set up dialog + _currentAlert = [[NSAlert alloc] init]; //needs to be ivar so we can attach the OpenPanel later + [_currentAlert setAccessoryView:sshClientPickerView]; + [_currentAlert setAlertStyle:NSWarningAlertStyle]; + [_currentAlert setMessageText:NSLocalizedString(@"Unsupported configuration!",@"Preferences : Network : Custom SSH client : warning dialog title")]; + [_currentAlert setInformativeText:NSLocalizedString(@"Sequel Pro only supports and is tested with the default OpenSSH client versions included with Mac OS X. Using different clients might cause connection issues, security risks or not work at all.\n\nPlease be aware, that we cannot provide support for such configurations.",@"Preferences : Network : Custom SSH client : warning dialog message")]; + [_currentAlert addButtonWithTitle:NSLocalizedString(@"OK",@"Preferences : Network : Custom SSH client : warning dialog : accept button")]; + [_currentAlert addButtonWithTitle:NSLocalizedString(@"Cancel",@"Preferences : Network : Custom SSH client : warning dialog : cancel button")]; + + if([_currentAlert runModal] == NSAlertFirstButtonReturn) { + //store new value to user defaults + NSString *newPath = [sshClientPath stringValue]; + if(![newPath length]) + [prefs removeObjectForKey:SPSSHClientPath]; + else + [prefs setObject:newPath forKey:SPSSHClientPath]; + } + + SPClear(_currentAlert); +} + @end diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index e09d0ce2..8e9ffb13 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -309,7 +309,20 @@ // Set up the NSTask task = [[NSTask alloc] init]; - [task setLaunchPath: @"/usr/bin/ssh"]; + NSString *launchPath = @"/usr/bin/ssh"; + NSString *userSSHPath = [[NSUserDefaults standardUserDefaults] stringForKey:SPSSHClientPath]; + + if([userSSHPath length]) { + launchPath = userSSHPath; + // And I'm sure we will get issue reports about it anyway! + [debugMessagesLock lock]; + [debugMessages addObject:@"################################################################"]; + [debugMessages addObject:[NSString stringWithFormat:@"# %@",NSLocalizedString(@"Custom SSH binary enabled. Disable in Preferences to rule out incompatibilities!", @"SSH connection : debug header with user-defined ssh binary")]]; + [debugMessages addObject:@"################################################################"]; + [debugMessagesLock unlock]; + } + + [task setLaunchPath:launchPath]; // Prepare to set up the arguments for the task taskArguments = [[NSMutableArray alloc] init]; @@ -413,11 +426,20 @@ object:[standardError fileHandleForReading]]; [[standardError fileHandleForReading] waitForDataInBackgroundAndNotify]; - // Launch and run the tunnel - [task launch]; - - // Listen for output - [task waitUntilExit]; + @try { + // Launch and run the tunnel + [task launch]; //throws for invalid paths, missing +x permission + + // Listen for output + [task waitUntilExit]; + } + @catch (NSException *e) { + connectionState = SPMySQLProxyLaunchFailed; + // Log the exception. Could be improved by showing a dedicated alert instead + [debugMessagesLock lock]; + [debugMessages addObject:[NSString stringWithFormat:@"%@: %@\n", [e name], [e reason]]]; + [debugMessagesLock unlock]; + } // On tunnel close, clean up, ready for re-use if the delegate reconnects. SPClear(task); -- cgit v1.2.3 From 6b32b225106245755e9fe4543e9eb4883cbb9c2b Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 21 Mar 2015 00:04:02 +0100 Subject: Allow to set SSL cipher list in SPMySQL --- .../Source/SPMySQLConnection Categories/Copying.m | 1 + Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h | 10 ++++++++++ Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m | 9 ++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m index 022708b8..32efa375 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m @@ -54,6 +54,7 @@ [copy setSocketPath:socketPath]; [copy setUseSSL:useSSL]; [copy setSslKeyFilePath:sslKeyFilePath]; + [copy setSslCipherList:sslCipherList]; [copy setSslCertificatePath:sslCertificatePath]; [copy setSslCACertificatePath:sslCACertificatePath]; [copy setTimeout:timeout]; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h index 34b21043..1720fcf6 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h @@ -51,6 +51,7 @@ NSString *sslKeyFilePath; NSString *sslCertificatePath; NSString *sslCACertificatePath; + NSString *sslCipherList; // MySQL connection details and state struct st_mysql *mySQLConnection; @@ -143,6 +144,15 @@ @property (readwrite, retain) NSString *sslCertificatePath; @property (readwrite, retain) NSString *sslCACertificatePath; +/** + * List of supported ciphers for SSL/TLS connections. + * This is a colon-separated string of names as used by + * `openssl ciphers`. The order of entries specifies + * their preference (earlier = better). + * A value of nil (default) means SPMySQL will use its built-in cipher list. + */ +@property (readwrite, retain) NSString *sslCipherList; + @property (readwrite, assign) NSUInteger timeout; @property (readwrite, assign) BOOL useKeepAlive; @property (readwrite, assign) CGFloat keepAliveInterval; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index 0d9d16ff..9fa5a9c8 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -65,6 +65,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS @synthesize sslKeyFilePath; @synthesize sslCertificatePath; @synthesize sslCACertificatePath; +@synthesize sslCipherList; @synthesize timeout; @synthesize useKeepAlive; @synthesize keepAliveInterval; @@ -217,6 +218,8 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS [proxy setConnectionStateChangeSelector:NULL delegate:nil]; [proxy release]; } + + [self setSslCipherList:nil]; // Ensure the query lock is unlocked, thereafter setting to nil in case of pending calls if ([connectionLock condition] != SPMySQLConnectionIdle) { @@ -546,6 +549,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS const char *theSSLKeyFilePath = NULL; const char *theSSLCertificatePath = NULL; const char *theCACertificatePath = NULL; + const char *theSSLCiphers = SPMySQLSSLPermissibleCiphers; if (sslKeyFilePath) { theSSLKeyFilePath = [[sslKeyFilePath stringByExpandingTildeInPath] UTF8String]; @@ -556,8 +560,11 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS if (sslCACertificatePath) { theCACertificatePath = [[sslCACertificatePath stringByExpandingTildeInPath] UTF8String]; } + if(sslCipherList) { + theSSLCiphers = [sslCipherList UTF8String]; + } - mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, SPMySQLSSLPermissibleCiphers); + mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, theSSLCiphers); } MYSQL *connectionStatus = mysql_real_connect(theConnection, theHost, theUsername, thePassword, NULL, (unsigned int)port, theSocket, SPMySQLConnectionOptions); -- cgit v1.2.3 From 1b6248d6a256ad774d092151227fdd5f40247c02 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 21 Mar 2015 02:25:59 +0100 Subject: Add code for using custom SSL cipher list in SP --- Source/SPConnectionHandler.m | 10 ++++++++++ Source/SPConstants.h | 1 + Source/SPConstants.m | 1 + 3 files changed, 12 insertions(+) diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index bac0c680..80e9c3f5 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -145,6 +145,16 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; if ([self sslCACertFileLocationEnabled]) { [mySQLConnection setSslCACertificatePath:[self sslCACertFileLocation]]; } + + NSString *userSSLCipherList = [prefs stringForKey:SPSSLCipherListKey]; + if(userSSLCipherList) { + //strip out disabled ciphers (e.g. in "foo:bar:--:baz") + NSRange markerPos = [userSSLCipherList rangeOfRegex:@":?--"]; + if(markerPos.location != NSNotFound) { + userSSLCipherList = [userSSLCipherList substringToIndex:markerPos.location]; + } + [mySQLConnection setSslCipherList:userSSLCipherList]; + } } // Connection delegate must be set before actual connection attempt is made diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 38e05cc5..f81b3fd0 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -429,6 +429,7 @@ extern NSString *SPSelectionDetailTypeIndexed; extern NSString *SPSelectionDetailTypePrimaryKeyed; extern NSString *SPSSHEnableMuxingPreference; extern NSString *SPSSHClientPath; +extern NSString *SPSSLCipherListKey; // URLs extern NSString *SPDonationsURL; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index fad42bc6..d9729980 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -230,6 +230,7 @@ NSString *SPSelectionDetailTypeIndexed = @"SelectionDetailTypeNSIndexS NSString *SPSelectionDetailTypePrimaryKeyed = @"SelectionDetailTypePrimaryKeyedDetails"; NSString *SPSSHEnableMuxingPreference = @"SSHMultiplexingEnabled"; NSString *SPSSHClientPath = @"SSHClientPath"; +NSString *SPSSLCipherListKey = @"SSLCipherList"; // URLs NSString *SPDonationsURL = @"http://www.sequelpro.com/donate/"; -- cgit v1.2.3 From ea39be538d4726b583e67748d6e3e7ffb0ce9026 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 21 Mar 2015 03:05:33 +0100 Subject: Add UI for custom SSL cipher lists See Preferences > Network. Note: If you play around with that too much and libmysql can no longer connect, don't hope for a meaningful error. It will rather be something like "protocol version mismatch". --- Interfaces/English.lproj/Preferences.xib | 665 ++++++++++++++++++++++++------- Resources/Images/reset.pdf | Bin 0 -> 1765 bytes Source/SPNetworkPreferencePane.h | 5 +- Source/SPNetworkPreferencePane.m | 195 +++++++++ sequel-pro.xcodeproj/project.pbxproj | 4 + 5 files changed, 724 insertions(+), 145 deletions(-) create mode 100644 Resources/Images/reset.pdf diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index b39ec8a5..6839a930 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -194,7 +194,7 @@ 6 System textBackgroundColor - + 3 MQA @@ -2513,39 +2513,218 @@ AQAAAAA 268 - + 268 - {{224, 19}, {222, 19}} + {{226, 22}, {32, 25}} - + + _NS:22 + YES + + -2080374784 + 134217728 + + + _NS:22 + + -2033434624 + 162 + + NSImage + reset + + + + 400 + 75 + + NO + + + + 289 + {{264, 20}, {298, 28}} + + + + _NS:526 + {251, 750} + YES + + 67108864 + 272629760 + Drag the items in the list to reorder their preference and/or disable them. + + _NS:526 + + + + + NO + YES + 404 + 1 + + + + 276 + + + + 2322 + + + + 256 + + {332, 126} + + + + _NS:13 + YES + NO + YES + + + -2147483392 + {15, 20} + _NS:19 + + + + 329 + 40 + 1000 + + 75497536 + 2048 + Cipher Suite + + + 6 + System + headerColor + + + + + + 337641537 + 2048 + Text Cell + + + + + + 3 + YES + + + + 3 + 2 + + + 17 + 448790528 + + + 4 + -1 + 0 + YES + 0 + 1 + + + {{1, 1}, {332, 126}} + + + + _NS:11 + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + _NS:65 + NO + + _doScroller: + 0.99212598425196852 + + + + -2147483392 + {{1, 119}, {223, 15}} + + + + _NS:61 + NO + 1 + + _doScroller: + 0.99699699699699695 + + + {{226, 56}, {334, 128}} + + + + _NS:9 + 133682 + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + + 268 + {{224, 204}, {222, 19}} + + + _NS:526 {251, 750} YES - + 67108928 272632320 /path/to/ssh/binary _NS:526 - + NO 1 - + 268 - {{452, 19}, {109, 19}} + {{452, 204}, {109, 19}} - + _NS:9 YES - + -2080374784 134217728 Change… @@ -2555,7 +2734,7 @@ AQAAAAA 2586 _NS:9 - + -2038153216 164 @@ -2565,20 +2744,40 @@ AQAAAAA NO - + 268 - {{16, 19}, {204, 19}} + {{16, 165}, {204, 19}} - + YES - + + 67108928 + 71304192 + SSL Cipher Suites: + + + + + + NO + 1 + + + + 268 + {{16, 204}, {204, 19}} + + + + YES + 67108928 71304192 SSH Client: - + @@ -2588,7 +2787,7 @@ AQAAAAA 268 - {{17, 90}, {204, 17}} + {{17, 275}, {204, 17}} @@ -2608,10 +2807,10 @@ AQAAAAA 268 - {{224, 53}, {338, 18}} + {{224, 238}, {338, 18}} - + YES -2080374784 @@ -2633,7 +2832,7 @@ AQAAAAA 268 - {{226, 88}, {50, 22}} + {{226, 273}, {50, 22}} @@ -2687,7 +2886,7 @@ AQAAAAA 268 - {{281, 91}, {282, 17}} + {{281, 276}, {282, 17}} @@ -2704,13 +2903,37 @@ AQAAAAA NO 1 - + + + 12 + {{226, 193}, {334, 5}} + + + + {0, 0} + + 67108864 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + 12 - {{226, 44}, {334, 5}} + {{226, 229}, {334, 5}} - + {0, 0} 67108864 @@ -2731,7 +2954,7 @@ AQAAAAA 12 - {{226, 77}, {334, 5}} + {{226, 262}, {334, 5}} @@ -2753,14 +2976,14 @@ AQAAAAA NO - {580, 127} + {580, 312} NSView - + 268 @@ -2768,7 +2991,6 @@ AQAAAAA 268 {{469, 291}, {15, 22}} - YES @@ -2789,7 +3011,6 @@ AQAAAAA 268 {{439, 293}, {23, 19}} - YES @@ -2847,7 +3068,6 @@ AQAAAAA 268 {{270, 294}, {162, 18}} - YES @@ -2872,7 +3092,6 @@ AQAAAAA 268 {{144, 24}, {101, 14}} - YES @@ -2892,7 +3111,6 @@ AQAAAAA 268 {{49, 24}, {93, 14}} - YES @@ -2920,7 +3138,6 @@ AQAAAAA 256 {220, 286} - YES NO @@ -3006,7 +3223,6 @@ AQAAAAA {{1, 1}, {220, 286}} - @@ -3017,7 +3233,6 @@ AQAAAAA -2147483392 {{-100, -100}, {15, 102}} - NO @@ -3029,7 +3244,6 @@ AQAAAAA -2147483392 {{-100, -100}, {223, 15}} - NO 1 @@ -3040,7 +3254,6 @@ AQAAAAA {{20, 50}, {222, 288}} - 133122 @@ -3056,7 +3269,6 @@ AQAAAAA 268 {{20, 19}, {24, 24}} - YES @@ -3181,7 +3393,6 @@ AQAAAAA 268 {{439, 20}, {23, 19}} - YES @@ -3240,7 +3451,6 @@ AQAAAAA 268 {{269, 22}, {164, 16}} - YES @@ -3260,8 +3470,6 @@ AQAAAAA 268 {{469, 18}, {15, 22}} - - YES 67895328 @@ -3281,7 +3489,6 @@ AQAAAAA 268 {{17, 362}, {182, 17}} - YES @@ -3301,7 +3508,6 @@ AQAAAAA 268 {{433, 353}, {133, 32}} - YES @@ -3324,7 +3530,6 @@ AQAAAAA 268 {{204, 360}, {207, 22}} - YES @@ -3345,7 +3550,6 @@ AQAAAAA 268 {{270, 322}, {292, 18}} - YES @@ -3370,7 +3574,6 @@ AQAAAAA 268 {{270, 267}, {292, 18}} - YES @@ -3395,7 +3598,6 @@ AQAAAAA 268 {{270, 209}, {292, 18}} - YES @@ -3420,7 +3622,6 @@ AQAAAAA 268 {{270, 238}, {292, 18}} - YES @@ -3445,7 +3646,6 @@ AQAAAAA 268 {{270, 162}, {292, 18}} - YES @@ -3470,7 +3670,6 @@ AQAAAAA 268 {{270, 51}, {292, 18}} - YES @@ -3495,7 +3694,6 @@ AQAAAAA 268 {{270, 79}, {292, 18}} - YES @@ -3520,7 +3718,6 @@ AQAAAAA 268 {{270, 134}, {292, 18}} - YES @@ -3545,7 +3742,6 @@ AQAAAAA 268 {{370, 109}, {29, 19}} - YES @@ -3604,7 +3800,6 @@ AQAAAAA 268 {{269, 111}, {96, 14}} - YES @@ -3624,7 +3819,6 @@ AQAAAAA 268 {{405, 107}, {15, 22}} - YES @@ -3645,7 +3839,6 @@ AQAAAAA 268 {{423, 111}, {140, 14}} - YES @@ -3665,7 +3858,6 @@ AQAAAAA -2147483380 {{269, 1}, {292, 18}} - YES @@ -3690,7 +3882,6 @@ AQAAAAA 268 {{370, 184}, {29, 19}} - YES @@ -3749,7 +3940,6 @@ AQAAAAA 268 {{269, 186}, {96, 14}} - YES @@ -3769,7 +3959,6 @@ AQAAAAA 268 {{405, 182}, {15, 22}} - YES @@ -3790,7 +3979,6 @@ AQAAAAA 268 {{423, 186}, {140, 14}} - YES @@ -3810,7 +3998,6 @@ AQAAAAA 12 {{204, 349}, {356, 5}} - {0, 0} @@ -3831,8 +4018,6 @@ AQAAAAA {580, 400} - - NSView @@ -4073,26 +4258,26 @@ AQAAAAA - + 268 - - + + 268 {{275, 16}, {135, 32}} - + - + _NS:9 YES - + 67108864 134217728 Change… _NS:9 - + -2038284288 129 @@ -4102,23 +4287,23 @@ AQAAAAA NO - - + + 268 {{-2, 0}, {408, 14}} - + _NS:526 {251, 750} YES - + 67108864 272629760 Enter the full absolute path to your SSH binary. _NS:526 - + @@ -4126,23 +4311,23 @@ AQAAAAA YES 1 - - + + 268 {{0, 22}, {273, 22}} - + - + _NS:9 YES - + -1804599231 272630784 System default _NS:9 - + YES @@ -4154,28 +4339,28 @@ AQAAAAA {404, 44} - + _NS:9 - + 268 - - + + 266 {{18, 18}, {273, 18}} - + YES - + 67108864 0 Show hidden files - + 1211912448 2 @@ -4191,7 +4376,7 @@ AQAAAAA {309, 54} - + _NS:9 @@ -5687,7 +5872,7 @@ AQAAAAA sshClientPickerView - + gUn-jl-Tfb @@ -5695,7 +5880,7 @@ AQAAAAA sshClientPath - + eUn-5b-NBa @@ -5703,7 +5888,7 @@ AQAAAAA pickSSHClient: - + zcA-5j-KFq @@ -5711,7 +5896,7 @@ AQAAAAA pickSSHClientViaFileBrowser: - + w0e-lI-UbS @@ -5719,10 +5904,26 @@ AQAAAAA hiddenFileView - + r1S-eS-uJK + + + sslCipherView + + + + pF5-VG-sY0 + + + + resetCipherList: + + + + czy-4m-Kuo + value: values.CustomQuerySoftIndent @@ -5886,10 +6087,10 @@ AQAAAAA value: values.SSHClientPath - + - + value: values.SSHClientPath value @@ -5903,13 +6104,29 @@ AQAAAAA 89d-3h-dgq + + + dataSource + + + + rQW-7Y-Mrg + + + + delegate + + + + ptn-Zs-Gd6 + value: values.KeySelectionHiddenFilesVisibility - + - + value: values.KeySelectionHiddenFilesVisibility value @@ -5925,6 +6142,26 @@ AQAAAAA WP6-C7-FqP + + + enabled: values.SSLCipherList + + + + + + enabled: values.SSLCipherList + enabled + values.SSLCipherList + + NSValueTransformerName + NSIsNotNil + + 2 + + + 8HU-V9-I2q + value: values.SPCustomQueryEditorCompleteWithBackticks @@ -6597,10 +6834,15 @@ AQAAAAA - - - - + + + + + + + + + Network @@ -8114,119 +8356,204 @@ AQAAAAA HWX-AV-xGx - + 9CM-2a-2JU - + - + 4Us-KF-Ysj - - + + Rsg-4x-YV2 - + - + MhF-tS-nrE - - + + GcY-yy-sZn - + - + 29D-bG-y15 - - + + D6L-76-0Ik - + - - - + + + Pick SSH client binary Accessory View yQV-9I-7us - + - + - + eS9-G4-zgt - - + + ZHD-xB-ee1 - + - + - + yLf-F5-exv - - + + hEB-5Q-jZ8 - + - + - + 1nt-aH-gM4 - - + + GEn-6y-U3F - + - + Show Hidden Files Accessory View bAQ-gF-4V2 - + - + - + apR-gz-ej3 - - + + + + + 3Fg-G1-BWj + + + + + 4Aw-q4-73u + + + + + + + + PDB-0g-8jg + + + + + 9lg-Fd-6u7 + + + + + + + + + + RuH-Yq-cdH + + + + + + + + ZqJ-4c-bqV + + + + + fcH-lG-egx + + + + + 2w5-RF-2LR + + + + + + + + NtR-tj-yZm + + + + + TG6-Q3-g30 + + + + + + + + Ukm-oW-lSS + + + + + jJw-LF-gtW + + + + + + + + 7JN-Nf-GsD + + @@ -8522,6 +8849,7 @@ AQAAAAA 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 @@ -8535,6 +8863,7 @@ AQAAAAA 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 @@ -8545,6 +8874,19 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + VGhlIGNpcGhlciBzdWl0ZXMgYXJlIHVzZWQgZm9yIFNTTC9UTFMtc2VjdXJlZCBjb25uZWN0aW9ucyBh +bmQgc3BlY2lmeSB3aGljaCBhbGdvcml0aG1zIFNlcXVlbCBQcm8gd2lsbCB1c2UgdG8gZW5jcnlwdCBh +IGNvbm5lY3Rpb24sIGFzIHdlbGwgYXMgdGhlaXIgcHJlZmVyZW5jZS4gCldhcm5pbmc6IElmIFNlcXVl +bCBQcm8gYW5kIHRoZSBzZXJ2ZXIgZG8gbm90IGhhdmUgYXQgbGVhc3Qgb25lIGNpcGhlciBzdWl0ZSBp +biBjb21tb24sIHlvdSB3aWxsIG5vIGxvbmdlciBiZSBhYmxlIHRvIGNvbm5lY3QhA + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8615,7 +8957,7 @@ AQAAAAA - {-460, 486.5} + {-458, 578} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8663,6 +9005,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8689,6 +9032,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {-482, -2} com.apple.InterfaceBuilder.CocoaPlugin @@ -8700,15 +9044,32 @@ AQAAAAA 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 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Reset the cipher list to the default configuration + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8993,6 +9354,7 @@ AQAAAAA id id + id @@ -9003,11 +9365,16 @@ AQAAAAA pickSSHClientViaFileBrowser: id + + resetCipherList: + id + NSView NSTextField NSView + NSTableView @@ -9022,6 +9389,10 @@ AQAAAAA sshClientPickerView NSView + + sslCipherView + NSTableView + IBProjectSource @@ -9033,6 +9404,7 @@ AQAAAAA id id + id @@ -9043,6 +9415,10 @@ AQAAAAA pickSSHClientViaFileBrowser: id + + resetCipherList: + id + IBProjectSource @@ -9524,6 +9900,7 @@ AQAAAAA {10, 23} {33, 23} {32, 23} + {16, 16} diff --git a/Resources/Images/reset.pdf b/Resources/Images/reset.pdf new file mode 100644 index 00000000..2ac66017 Binary files /dev/null and b/Resources/Images/reset.pdf differ diff --git a/Source/SPNetworkPreferencePane.h b/Source/SPNetworkPreferencePane.h index 37408c32..d980f175 100644 --- a/Source/SPNetworkPreferencePane.h +++ b/Source/SPNetworkPreferencePane.h @@ -37,16 +37,19 @@ * * Network preference pane controller. */ -@interface SPNetworkPreferencePane : SPPreferencePane +@interface SPNetworkPreferencePane : SPPreferencePane { IBOutlet NSView *sshClientPickerView; IBOutlet NSTextField *sshClientPath; IBOutlet NSView *hiddenFileView; + IBOutlet NSTableView *sslCipherView; @private NSAlert *_currentAlert; NSOpenPanel *_currentFilePanel; + NSMutableArray *sslCiphers; } - (IBAction)pickSSHClientViaFileBrowser:(id)sender; - (IBAction)pickSSHClient:(id)sender; +- (IBAction)resetCipherList:(id)sender; @end diff --git a/Source/SPNetworkPreferencePane.m b/Source/SPNetworkPreferencePane.m index 376ba39f..4f13c433 100644 --- a/Source/SPNetworkPreferencePane.m +++ b/Source/SPNetworkPreferencePane.m @@ -30,12 +30,33 @@ #import "SPNetworkPreferencePane.h" +static NSString *SPSSLCipherListMarkerItem = @"--"; +static NSString *SPSSLCipherPboardTypeName = @"SSLCipherPboardType"; + @interface SPNetworkPreferencePane (Private) - (void)updateHiddenFiles; +- (void)loadSSLCiphers; +- (void)storeSSLCiphers; ++ (NSArray *)defaultSSLCipherList; @end @implementation SPNetworkPreferencePane +- (instancetype)init +{ + self = [super init]; + if (self) { + sslCiphers = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)dealloc +{ + SPClear(sslCiphers); + [super dealloc]; +} + #pragma mark - #pragma mark Preference pane protocol methods @@ -69,6 +90,16 @@ return NO; } +- (void)preferencePaneWillBeShown +{ + [self loadSSLCiphers]; + if(![[sslCipherView registeredDraggedTypes] containsObject:SPSSLCipherPboardTypeName]) + [sslCipherView registerForDraggedTypes:@[SPSSLCipherPboardTypeName]]; +} + +#pragma mark - +#pragma mark Custom SSH client methods + - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if([SPHiddenKeyFileVisibilityKey isEqualTo:keyPath]) { @@ -131,4 +162,168 @@ SPClear(_currentAlert); } +#pragma mark - +#pragma mark SSL cipher list methods + +- (void)loadSSLCiphers +{ + NSArray *supportedCiphers = [SPNetworkPreferencePane defaultSSLCipherList]; + [sslCiphers removeAllObjects]; + + NSString *userCipherString = [prefs stringForKey:SPSSLCipherListKey]; + if(userCipherString) { + //expand user list + NSArray *userCipherList = [userCipherString componentsSeparatedByString:@":"]; + + //compare the users list to the valid list and only copy over valid items + for (NSString *userCipher in userCipherList) { + if (![supportedCiphers containsObject:userCipher] || [sslCiphers containsObject:userCipher]) { + SPLog(@"Unknown ssl cipher in users' list: %@",userCipher); + continue; + } + [sslCiphers addObject:userCipher]; + } + + //now we do the reverse and add valid ciphers that are not yet in the users list. + //We'll just assume the ones not in the users' list are newer and therefore better and add + //them at the top + NSUInteger shift = 0; + for (NSString *validCipher in supportedCiphers) { + if(![sslCiphers containsObject:validCipher]) { + [sslCiphers insertObject:validCipher atIndex:shift++]; + } + } + } + else { + //no user prefs configured, so we'll just go with the defaults + [sslCiphers addObjectsFromArray:supportedCiphers]; + } + + //reload UI + [sslCipherView deselectAll:nil]; + [sslCipherView reloadData]; +} + +- (void)storeSSLCiphers +{ + NSString *flattedList = [sslCiphers componentsJoinedByString:@":"]; + [prefs setObject:flattedList forKey:SPSSLCipherListKey]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView +{ + return [sslCiphers count]; +} + +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ + NSString *value = [sslCiphers objectAtIndex:rowIndex]; + if ([value isEqualTo:SPSSLCipherListMarkerItem]) { + return NSLocalizedString(@"Disabled Cipher Suites", @"Preferences : Network : SSL Chiper suites : List seperator"); + } + return value; +} + +- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row +{ + return ([[sslCiphers objectAtIndex:row] isEqualTo:SPSSLCipherListMarkerItem]); +} + +- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row +{ + return ![self tableView:tableView isGroupRow:row]; +} + +- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id )info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation +{ + if(row < 0) return NO; //why is that even a signed int when all "indexes" are unsigned!? + + NSPasteboard *pboard = [info draggingPasteboard]; + NSArray *draggedItems = [NSKeyedUnarchiver unarchiveObjectWithData:[pboard dataForType:SPSSLCipherPboardTypeName]]; + + NSUInteger nextInsert = row; + for (NSString *item in draggedItems) { + NSUInteger oldPos = [sslCiphers indexOfObject:item]; + [sslCiphers removeObjectAtIndex:oldPos]; + + if(oldPos < (NSUInteger)row) { + // readjust position because we removed an object further up in the list, shifting all following indexes down by 1 + nextInsert--; + } + + [sslCiphers insertObject:item atIndex:nextInsert++]; + } + + NSMutableIndexSet *newSelection = [NSMutableIndexSet indexSet]; + for (NSString *item in draggedItems) { + [newSelection addIndex:[sslCiphers indexOfObject:item]]; + } + + [self storeSSLCiphers]; + [sslCipherView selectRowIndexes:newSelection byExtendingSelection:NO]; + + return YES; +} + +- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id )info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation +{ + //cannot drop something on another item in the list, only between them + return (operation == NSTableViewDropOn)? NSDragOperationNone : NSDragOperationMove; +} + +- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard +{ + //the marker cannot be actively reordered + if ([rowIndexes containsIndex:[sslCiphers indexOfObject:SPSSLCipherListMarkerItem]]) + return NO; + + //put the names of the items on the pasteboard. easier to work with than indexes... + NSMutableArray *items = [NSMutableArray arrayWithCapacity:[rowIndexes count]]; + [rowIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + [items addObject:[sslCiphers objectAtIndex:idx]]; + }]; + + NSData *arch = [NSKeyedArchiver archivedDataWithRootObject:items]; + [pboard declareTypes:@[SPSSLCipherPboardTypeName] owner:self]; + [pboard setData:arch forType:SPSSLCipherPboardTypeName]; + return YES; +} + +- (IBAction)resetCipherList:(id)sender +{ + //remove the user pref and reset the GUI + [prefs removeObjectForKey:SPSSLCipherListKey]; + [self loadSSLCiphers]; +} + ++ (NSArray *)defaultSSLCipherList +{ + //this is the default list as hardcoded in SPMySQLConnection.m + //Sadly there is no way to make MySQL give us the list of runtime-supported ciphers. + return @[@"DHE-RSA-AES256-SHA", + @"AES256-SHA", + @"DHE-RSA-AES128-SHA", + @"AES128-SHA", + @"AES256-RMD", + @"AES128-RMD", + @"DES-CBC3-RMD", + @"DHE-RSA-AES256-RMD", + @"DHE-RSA-AES128-RMD", + @"DHE-RSA-DES-CBC3-RMD", + @"RC4-SHA", + @"RC4-MD5", + @"DES-CBC3-SHA", + @"DES-CBC-SHA", + @"EDH-RSA-DES-CBC3-SHA", + @"EDH-RSA-DES-CBC-SHA", + SPSSLCipherListMarkerItem, //marker. disabled items below here + @"EDH-DSS-DES-CBC-SHA", + @"EDH-DSS-DES-CBC3-SHA", + @"DHE-DSS-AES128-SHA", + @"DHE-DSS-AES256-SHA", + @"DHE-DSS-DES-CBC3-RMD", + @"DHE-DSS-AES128-RMD", + @"DHE-DSS-AES256-RMD"]; +} + @end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index ccbb99e5..195bf5df 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -195,6 +195,7 @@ 50EA92681AB23EFC008D3C4F /* SPTableCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1141A388117BBFF200126A28 /* SPTableCopy.m */; }; 50EA926A1AB246B8008D3C4F /* SPDatabaseActionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */; }; 50EAB5B81A8FBB08008F627A /* SPOSInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */; }; + 50F530521ABCF66B002F2C1A /* reset.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 50F530511ABCF66B002F2C1A /* reset.pdf */; }; 5806B76411A991EC00813A88 /* SPDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806B76311A991EC00813A88 /* SPDocumentController.m */; }; 580E8DB711EA774B000D8427 /* SequelProTabClose_Pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 580E8DAB11EA772C000D8427 /* SequelProTabClose_Pressed.png */; }; 580E8DB811EA774B000D8427 /* SequelProTabClose_Rollover.png in Resources */ = {isa = PBXBuildFile; fileRef = 580E8DAC11EA772C000D8427 /* SequelProTabClose_Rollover.png */; }; @@ -904,6 +905,7 @@ 50EA92691AB246B8008D3C4F /* SPDatabaseActionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseActionTest.m; sourceTree = ""; }; 50EAB5B61A8FBB08008F627A /* SPOSInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPOSInfo.h; sourceTree = ""; }; 50EAB5B71A8FBB08008F627A /* SPOSInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPOSInfo.m; sourceTree = ""; }; + 50F530511ABCF66B002F2C1A /* reset.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = reset.pdf; sourceTree = ""; }; 5806B76211A991EC00813A88 /* SPDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDocumentController.h; sourceTree = ""; }; 5806B76311A991EC00813A88 /* SPDocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDocumentController.m; sourceTree = ""; }; 580E8DAB11EA772C000D8427 /* SequelProTabClose_Pressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SequelProTabClose_Pressed.png; sourceTree = ""; }; @@ -2161,6 +2163,7 @@ 384582C60FB9603600DDACB6 /* proc-small.png */, 58F48AA2161D03C6008536A1 /* quick-connect-icon.pdf */, 58F48B2D161D08C0008536A1 /* quick-connect-icon-white.pdf */, + 50F530511ABCF66B002F2C1A /* reset.pdf */, 582E946F16837DB2003459FD /* showconsole.png */, 588B2CC50FE5641E00EC5FC0 /* ssh-connected.png */, 588B2CC60FE5641E00EC5FC0 /* ssh-connecting.png */, @@ -2983,6 +2986,7 @@ 582E940216829B0A003459FD /* button_bar_handle.png in Resources */, 582E940E1682A2AD003459FD /* button_bar_spacer@2x.png in Resources */, 582E94161682A463003459FD /* button_clear.png in Resources */, + 50F530521ABCF66B002F2C1A /* reset.pdf in Resources */, 582E94181682A4B4003459FD /* button_duplicate.png in Resources */, 582E941F16835DD4003459FD /* button_edit_mode_selected.png in Resources */, 582E942016835DD4003459FD /* button_edit_mode.png in Resources */, -- cgit v1.2.3 From 9fd78af55a55a8a5a976a6b6f31839439cc28241 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 24 Mar 2015 21:15:03 +0100 Subject: Disable editing columns in "Display in Hex" mode This is a workaround for a potential data loss/corruption bug until we really fix this (see #1876) --- Source/SPTableContentDelegate.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index b73282ec..19bbc4b3 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -261,11 +261,12 @@ [tableContentView reloadData]; } + // Retrieve the column definition + NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]]; + // Open the editing sheet if required if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) { - // Retrieve the column definition - NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]]; BOOL isBlob = [tableDataInstance columnIsBlobOrText:[[tableColumn headerCell] stringValue]]; // A table is per definition editable @@ -318,6 +319,7 @@ if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { [fieldEditor setTextMaxLength:[[self tableView:tableContentView objectValueForTableColumn:tableColumn row:rowIndex] length]]; + isFieldEditable = NO; } NSInteger editedColumn = 0; @@ -345,6 +347,13 @@ return NO; } + // TODO: Fix editing of "Display as Hex" columns and remove this (also see above) + if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { + NSBeep(); + [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")]; + return NO; + } + return YES; } -- cgit v1.2.3 From 34383efe75a6f655522c9cb6385b3cb97cd99e3c Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 25 Mar 2015 20:22:29 +0100 Subject: Fix an issue with certain tooltips being placed on the wrong screen in certain multi screen configurations This did affect users with a vertical multi monitor setup using the classical (single Space) multi monitor mode. --- Source/SPTooltip.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m index 0a7597f5..478945ed 100644 --- a/Source/SPTooltip.m +++ b/Source/SPTooltip.m @@ -320,8 +320,11 @@ static CGFloat slow_in_out (CGFloat t) NSScreen* candidate; for(candidate in [NSScreen screens]) { - if(NSMinX([candidate frame]) < pos.x && NSMinX([candidate frame]) > NSMinX(screenFrame)) - screenFrame = [candidate frame]; + NSRect cf = [candidate frame]; + if(NSPointInRect(pos,cf)) { + screenFrame = cf; + break; + } } // is contentView a webView calculate actual rendered size via JavaScript -- cgit v1.2.3 From 01dd6402ee530e5d9fff1916507ea287893f0960 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Apr 2015 17:51:00 +0200 Subject: Some code reformatting --- Source/SPTableContentDataSource.m | 199 +++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 102 deletions(-) diff --git a/Source/SPTableContentDataSource.m b/Source/SPTableContentDataSource.m index c7af81be..21422865 100644 --- a/Source/SPTableContentDataSource.m +++ b/Source/SPTableContentDataSource.m @@ -54,96 +54,92 @@ if (tableView == filterTableView) { return filterTableIsSwapped ? [filterTableData count] : [[[filterTableData objectForKey:@"0"] objectForKey:SPTableContentFilterKey] count]; } - else #endif - if (tableView == tableContentView) { - return tableRowsCount; - } + if (tableView == tableContentView) { + return tableRowsCount; + } return 0; } - (id)tableView:(SPCopyTable *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { + NSUInteger columnIndex = [[tableColumn identifier] integerValue]; #ifndef SP_CODA if (tableView == filterTableView) { - if (filterTableIsSwapped) - + if (filterTableIsSwapped) { // First column shows the field names - if ([[tableColumn identifier] integerValue] == 0) { + if (columnIndex == 0) { return [[[NSTableHeaderCell alloc] initTextCell:[[filterTableData objectForKey:[NSNumber numberWithInteger:rowIndex]] objectForKey:@"name"]] autorelease]; } - else { - return NSArrayObjectAtIndex([[filterTableData objectForKey:[NSNumber numberWithInteger:rowIndex]] objectForKey:SPTableContentFilterKey], [[tableColumn identifier] integerValue] - 1); - } - else { - return NSArrayObjectAtIndex([[filterTableData objectForKey:[tableColumn identifier]] objectForKey:SPTableContentFilterKey], rowIndex); + + return NSArrayObjectAtIndex([[filterTableData objectForKey:[NSNumber numberWithInteger:rowIndex]] objectForKey:SPTableContentFilterKey], columnIndex - 1); } + + return NSArrayObjectAtIndex([[filterTableData objectForKey:[tableColumn identifier]] objectForKey:SPTableContentFilterKey], rowIndex); } - else #endif - if (tableView == tableContentView) { - - id value = nil; - NSUInteger columnIndex = [[tableColumn identifier] integerValue]; + if (tableView == tableContentView) { + + id value = nil; + + // While the table is being loaded, additional validation is required - data + // locks must be used to avoid crashes, and indexes higher than the available + // rows or columns may be requested. Return "..." to indicate loading in these + // cases. + if (isWorking) { + pthread_mutex_lock(&tableValuesLock); - // While the table is being loaded, additional validation is required - data - // locks must be used to avoid crashes, and indexes higher than the available - // rows or columns may be requested. Return "..." to indicate loading in these - // cases. - if (isWorking) { - pthread_mutex_lock(&tableValuesLock); - - if (rowIndex < (NSInteger)tableRowsCount && columnIndex < [tableValues columnCount]) { - value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; - } - - pthread_mutex_unlock(&tableValuesLock); - - if (!value) return @"..."; - } - else { - if ([tableView editedColumn] == (NSInteger)columnIndex && [tableView editedRow] == rowIndex) { - value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:NO]; - } - else { - value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; - } + if (rowIndex < (NSInteger)tableRowsCount && columnIndex < [tableValues columnCount]) { + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; } - - NSDictionary *columnDefinition = [[(id )[tableContentView delegate] dataColumnDefinitions] objectAtIndex:columnIndex]; - - NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; - if ([value isKindOfClass:[SPMySQLGeometryData class]]) { - return [value wktString]; - } + pthread_mutex_unlock(&tableValuesLock); - if ([value isNSNull]) { - return [prefs objectForKey:SPNullValue]; + if (!value) return @"..."; + } + else { + if ([tableView editedColumn] == (NSInteger)columnIndex && [tableView editedRow] == rowIndex) { + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:NO]; } - - if ([value isKindOfClass:[NSData class]]) { + else { + value = [self _contentValueForTableColumn:columnIndex row:rowIndex asPreview:YES]; + } + } - if ([columnType isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { - return [NSString stringWithFormat:@"0x%@", [value dataToHexString]]; - } + NSDictionary *columnDefinition = [[(id )[tableContentView delegate] dataColumnDefinitions] objectAtIndex:columnIndex]; - pthread_mutex_t *fieldEditorCheckLock = NULL; - if (isWorking) { - fieldEditorCheckLock = &tableValuesLock; - } + NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; + + if ([value isKindOfClass:[SPMySQLGeometryData class]]) { + return [value wktString]; + } + + if ([value isNSNull]) { + return [prefs objectForKey:SPNullValue]; + } + + if ([value isKindOfClass:[NSData class]]) { - // Always retrieve the short string representation, truncating the value where necessary - return [value shortStringRepresentationUsingEncoding:[mySQLConnection stringEncoding]]; + if ([columnType isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { + return [NSString stringWithFormat:@"0x%@", [value dataToHexString]]; } - - if ([value isSPNotLoaded]) { - return NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields"); + + pthread_mutex_t *fieldEditorCheckLock = NULL; + if (isWorking) { + fieldEditorCheckLock = &tableValuesLock; } - - return value; + + // Always retrieve the short string representation, truncating the value where necessary + return [value shortStringRepresentationUsingEncoding:[mySQLConnection stringEncoding]]; + } + + if ([value isSPNotLoaded]) { + return NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields"); } + + return value; + } return nil; } @@ -163,49 +159,48 @@ return; } - else #endif - if (tableView == tableContentView) { - - // If the current cell should have been edited in a sheet, do nothing - field closing will have already - // updated the field. - if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) { - return; - } - - // If table data comes from a view, save back to the view - if ([tablesListInstance tableType] == SPTableTypeView) { - [self saveViewCellValue:object forTableColumn:tableColumn row:rowIndex]; - return; - } - - // Catch editing events in the row and if the row isn't currently being edited, - // start an edit. This allows edits including enum changes to save correctly. - if (isEditingRow && [tableContentView selectedRow] != currentlyEditingRow) { - [self saveRowOnDeselect]; - } + if (tableView == tableContentView) { + + // If the current cell should have been edited in a sheet, do nothing - field closing will have already + // updated the field. + if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) { + return; + } + + // If table data comes from a view, save back to the view + if ([tablesListInstance tableType] == SPTableTypeView) { + [self saveViewCellValue:object forTableColumn:tableColumn row:rowIndex]; + return; + } + + // Catch editing events in the row and if the row isn't currently being edited, + // start an edit. This allows edits including enum changes to save correctly. + if (isEditingRow && [tableContentView selectedRow] != currentlyEditingRow) { + [self saveRowOnDeselect]; + } + + if (!isEditingRow) { + [oldRow setArray:[tableValues rowContentsAtIndex:rowIndex]]; - if (!isEditingRow) { - [oldRow setArray:[tableValues rowContentsAtIndex:rowIndex]]; - - isEditingRow = YES; - currentlyEditingRow = rowIndex; + isEditingRow = YES; + currentlyEditingRow = rowIndex; + } + + NSDictionary *column = NSArrayObjectAtIndex(dataColumns, [[tableColumn identifier] integerValue]); + + if (object) { + // Restore NULLs if necessary + if ([object isEqualToString:[prefs objectForKey:SPNullValue]] && [[column objectForKey:@"null"] boolValue]) { + object = [NSNull null]; } - NSDictionary *column = NSArrayObjectAtIndex(dataColumns, [[tableColumn identifier] integerValue]); - - if (object) { - // Restore NULLs if necessary - if ([object isEqualToString:[prefs objectForKey:SPNullValue]] && [[column objectForKey:@"null"] boolValue]) { - object = [NSNull null]; - } - - [tableValues replaceObjectInRow:rowIndex column:[[tableColumn identifier] integerValue] withObject:object]; - } - else { - [tableValues replaceObjectInRow:rowIndex column:[[tableColumn identifier] integerValue] withObject:@""]; - } + [tableValues replaceObjectInRow:rowIndex column:[[tableColumn identifier] integerValue] withObject:object]; + } + else { + [tableValues replaceObjectInRow:rowIndex column:[[tableColumn identifier] integerValue] withObject:@""]; } + } } @end -- cgit v1.2.3 From bdf196ac60472fa7eccbd094ee1b5a505f550f4d Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Apr 2015 23:33:38 +0200 Subject: Remove a hack to support QuickLook on 10.5 We don't need that anymore since 10.5 support is gone. Sequel Pro now explicitly links Quartz and doesn't try to guess QuickLook support at runtime. --- Source/QLPreviewPanel.h | 119 ------------------------------- Source/SPFieldEditorController.h | 21 +++++- Source/SPFieldEditorController.m | 133 ++++++++--------------------------- Source/SPTableContent.m | 1 - sequel-pro.xcodeproj/project.pbxproj | 14 ++-- 5 files changed, 53 insertions(+), 235 deletions(-) delete mode 100644 Source/QLPreviewPanel.h diff --git a/Source/QLPreviewPanel.h b/Source/QLPreviewPanel.h deleted file mode 100644 index 7c342ed9..00000000 --- a/Source/QLPreviewPanel.h +++ /dev/null @@ -1,119 +0,0 @@ -// -// QLPreviewPanel.h -// sequel-pro -// -// Created by Stuart Connolly (stuconnolly.com) on June 15, 2009. -// Copyright (c) 2009 Stuart Connolly. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -// As the QuickLook framework is private we have to make -// these methods public to avoid warnings while compiling -@interface QLPreviewPanel : NSPanel - -+ (id)sharedPreviewPanel; -+ (id)_previewPanel; -+ (BOOL)isSharedPreviewPanelLoaded; -- (id)initWithContentRect:(NSRect)fp8 styleMask:(NSUInteger)fp24 backing:(NSUInteger)fp28 defer:(BOOL)fp32; -- (id)initWithCoder:(id)fp8; -- (void)dealloc; -- (BOOL)isOpaque; -- (BOOL)canBecomeKeyWindow; -- (BOOL)canBecomeMainWindow; -- (BOOL)shouldIgnorePanelFrameChanges; -- (BOOL)isOpen; -- (void)setFrame:(NSRect)fp8 display:(BOOL)fp24 animate:(BOOL)fp28; -- (id)_subEffectsForWindow:(id)fp8 itemFrame:(NSRect)fp12 transitionWindow:(id *)fp28; -- (id)_scaleEffectForItemFrame:(NSRect)fp8 transitionWindow:(id *)fp24; -- (void)_invertCurrentEffect; -- (struct _NSRect)_currentItemFrame; -- (void)setAutosizesAndCenters:(BOOL)fp8; -- (BOOL)autosizesAndCenters; -- (void)makeKeyAndOrderFront:(id)fp8; -- (void)makeKeyAndOrderFrontWithEffect:(NSInteger)fp8; -- (void)makeKeyAndGoFullscreenWithEffect:(NSInteger)fp8; -- (void)makeKeyAndOrderFrontWithEffect:(NSInteger)fp8 canClose:(BOOL)fp12; -- (void)_makeKeyAndOrderFrontWithEffect:(NSInteger)fp8 canClose:(BOOL)fp12 willOpen:(BOOL)fp16 toFullscreen:(BOOL)fp20; -- (NSInteger)openingEffect; -- (void)closePanel; -- (void)close; -- (void)closeWithEffect:(NSInteger)fp8; -- (void)closeWithEffect:(NSInteger)fp8 canReopen:(BOOL)fp12; -- (void)_closeWithEffect:(NSInteger)fp8 canReopen:(BOOL)fp12; -- (void)windowEffectDidTerminate:(id)fp8; -- (void)_close:(id)fp8; -- (void)sendEvent:(id)fp8; -- (void)selectNextItem; -- (void)selectPreviousItem; -- (void)setURLs:(id)fp8 currentIndex:(NSUInteger)fp12 preservingDisplayState:(BOOL)fp16; -- (void)setURLs:(id)fp8 preservingDisplayState:(BOOL)fp12; -- (void)setURLs:(id)fp8; -- (id)URLs; -- (NSUInteger)indexOfCurrentURL; -- (void)setIndexOfCurrentURL:(NSUInteger)fp8; -- (void)setDelegate:(id)fp8; -- (id)sharedPreviewView; -- (void)setSharedPreviewView:(id)fp8; -- (void)setCyclesSelection:(BOOL)fp8; -- (BOOL)cyclesSelection; -- (void)setShowsAddToiPhotoButton:(BOOL)fp8; -- (BOOL)showsAddToiPhotoButton; -- (void)setShowsiChatTheaterButton:(BOOL)fp8; -- (BOOL)showsiChatTheaterButton; -- (void)setShowsFullscreenButton:(BOOL)fp8; -- (BOOL)showsFullscreenButton; -- (void)setShowsIndexSheetButton:(BOOL)fp8; -- (BOOL)showsIndexSheetButton; -- (void)setAutostarts:(BOOL)fp8; -- (BOOL)autostarts; -- (void)setPlaysDuringPanelAnimation:(BOOL)fp8; -- (BOOL)playsDuringPanelAnimation; -- (void)setDeferredLoading:(BOOL)fp8; -- (BOOL)deferredLoading; -- (void)setEnableDragNDrop:(BOOL)fp8; -- (BOOL)enableDragNDrop; -- (void)start:(id)fp8; -- (void)stop:(id)fp8; -- (void)setShowsIndexSheet:(BOOL)fp8; -- (BOOL)showsIndexSheet; -- (void)setShareWithiChat:(BOOL)fp8; -- (BOOL)shareWithiChat; -- (void)setPlaysSlideShow:(BOOL)fp8; -- (BOOL)playsSlideShow; -- (void)setIsFullscreen:(BOOL)fp8; -- (BOOL)isFullscreen; -- (void)setMandatoryClient:(id)fp8; -- (id)mandatoryClient; -- (void)setForcedContentTypeUTI:(id)fp8; -- (id)forcedContentTypeUTI; -- (void)setDocumentURLs:(id)fp8; -- (void)setDocumentURLs:(id)fp8 preservingDisplayState:(BOOL)fp12; -- (void)setDocumentURLs:(id)fp8 itemFrame:(struct _NSRect)fp12; -- (void)setURLs:(id)fp8 itemFrame:(struct _NSRect)fp12; -- (void)setAutoSizeAndCenterOnScreen:(BOOL)fp8; -- (void)setShowsAddToiPhoto:(BOOL)fp8; -- (void)setShowsiChatTheater:(BOOL)fp8; -- (void)setShowsFullscreen:(BOOL)fp8; - -@end diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h index b56c6d1c..fbf04c49 100644 --- a/Source/SPFieldEditorController.h +++ b/Source/SPFieldEditorController.h @@ -28,6 +28,21 @@ // // More info at +#ifndef SP_CODA + +#import // QuickLookUI + +//This is an informal protocol +@protocol _QLPreviewPanelController + +- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel *)panel; +- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel; +- (void)endPreviewPanelControl:(QLPreviewPanel *)panel; + +@end + +#endif + @class SPWindow; /** @@ -38,7 +53,11 @@ * This class offers a sheet for editing different kind of data such as text, blobs (including images) as * editSheet and bit fields as bitSheet. */ -@interface SPFieldEditorController : NSWindowController +@interface SPFieldEditorController : NSWindowController { IBOutlet id editSheetProgressBar; IBOutlet id editSheetSegmentControl; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 4f34a998..52242406 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -29,9 +29,6 @@ // More info at #import "SPFieldEditorController.h" -#ifndef SP_CODA -#import "QLPreviewPanel.h" -#endif #import "RegexKitLite.h" #import "SPTooltip.h" #import "SPGeometryDataView.h" @@ -164,8 +161,8 @@ #ifndef SP_CODA // On Mac OSX 10.6 QuickLook runs non-modal thus order out the panel // if still visible - if ([[NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel] isVisible]) { - [[NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel] orderOut:nil]; + if ([[QLPreviewPanel sharedPreviewPanel] isVisible]) { + [[QLPreviewPanel sharedPreviewPanel] orderOut:nil]; } #endif @@ -882,89 +879,34 @@ - (void)invokeQuickLookOfType:(NSString *)type treatAsText:(BOOL)isText { #ifndef SP_CODA - // Load QL via private framework (SDK 10.5) - if([[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) { - - [editSheetProgressBar startAnimation:self]; - - [self createTemporaryQuickLookFileOfType:type treatAsText:isText]; - - counter++; - - // Init QuickLook - id ql = [NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel]; - - [[ql delegate] setDelegate:self]; - [ql setURLs:@[[NSURL fileURLWithPath:tmpFileName]] currentIndex:0 preservingDisplayState:YES]; - - // TODO: No interaction with iChat and iPhoto due to .scriptSuite warning: - // unknown image format - [ql setShowsAddToiPhotoButton:NO]; - [ql setShowsiChatTheaterButton:NO]; - // Since we are inside of editSheet we have to avoid full-screen zooming - // otherwise QuickLook hangs - [ql setShowsFullscreenButton:NO]; - [ql setEnableDragNDrop:NO]; - // Order out QuickLook with animation effect according to self:previewPanel:frameForURL: - [ql makeKeyAndOrderFrontWithEffect:2]; // 1 = fade in - - // quickLookCloseMarker == 1 break the modal session - quickLookCloseMarker = 0; - - [editSheetProgressBar stopAnimation:self]; - - // Run QuickLook in its own modal seesion for event handling - NSModalSession session = [NSApp beginModalSessionForWindow:ql]; - for (;;) { - // Conditions for closing QuickLook - if ([NSApp runModalSession:session] != NSRunContinuesResponse - || quickLookCloseMarker == 1 - || ![ql isVisible]) - break; - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode - beforeDate:[NSDate distantFuture]]; - - } - [NSApp endModalSession:session]; - - // set ql's delegate to nil for dealloc - [[ql windowController] setDelegate:nil]; - - } - // Load QL via framework (SDK 10.5 but SP runs on 10.6) - // TODO: This is an hack in order to be able to support QuickLook on Mac OS X 10.5 and 10.6 - // as long as SP will be compiled against SDK 10.5. - // If SP will be compiled against SDK 10.6 we can use the standard way by using - // the QuickLookUI which is part of the Quartz.framework. See Developer example "QuickLookDownloader" + // See Developer example "QuickLookDownloader" // file:///Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset/Contents/Resources/Documents/samplecode/QuickLookDownloader/index.html#//apple_ref/doc/uid/DTS40009082 - else if([[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load]) { - [editSheetProgressBar startAnimation:self]; + [editSheetProgressBar startAnimation:self]; - [self createTemporaryQuickLookFileOfType:type treatAsText:isText]; + [self createTemporaryQuickLookFileOfType:type treatAsText:isText]; - counter++; + counter++; - // TODO: If QL is visible reload it - but how? - // Up to now QL will close and the user has to redo it. - if([[NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel] isVisible]) { - [[NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel] orderOut:nil]; - } + // TODO: If QL is visible reload it - but how? + // Up to now QL will close and the user has to redo it. + if([[QLPreviewPanel sharedPreviewPanel] isVisible]) { + [[QLPreviewPanel sharedPreviewPanel] orderOut:nil]; + } - [[NSClassFromString(@"QLPreviewPanel") sharedPreviewPanel] makeKeyAndOrderFront:nil]; + [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil]; - [editSheetProgressBar stopAnimation:self]; + [editSheetProgressBar stopAnimation:self]; - } else { - [SPTooltip showWithObject:[NSString stringWithFormat:@"QuickLook is not available on that platform."]]; - } #endif } +#pragma mark - QLPreviewPanelController methods + /** * QuickLook delegate for SDK 10.6. Set the Quicklook delegate to self and suppress setShowsAddToiPhotoButton since the format is unknow. */ -- (void)beginPreviewPanelControl:(id)panel +- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel { #ifndef SP_CODA @@ -972,15 +914,13 @@ [panel setDelegate:self]; [panel setDataSource:self]; - // Due to the unknown image format disable image sharing - [panel setShowsAddToiPhotoButton:NO]; #endif } /** * QuickLook delegate for SDK 10.6 - not in usage. */ -- (void)endPreviewPanelControl:(id)panel +- (void)endPreviewPanelControl:(QLPreviewPanel *)panel { // This document loses its responsisibility on the preview panel // Until the next call to -beginPreviewPanelControl: it must not @@ -990,22 +930,19 @@ /** * QuickLook delegate for SDK 10.6 */ -- (BOOL)acceptsPreviewPanelControl:(id)panel; +- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel *)panel; { return YES; } -// QuickLook delegates for SDK 10.6 -// - (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event -// { -// } +#pragma mark - QLPreviewPanelDataSource methods /** * QuickLook delegate for SDK 10.6. * * @return It always returns 1. */ -- (NSInteger)numberOfPreviewItemsInPreviewPanel:(id)panel +- (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel *)panel { return 1; } @@ -1015,7 +952,7 @@ * * @return It returns as NSURL the temporarily created file. */ -- (id)previewPanel:(id)panel previewItemAtIndex:(NSInteger)anIndex +- (id)previewPanel:(QLPreviewPanel *)panel previewItemAtIndex:(NSInteger)anIndex { if(tmpFileName) return [NSURL fileURLWithPath:tmpFileName]; @@ -1023,33 +960,19 @@ return nil; } -/** - * QuickLook delegate for SDK 10.5. - * - * @return It returns the frame of the application's middle. If an empty frame is returned then the panel will fade in/out instead. - */ -- (NSRect)previewPanel:(NSPanel*)panel frameForURL:(NSURL*)URL -{ - - // Close modal session defined in invokeQuickLookOfType: - // if user closes the QuickLook view - quickLookCloseMarker = 1; +#pragma mark - QLPreviewPanelDelegate methods - // Return the App's middle point - NSRect mwf = [[NSApp mainWindow] frame]; - return NSMakeRect( - mwf.origin.x+mwf.size.width/2, - mwf.origin.y+mwf.size.height/2, - 5, 5); - -} +// QuickLook delegates for SDK 10.6 +// - (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event +// { +// } /** * QuickLook delegate for SDK 10.6. * * @return It returns the frame of the application's middle. If an empty frame is returned then the panel will fade in/out instead. */ -- (NSRect)previewPanel:(id)panel sourceFrameOnScreenForPreviewItem:(id)item +- (NSRect)previewPanel:(QLPreviewPanel *)panel sourceFrameOnScreenForPreviewItem:(id)item { // Return the App's middle point NSRect mwf = [[NSApp mainWindow] frame]; @@ -1065,6 +988,8 @@ // return [NSImage imageNamed:@"database"]; // } +#pragma mark - + /** * Called by (SPImageView) if an image was pasted into the editSheet */ diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 9295c858..45add266 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -43,7 +43,6 @@ #import "SPQueryDocumentsController.h" #import "SPTextAndLinkCell.h" #ifndef SP_CODA -#import "QLPreviewPanel.h" #import "SPSplitView.h" #endif #import "SPFieldEditorController.h" diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 195bf5df..e021848d 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -179,6 +179,7 @@ 4DECC48F0EC2B436008D359E /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3320EC2A170008D359E /* Sparkle.framework */; }; 4DECC4910EC2B436008D359E /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3340EC2A170008D359E /* Growl.framework */; }; 501B1D181728A3DA0017C92E /* SPCharsetCollationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */; }; + 503CDBB21ACDC204004F8A2F /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503CDBB11ACDC204004F8A2F /* Quartz.framework */; }; 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; 50D3C3491A75B8A800B5429C /* GotoDatabaseDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 50D3C34B1A75B8A800B5429C /* GotoDatabaseDialog.xib */; }; @@ -611,7 +612,6 @@ 11D44DEF118F5887002AA43C /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Frameworks/OCMock.framework; sourceTree = ""; }; 17005CB116D6CF0000AF81F4 /* SPTableTriggersDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableTriggersDelegate.h; sourceTree = ""; }; 17005CB216D6CF0000AF81F4 /* SPTableTriggersDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableTriggersDelegate.m; sourceTree = ""; }; - 17128B8A0FE6E0210035DD75 /* QLPreviewPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLPreviewPanel.h; sourceTree = ""; }; 1713122F109C7DF600FB465F /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = ""; }; 171312CC109D23C700FB465F /* SPTableTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableTextFieldCell.h; sourceTree = ""; }; 171312CD109D23C700FB465F /* SPTableTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableTextFieldCell.m; sourceTree = ""; }; @@ -889,6 +889,7 @@ 4DECC3340EC2A170008D359E /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = ""; }; 501B1D161728A3DA0017C92E /* SPCharsetCollationHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCharsetCollationHelper.h; sourceTree = ""; }; 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; + 503CDBB11ACDC204004F8A2F /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableContentFilterController.h; sourceTree = ""; }; 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = ""; }; 50A9F8AF19EAD4B90053E571 /* SPGotoDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPGotoDatabaseController.h; sourceTree = ""; }; @@ -1310,6 +1311,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 503CDBB21ACDC204004F8A2F /* Quartz.framework in Frameworks */, 17AED4161888BD67008E380F /* Security.framework in Frameworks */, 296DC8BF0F9091DF002A3258 /* libicucore.dylib in Frameworks */, 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, @@ -1332,6 +1334,7 @@ 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( + 503CDBB11ACDC204004F8A2F /* Quartz.framework */, 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, B5EAC0FC0EC87FF900CC579C /* Security.framework */, @@ -1404,14 +1407,6 @@ name = zlib; sourceTree = ""; }; - 17128B890FE6DFFA0035DD75 /* QuickLook */ = { - isa = PBXGroup; - children = ( - 17128B8A0FE6E0210035DD75 /* QLPreviewPanel.h */, - ); - name = QuickLook; - sourceTree = ""; - }; 171312CF109D23CA00FB465F /* Cells */ = { isa = PBXGroup; children = ( @@ -2066,7 +2061,6 @@ isa = PBXGroup; children = ( 1198F5B01174EDA700670590 /* Database Actions */, - 17128B890FE6DFFA0035DD75 /* QuickLook */, 583CE39511722B70008F148E /* File Compression */, 173284E51088FEC20062E892 /* Data */, 17E6416F0EF01F4C001BC333 /* Keychain */, -- cgit v1.2.3 From 9aa296a3e93b0b98a1018ba4d7aa8920d85b2a81 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Apr 2015 23:34:45 +0200 Subject: Converted some setters to equivalent @propertys --- Source/SPFieldEditorController.h | 30 ++++++++++++++++++++++----- Source/SPFieldEditorController.m | 44 ++++------------------------------------ 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h index fbf04c49..ec36c9d2 100644 --- a/Source/SPFieldEditorController.h +++ b/Source/SPFieldEditorController.h @@ -195,6 +195,31 @@ @property(readwrite, retain) NSDictionary *editedFieldInfo; +//don't blame me for nonatomic,assign. That's how the previous setters worked :) + +/** + * The maximum text length of the underlying table field for input validation. + */ +@property(nonatomic,assign) unsigned long long textMaxLength; + +/** + * The field type of the underlying table field for input validation. + * The field type will be used for dispatching which sheet will be shown. + * If type == BIT the bitSheet will be used otherwise the editSheet. + */ +@property(nonatomic,assign) NSString *fieldType; + +/** + * The field encoding of the underlying table field for displaying it to the user. + */ +@property(nonatomic,assign) NSString *fieldEncoding; + +/** + * Whether underlying table field allows NULL for several validations. + * If allowNULL is YES NULL value is allowed for the underlying table field. + */ +@property(nonatomic,assign) BOOL allowNULL; + - (IBAction)closeEditSheet:(id)sender; - (IBAction)openEditSheet:(id)sender; - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; @@ -215,11 +240,6 @@ isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)theWindow sender:(id)sender contextInfo:(NSDictionary*)theContextInfo; -- (void)setTextMaxLength:(NSUInteger)length; -- (void)setFieldType:(NSString*)aType; -- (void)setFieldEncoding:(NSString*)aEncoding; -- (void)setAllowNULL:(BOOL)allowNULL; - - (void)processPasteImageData; - (void)processUpdatedImageData:(NSData *)data; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 52242406..c1908a19 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -49,6 +49,10 @@ @implementation SPFieldEditorController @synthesize editedFieldInfo; +@synthesize textMaxLength = maxTextLength; +@synthesize fieldType; +@synthesize fieldEncoding; +@synthesize allowNULL = _allowNULL; /** * Initialise an instance of SPFieldEditorController using the XIB “FieldEditorSheet.xib”. Init the available Quciklook format by reading @@ -482,46 +486,6 @@ } } -/** - * Set the maximum text length of the underlying table field for input validation. - * - * @param length The maximum text length - */ -- (void)setTextMaxLength:(NSUInteger)length -{ - maxTextLength = length; -} - -/** - * Set the field type of the underlying table field for input validation. - * - * @param aType The field type which will be used for dispatching which sheet will be shown. If type == BIT the bitSheet will be used otherwise the editSheet. - */ -- (void)setFieldType:(NSString*)aType -{ - fieldType = aType; -} - -/** - * Set the field encoding of the underlying table field for displaying it to the user. - * - * @param aEncoding encoding - */ -- (void)setFieldEncoding:(NSString*)aEncoding -{ - fieldEncoding = aEncoding; -} - -/** - * Set if underlying table field allows NULL for several validations. - * - * @param allowNULL If allowNULL is YES NULL value is allowed for the underlying table field - */ -- (void)setAllowNULL:(BOOL)allowNULL -{ - _allowNULL = allowNULL; -} - /** * Segement controller for text/image/hex buttons in editSheet */ -- cgit v1.2.3 From 0382e135e30c1e441225717fc5eed3520108d3ca Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Apr 2015 23:55:17 +0200 Subject: Replaced some magic numbers with an enum --- Source/SPFieldEditorController.m | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index c1908a19..c791dfc5 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -40,6 +40,12 @@ #import +typedef enum { + TextSegment = 0, + ImageSegment, + HexSegment +} FieldEditorSegment; + @interface SPFieldEditorController (SPFieldEditorControllerDelegate) - (void)processFieldEditorResult:(id)data contextInfo:(NSDictionary*)contextInfo; @@ -344,7 +350,7 @@ [editSheetQuickLookButton setHidden:((!_isBlob && !isBinary) || _isGeometry)]; [editSheetSegmentControl setHidden:(!_isBlob && !isBinary && !_isGeometry)]; - [editSheetSegmentControl setEnabled:YES forSegment:1]; + [editSheetSegmentControl setEnabled:YES forSegment:ImageSegment]; // Set window's min size since no segment and quicklook buttons are hidden if (_isBlob || isBinary || _isGeometry) { @@ -399,7 +405,7 @@ [editImage setHidden:YES]; [editTextView setHidden:YES]; [editTextScrollView setHidden:YES]; - [editSheetSegmentControl setSelectedSegment:2]; + [editSheetSegmentControl setSelectedSegment:HexSegment]; } else if ([sheetEditData isKindOfClass:[SPMySQLGeometryData class]]) { SPGeometryDataView *v = [[[SPGeometryDataView alloc] initWithCoordinates:[sheetEditData coordinates] targetDimension:2000.0f] autorelease]; @@ -411,8 +417,8 @@ [hexTextView setString:@""]; [hexTextView setHidden:YES]; [hexTextScrollView setHidden:YES]; - [editSheetSegmentControl setEnabled:NO forSegment:2]; - [editSheetSegmentControl setSelectedSegment:0]; + [editSheetSegmentControl setEnabled:NO forSegment:HexSegment]; + [editSheetSegmentControl setSelectedSegment:TextSegment]; [editTextView setHidden:NO]; [editTextScrollView setHidden:NO]; } @@ -426,7 +432,7 @@ [editImage setHidden:YES]; [editTextView setHidden:NO]; [editTextScrollView setHidden:NO]; - [editSheetSegmentControl setSelectedSegment:0]; + [editSheetSegmentControl setSelectedSegment:TextSegment]; } if (image) { @@ -437,7 +443,7 @@ if(!_isGeometry) { [editTextView setHidden:YES]; [editTextScrollView setHidden:YES]; - [editSheetSegmentControl setSelectedSegment:1]; + [editSheetSegmentControl setSelectedSegment:ImageSegment]; } } else { @@ -453,13 +459,13 @@ [hexTextScrollView setHidden:YES]; } else { - [editSheetSegmentControl setEnabled:NO forSegment:1]; + [editSheetSegmentControl setEnabled:NO forSegment:ImageSegment]; } [editImage setHidden:YES]; [editTextView setHidden:NO]; [editTextScrollView setHidden:NO]; - [editSheetSegmentControl setSelectedSegment:0]; + [editSheetSegmentControl setSelectedSegment:TextSegment]; } // Locate the caret in editTextView @@ -491,8 +497,8 @@ */ - (IBAction)segmentControllerChanged:(id)sender { - switch([sender selectedSegment]){ - case 0: // text + switch((FieldEditorSegment)[sender selectedSegment]){ + case TextSegment: [editTextView setHidden:NO]; [editTextScrollView setHidden:NO]; [editImage setHidden:YES]; @@ -503,7 +509,7 @@ [[NSApp mainWindow] makeFirstResponder:editTextView]; #endif break; - case 1: // image + case ImageSegment: [editTextView setHidden:YES]; [editTextScrollView setHidden:YES]; [editImage setHidden:NO]; @@ -511,7 +517,7 @@ [hexTextScrollView setHidden:YES]; [usedSheet makeFirstResponder:editImage]; break; - case 2: // hex - load on demand + case HexSegment: [usedSheet makeFirstResponder:hexTextView]; if([[hexTextView string] isEqualToString:@""]) { [editSheetProgressBar startAnimation:self]; @@ -551,7 +557,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - if ([editSheetSegmentControl selectedSegment] == 1 && [sheetEditData isKindOfClass:[SPMySQLGeometryData class]]) { + if ([editSheetSegmentControl selectedSegment] == ImageSegment && [sheetEditData isKindOfClass:[SPMySQLGeometryData class]]) { [panel setAllowedFileTypes:@[@"pdf"]]; [panel setAllowsOtherFileTypes:NO]; } @@ -679,7 +685,7 @@ // If the image cell now contains a valid image, select the image view if (image) { - [editSheetSegmentControl setSelectedSegment:1]; + [editSheetSegmentControl setSelectedSegment:ImageSegment]; [hexTextView setHidden:YES]; [hexTextScrollView setHidden:YES]; [editImage setHidden:NO]; @@ -688,7 +694,7 @@ // Otherwise deselect the image view } else { - [editSheetSegmentControl setSelectedSegment:0]; + [editSheetSegmentControl setSelectedSegment:TextSegment]; [hexTextView setHidden:YES]; [hexTextScrollView setHidden:YES]; [editImage setHidden:YES]; @@ -722,7 +728,7 @@ } else if ( [sheetEditData isKindOfClass:[SPMySQLGeometryData class]] ) { - if ( [editSheetSegmentControl selectedSegment] == 0 || editImage == nil ) { + if ( [editSheetSegmentControl selectedSegment] == TextSegment || editImage == nil ) { [[editTextView string] writeToURL:fileURL atomically:YES -- cgit v1.2.3 From 66acdbe3e5ad2f20815861a725d95f572c892956 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 5 Apr 2015 13:51:17 +0200 Subject: Update strings files (Mainly to trigger a rebuild) --- Resources/English.lproj/AboutPanel.strings | Bin 914 -> 916 bytes Resources/English.lproj/BundleEditor.strings | Bin 18760 -> 19068 bytes Resources/English.lproj/ConnectionView.strings | Bin 43380 -> 48864 bytes Resources/English.lproj/Console.strings | Bin 4020 -> 5002 bytes .../English.lproj/ContentFilterManager.strings | Bin 10670 -> 10868 bytes .../English.lproj/ContentPaginationView.strings | Bin 1394 -> 1510 bytes Resources/English.lproj/DBView.strings | Bin 103624 -> 106116 bytes .../English.lproj/DataMigrationDialog.strings | Bin 21316 -> 21450 bytes .../English.lproj/DatabaseProcessList.strings | Bin 9576 -> 9648 bytes Resources/English.lproj/ExportDialog.strings | Bin 24986 -> 25294 bytes Resources/English.lproj/FieldEditorSheet.strings | Bin 11504 -> 12168 bytes Resources/English.lproj/GotoDatabaseDialog.strings | Bin 0 -> 1294 bytes Resources/English.lproj/IndexesView.strings | Bin 6522 -> 6630 bytes Resources/English.lproj/Localizable.strings | Bin 245224 -> 250678 bytes Resources/English.lproj/MainMenu.strings | Bin 48702 -> 49854 bytes Resources/English.lproj/MainWindow.strings | Bin 166 -> 166 bytes Resources/English.lproj/Navigator.strings | Bin 2076 -> 2114 bytes Resources/English.lproj/Preferences.strings | Bin 40310 -> 47612 bytes .../English.lproj/QueryFavoriteManager.strings | Bin 30004 -> 30436 bytes Resources/English.lproj/SaveSPFAccessory.strings | Bin 3638 -> 3692 bytes Resources/English.lproj/UserManagerView.strings | Bin 16208 -> 16244 bytes 21 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Resources/English.lproj/GotoDatabaseDialog.strings diff --git a/Resources/English.lproj/AboutPanel.strings b/Resources/English.lproj/AboutPanel.strings index f054ebc4..12b859b3 100644 Binary files a/Resources/English.lproj/AboutPanel.strings and b/Resources/English.lproj/AboutPanel.strings differ diff --git a/Resources/English.lproj/BundleEditor.strings b/Resources/English.lproj/BundleEditor.strings index 536cdd5a..aa3d5c59 100644 Binary files a/Resources/English.lproj/BundleEditor.strings and b/Resources/English.lproj/BundleEditor.strings differ diff --git a/Resources/English.lproj/ConnectionView.strings b/Resources/English.lproj/ConnectionView.strings index 995eae7f..e72e0442 100644 Binary files a/Resources/English.lproj/ConnectionView.strings and b/Resources/English.lproj/ConnectionView.strings differ diff --git a/Resources/English.lproj/Console.strings b/Resources/English.lproj/Console.strings index 1320d37e..60c16b3e 100644 Binary files a/Resources/English.lproj/Console.strings and b/Resources/English.lproj/Console.strings differ diff --git a/Resources/English.lproj/ContentFilterManager.strings b/Resources/English.lproj/ContentFilterManager.strings index 009b4d6e..68922c24 100644 Binary files a/Resources/English.lproj/ContentFilterManager.strings and b/Resources/English.lproj/ContentFilterManager.strings differ diff --git a/Resources/English.lproj/ContentPaginationView.strings b/Resources/English.lproj/ContentPaginationView.strings index 5dedf99c..482afec1 100644 Binary files a/Resources/English.lproj/ContentPaginationView.strings and b/Resources/English.lproj/ContentPaginationView.strings differ diff --git a/Resources/English.lproj/DBView.strings b/Resources/English.lproj/DBView.strings index a76c5722..c70f501e 100644 Binary files a/Resources/English.lproj/DBView.strings and b/Resources/English.lproj/DBView.strings differ diff --git a/Resources/English.lproj/DataMigrationDialog.strings b/Resources/English.lproj/DataMigrationDialog.strings index 5203c25c..9587a6ef 100644 Binary files a/Resources/English.lproj/DataMigrationDialog.strings and b/Resources/English.lproj/DataMigrationDialog.strings differ diff --git a/Resources/English.lproj/DatabaseProcessList.strings b/Resources/English.lproj/DatabaseProcessList.strings index f76abf72..679e4faf 100644 Binary files a/Resources/English.lproj/DatabaseProcessList.strings and b/Resources/English.lproj/DatabaseProcessList.strings differ diff --git a/Resources/English.lproj/ExportDialog.strings b/Resources/English.lproj/ExportDialog.strings index 0af13a86..773a7f35 100644 Binary files a/Resources/English.lproj/ExportDialog.strings and b/Resources/English.lproj/ExportDialog.strings differ diff --git a/Resources/English.lproj/FieldEditorSheet.strings b/Resources/English.lproj/FieldEditorSheet.strings index 7c326a49..816cb986 100644 Binary files a/Resources/English.lproj/FieldEditorSheet.strings and b/Resources/English.lproj/FieldEditorSheet.strings differ diff --git a/Resources/English.lproj/GotoDatabaseDialog.strings b/Resources/English.lproj/GotoDatabaseDialog.strings new file mode 100644 index 00000000..bf48b104 Binary files /dev/null and b/Resources/English.lproj/GotoDatabaseDialog.strings differ diff --git a/Resources/English.lproj/IndexesView.strings b/Resources/English.lproj/IndexesView.strings index 5fd8124f..c306f39b 100644 Binary files a/Resources/English.lproj/IndexesView.strings and b/Resources/English.lproj/IndexesView.strings differ diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings index f54e1fab..8454df44 100644 Binary files a/Resources/English.lproj/Localizable.strings and b/Resources/English.lproj/Localizable.strings differ diff --git a/Resources/English.lproj/MainMenu.strings b/Resources/English.lproj/MainMenu.strings index f97b133c..b5593a7d 100644 Binary files a/Resources/English.lproj/MainMenu.strings and b/Resources/English.lproj/MainMenu.strings differ diff --git a/Resources/English.lproj/MainWindow.strings b/Resources/English.lproj/MainWindow.strings index 2afdf3b5..1191d0d2 100644 Binary files a/Resources/English.lproj/MainWindow.strings and b/Resources/English.lproj/MainWindow.strings differ diff --git a/Resources/English.lproj/Navigator.strings b/Resources/English.lproj/Navigator.strings index d7debae9..778dbcf2 100644 Binary files a/Resources/English.lproj/Navigator.strings and b/Resources/English.lproj/Navigator.strings differ diff --git a/Resources/English.lproj/Preferences.strings b/Resources/English.lproj/Preferences.strings index 91395b5b..8248bf70 100644 Binary files a/Resources/English.lproj/Preferences.strings and b/Resources/English.lproj/Preferences.strings differ diff --git a/Resources/English.lproj/QueryFavoriteManager.strings b/Resources/English.lproj/QueryFavoriteManager.strings index 8edb8e1b..622a6341 100644 Binary files a/Resources/English.lproj/QueryFavoriteManager.strings and b/Resources/English.lproj/QueryFavoriteManager.strings differ diff --git a/Resources/English.lproj/SaveSPFAccessory.strings b/Resources/English.lproj/SaveSPFAccessory.strings index 9265656d..cd1f559c 100644 Binary files a/Resources/English.lproj/SaveSPFAccessory.strings and b/Resources/English.lproj/SaveSPFAccessory.strings differ diff --git a/Resources/English.lproj/UserManagerView.strings b/Resources/English.lproj/UserManagerView.strings index c078b1d1..7d494fdb 100644 Binary files a/Resources/English.lproj/UserManagerView.strings and b/Resources/English.lproj/UserManagerView.strings differ -- cgit v1.2.3 From f03de6f42b1ea00875f9d57accbee2537604ee39 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 5 Apr 2015 20:01:17 +0200 Subject: Fix a threading issue when adding tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Also the localizations should now work again on 10.10 🎉) --- Source/SPDatabaseViewController.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index c43761d3..ea2186cc 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -116,16 +116,17 @@ #pragma mark - #pragma mark Tab view control and delegate methods +//WARNING: Might be called from code in background threads - (IBAction)viewStructure:(id)sender { // Cancel the selection if currently editing a view and unable to save if (![self couldCommitCurrentViewActions]) { - [mainToolbar setSelectedItemIdentifier:*SPViewModeToMainToolbarMap[[prefs integerForKey:SPLastViewMode]]]; + [[mainToolbar onMainThread] setSelectedItemIdentifier:*SPViewModeToMainToolbarMap[[prefs integerForKey:SPLastViewMode]]]; return; } - [tableTabView selectTabViewItemAtIndex:0]; - [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure]; + [[tableTabView onMainThread] selectTabViewItemAtIndex:0]; + [[mainToolbar onMainThread] setSelectedItemIdentifier:SPMainToolbarTableStructure]; [spHistoryControllerInstance updateHistoryEntries]; [prefs setInteger:SPStructureViewMode forKey:SPLastViewMode]; -- cgit v1.2.3 From 8631b5a61843aa52662946093e8391ead3de5689 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 Apr 2015 01:10:51 +0200 Subject: Remove DMLocalizedNib runtime localization No longer needed, see #1998. I'm feeling a bit sentimental now. --- Source/DMLocalizedNib.m | 162 ------------------- Source/DMLocalizedNibBundle.m | 295 ----------------------------------- sequel-pro.xcodeproj/project.pbxproj | 8 - 3 files changed, 465 deletions(-) delete mode 100644 Source/DMLocalizedNib.m delete mode 100644 Source/DMLocalizedNibBundle.m diff --git a/Source/DMLocalizedNib.m b/Source/DMLocalizedNib.m deleted file mode 100644 index 4a03247a..00000000 --- a/Source/DMLocalizedNib.m +++ /dev/null @@ -1,162 +0,0 @@ -// -// DMLocalizedNib.h -// sequel-pro -// -// Created by Rowan Beentje on July 4, 2010. -// Copyright (c) 2010 Rowan Beentje. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// -// More info at - -#import -#import - -@interface NSNib (DMLocalizedNib) -- (id)deliciousInitWithNibNamed:(NSString *)nibName bundle:(NSBundle *)bundle; -- (id)deliciousInitWithContentsOfURL:(NSURL *)nibFileURL; -- (BOOL)deliciousInstantiateNibWithOwner:(id)owner topLevelObjects:(NSArray **)topLevelObjects; -- (void)setDeliciousNibName:(NSString *)nibName; -- (NSString *)deliciousNibName; -- (void)deliciousDealloc; -@end - -// Private methods from DMLocalizedNib used here -@interface NSBundle () -+ (void)_localizeStringsInObject:(id)object table:(NSString *)table; -@end - -static NSMutableDictionary *deliciousNibNames = nil; - -@implementation NSNib (DMLocalizedNib) - -#pragma mark NSObject - -/** - * On NSNib class load, swizzle in our overrides of the basic methods. - */ -+ (void)load; -{ - NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init]; - if (self == [NSNib class]) { - method_exchangeImplementations(class_getInstanceMethod(self, @selector(initWithNibNamed:bundle:)), class_getInstanceMethod(self, @selector(deliciousInitWithNibNamed:bundle:))); - method_exchangeImplementations(class_getInstanceMethod(self, @selector(initWithContentsOfURL:)), class_getInstanceMethod(self, @selector(deliciousInitWithContentsOfURL:))); - method_exchangeImplementations(class_getInstanceMethod(self, @selector(instantiateNibWithOwner:topLevelObjects:)), class_getInstanceMethod(self, @selector(deliciousInstantiateNibWithOwner:topLevelObjects:))); - method_exchangeImplementations(class_getInstanceMethod(self, @selector(dealloc)), class_getInstanceMethod(self, @selector(deliciousDealloc))); - } - [autoreleasePool release]; -} - - -#pragma mark API - -/** - * An init method swizzled with the original method, storing the base - * name passed into the init method for later reuse. - */ -- (id)deliciousInitWithNibNamed:(NSString *)nibName bundle:(NSBundle *)bundle -{ - - // Instantiate the nib using the original (swizzled) call - id nib = [self deliciousInitWithNibNamed:nibName bundle:bundle]; - if (nib) { - [self setDeliciousNibName:nibName]; - } - - return nib; -} - -/** - * An init method swizzled with the original method, extracting and - * storing the base name of the nib for later reuse. - */ -- (id)deliciousInitWithContentsOfURL:(NSURL *)nibFileURL -{ - - // Instantiate the nib using the original (swizzled) call - id nib = [self deliciousInitWithContentsOfURL:nibFileURL]; - if (nib) { - - // Extract the filename from the URL - NSArray *urlParts = [[nibFileURL path] componentsSeparatedByString:@"/"]; - NSString *nibName = [urlParts lastObject]; - [self setDeliciousNibName:nibName]; - } - - return nib; -} - -/** - * An instatiation method swizzled with the original method. Instantiates - * as before, and then if it can find a .strings file in a preferred language - * to localize the instantiated objects with, does so. - */ -- (BOOL)deliciousInstantiateNibWithOwner:(id)owner topLevelObjects:(NSArray **)topLevelObjects -{ - if ([self deliciousInstantiateNibWithOwner:owner topLevelObjects:topLevelObjects]) { - - // Look for a localised strings table file based on the original nib name, - // translating only if one was found and it wasn't English - NSString *localizedStringsTablePath = [[NSBundle mainBundle] pathForResource:[self deliciousNibName] ofType:@"strings"]; - if (localizedStringsTablePath && ![[[localizedStringsTablePath stringByDeletingLastPathComponent] lastPathComponent] isEqualToString:@"English.lproj"]) { - [NSBundle _localizeStringsInObject:*topLevelObjects table:[self deliciousNibName]]; - } - - return YES; - } - - return NO; -} - -/** - * Store the nib name that was used when setting up the nib, which will - * also be used to look up the .strings file name - */ -- (void)setDeliciousNibName:(NSString *)nibName -{ - if (!deliciousNibNames) { - deliciousNibNames = [[NSMutableDictionary alloc] init]; - } - [deliciousNibNames setObject:nibName forKey:[NSValue valueWithPointer:self]]; -} - -/** - * Retrieve the nib name to look up the matching .strings file name - */ -- (NSString *)deliciousNibName -{ - return [deliciousNibNames objectForKey:[NSValue valueWithPointer:self]]; -} - -/** - * Swizzled deallocate to release custom stores. - */ -- (void)deliciousDealloc -{ - if (deliciousNibNames) { - [deliciousNibNames removeObjectForKey:[NSValue valueWithPointer:self]]; - if (![deliciousNibNames count]) SPClear(deliciousNibNames); - } - [self deliciousDealloc]; -} - -@end diff --git a/Source/DMLocalizedNibBundle.m b/Source/DMLocalizedNibBundle.m deleted file mode 100644 index 5dc94f9f..00000000 --- a/Source/DMLocalizedNibBundle.m +++ /dev/null @@ -1,295 +0,0 @@ -// DMLocalizedNibBundle.m -// -// Created by William Jon Shipley on 2/13/05. -// Copyright (c) 2005-2009 Golden % Braeburn, LLC. All rights reserved except as below: -// -// This code is provided as-is, with no warranties or anything. You may use it in your projects as you wish, -// but you must leave this comment block (credits and copyright) intact. That's the only restriction -// -- Golden % Braeburn otherwise grants you a fully-paid, worldwide, transferrable license to use this -// code as you see fit, including but not limited to making derivative works. - -#import -#import -#import - -@interface NSBundle (DMLocalizedNibBundle) -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_8 -- (BOOL)deliciousLocalizingLoadNibNamed:(NSString *)fileName owner:(id)owner topLevelObjects:(NSArray **)topLevelObjects; -#endif -+ (BOOL)deliciousLocalizingLoadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone; -@end - -@interface NSBundle (DMLocalizedNibBundle_Private_API) -+ (void)_localizeStringsInObject:(id)object table:(NSString *)table; -+ (NSString *)_localizedStringForString:(NSString *)string table:(NSString *)table; -// localize particular attributes in objects -+ (void)_localizeTitleOfObject:(id)object table:(NSString *)table; -+ (void)_localizeAlternateTitleOfObject:(id)object table:(NSString *)table; -+ (void)_localizeStringValueOfObject:(id)object table:(NSString *)table; -+ (void)_localizePlaceholderStringOfObject:(id)object table:(NSString *)table; -+ (void)_localizeToolTipOfObject:(id)object table:(NSString *)table; -+ (void)_localizeLabelOfObject:(id)object table:(NSString *)table; -@end - -static NSMutableArray *deliciousBindingKeys = nil; - -@implementation NSBundle (DMLocalizedNibBundle) - -#pragma mark NSObject - -+ (void)load -{ - NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init]; - if (self == [NSBundle class]) { - Method oldM,newM; -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_8 - oldM = class_getInstanceMethod(self, @selector(loadNibNamed:owner:topLevelObjects:)); - newM = class_getInstanceMethod(self, @selector(deliciousLocalizingLoadNibNamed:owner:topLevelObjects:)); - method_exchangeImplementations(oldM, newM); -#endif - oldM = class_getClassMethod(self, @selector(loadNibFile:externalNameTable:withZone:)); - newM = class_getClassMethod(self, @selector(deliciousLocalizingLoadNibFile:externalNameTable:withZone:)); - method_exchangeImplementations(oldM, newM); - deliciousBindingKeys = [[NSMutableArray alloc] initWithObjects: - NSMultipleValuesPlaceholderBindingOption, - NSNoSelectionPlaceholderBindingOption, - NSNotApplicablePlaceholderBindingOption, - NSNullPlaceholderBindingOption, - nil]; - } - [autoreleasePool release]; -} - -#pragma mark API - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_8 -- (BOOL)deliciousLocalizingLoadNibNamed:(NSString *)fileName owner:(id)owner topLevelObjects:(NSArray **)topLevelObjects -{ - fileName = [self pathForResource:fileName ofType:@"nib"]; - NSString *localizedStringsTableName = [[fileName lastPathComponent] stringByDeletingPathExtension]; - NSString *localizedStringsTablePath = [[NSBundle mainBundle] pathForResource:localizedStringsTableName ofType:@"strings"]; - if (localizedStringsTablePath && ![[[localizedStringsTablePath stringByDeletingLastPathComponent] lastPathComponent] isEqualToString:@"English.lproj"]) { - - NSNib *nib = [[NSNib alloc] initWithContentsOfURL:[NSURL fileURLWithPath:fileName]]; - BOOL success = [nib instantiateWithOwner:owner topLevelObjects:topLevelObjects]; - NSMutableArray *topLevelObjectsArray = [NSMutableArray arrayWithArray:*topLevelObjects]; - [[self class] _localizeStringsInObject:topLevelObjectsArray table:localizedStringsTableName]; - - [nib release]; - return success; - - } else { - return [self deliciousLocalizingLoadNibNamed:localizedStringsTableName owner:owner topLevelObjects:topLevelObjects]; - } -} -#endif - -+ (BOOL)deliciousLocalizingLoadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone -{ - NSString *localizedStringsTableName = [[fileName lastPathComponent] stringByDeletingPathExtension]; - NSString *localizedStringsTablePath = [[NSBundle mainBundle] pathForResource:localizedStringsTableName ofType:@"strings"]; - if (localizedStringsTablePath && ![[[localizedStringsTablePath stringByDeletingLastPathComponent] lastPathComponent] isEqualToString:@"English.lproj"]) { - - NSNib *nib = [[NSNib alloc] initWithContentsOfURL:[NSURL fileURLWithPath:fileName]]; - NSMutableArray *topLevelObjectsArray = [context objectForKey:NSNibTopLevelObjects]; - if (!topLevelObjectsArray) { - topLevelObjectsArray = [NSMutableArray array]; - context = [NSMutableDictionary dictionaryWithDictionary:context]; - [(NSMutableDictionary *)context setObject:topLevelObjectsArray forKey:NSNibTopLevelObjects]; - } - BOOL success = [nib instantiateNibWithExternalNameTable:context]; - [self _localizeStringsInObject:topLevelObjectsArray table:localizedStringsTableName]; - - [nib release]; - return success; - - } else { - return [self deliciousLocalizingLoadNibFile:fileName externalNameTable:context withZone:zone]; - } -} - -@end - -#pragma mark Private API - -@implementation NSBundle (DMLocalizedNibBundle_Private_API) - -+ (void)_localizeStringsInObject:(id)object table:(NSString *)table -{ - if ([object isKindOfClass:[NSArray class]]) { - NSArray *array = object; - - for (id nibItem in array) - [self _localizeStringsInObject:nibItem table:table]; - - } else if ([object isKindOfClass:[NSCell class]]) { - NSCell *cell = object; - - if ([cell isKindOfClass:[NSActionCell class]]) { - NSActionCell *actionCell = (NSActionCell *)cell; - - if ([actionCell isKindOfClass:[NSButtonCell class]]) { - NSButtonCell *buttonCell = (NSButtonCell *)actionCell; - if ([buttonCell imagePosition] != NSImageOnly) { - [self _localizeTitleOfObject:buttonCell table:table]; - [self _localizeStringValueOfObject:buttonCell table:table]; - [self _localizeAlternateTitleOfObject:buttonCell table:table]; - } - - } else if ([actionCell isKindOfClass:[NSTextFieldCell class]]) { - NSTextFieldCell *textFieldCell = (NSTextFieldCell *)actionCell; - // Following line is redundant with other code, localizes twice. - // [self _localizeTitleOfObject:textFieldCell table:table]; - [self _localizeStringValueOfObject:textFieldCell table:table]; - [self _localizePlaceholderStringOfObject:textFieldCell table:table]; - - } else if ([actionCell type] == NSTextCellType) { - [self _localizeTitleOfObject:actionCell table:table]; - [self _localizeStringValueOfObject:actionCell table:table]; - } - } - - } else if ([object isKindOfClass:[NSMenu class]]) { - NSMenu *menu = object; - [self _localizeTitleOfObject:menu table:table]; - - [self _localizeStringsInObject:[menu itemArray] table:table]; - - } else if ([object isKindOfClass:[NSMenuItem class]]) { - NSMenuItem *menuItem = object; - [self _localizeTitleOfObject:menuItem table:table]; - [self _localizeToolTipOfObject:menuItem table:table]; - - [self _localizeStringsInObject:[menuItem submenu] table:table]; - - } else if ([object isKindOfClass:[NSView class]]) { - NSView *view = object; - [self _localizeToolTipOfObject:view table:table]; - - if ([view isKindOfClass:[NSBox class]]) { - NSBox *box = (NSBox *)view; - [self _localizeTitleOfObject:box table:table]; - - } else if ([view isKindOfClass:[NSControl class]]) { - NSControl *control = (NSControl *)view; - - if ([view isKindOfClass:[NSButton class]]) { - NSButton *button = (NSButton *)control; - - if ([button isKindOfClass:[NSPopUpButton class]]) { - NSPopUpButton *popUpButton = (NSPopUpButton *)button; - NSMenu *menu = [popUpButton menu]; - - [self _localizeStringsInObject:[menu itemArray] table:table]; - } else - [self _localizeStringsInObject:[button cell] table:table]; - - - } else if ([view isKindOfClass:[NSMatrix class]]) { - NSMatrix *matrix = (NSMatrix *)control; - - NSArray *cells = [matrix cells]; - [self _localizeStringsInObject:cells table:table]; - - for (NSCell *cell in cells) { - - NSString *localizedCellToolTip = [self _localizedStringForString:[matrix toolTipForCell:cell] table:table]; - if (localizedCellToolTip) - [matrix setToolTip:localizedCellToolTip forCell:cell]; - } - - } else if ([view isKindOfClass:[NSSegmentedControl class]]) { - NSSegmentedControl *segmentedControl = (NSSegmentedControl *)control; - - NSInteger segmentIndex, segmentCount = [segmentedControl segmentCount]; - for (segmentIndex = 0; segmentIndex < segmentCount; segmentIndex++) { - NSString *localizedSegmentLabel = [self _localizedStringForString:[segmentedControl labelForSegment:segmentIndex] table:table]; - if (localizedSegmentLabel) - [segmentedControl setLabel:localizedSegmentLabel forSegment:segmentIndex]; - NSString *localizedSegmentTooltip = [self _localizedStringForString:[[segmentedControl cell] toolTipForSegment:segmentIndex] table:table]; - if (localizedSegmentTooltip) - [[segmentedControl cell] setToolTip:localizedSegmentTooltip forSegment:segmentIndex]; - - [self _localizeStringsInObject:[segmentedControl menuForSegment:segmentIndex] table:table]; - } - - } else if ([view isKindOfClass:[NSTableView class]]) { - for (NSTableColumn *column in [(NSTableView*)view tableColumns]) { - [self _localizeStringValueOfObject:[column headerCell] table:table]; - NSString *localizedHeaderTip = [self _localizedStringForString:[column headerToolTip] table:table]; - if (localizedHeaderTip) [column setHeaderToolTip:localizedHeaderTip]; - } - - } else if ([view isKindOfClass:[NSTextField class]]) { - NSDictionary *vb; - if ((vb = [view infoForBinding:@"value"])) { - NSMutableDictionary *lvb = [NSMutableDictionary dictionaryWithDictionary:[vb objectForKey:NSOptionsKey]]; - for (NSString *bindingKey in deliciousBindingKeys) { - if ([lvb objectForKey:bindingKey] == [NSNull null]) continue; - NSString *localizedBindingString = [self _localizedStringForString:[lvb objectForKey:bindingKey] table:table]; - if (localizedBindingString) - [lvb setObject:localizedBindingString forKey:bindingKey]; - } - [view bind:@"value" toObject:[vb objectForKey:NSObservedObjectKey] withKeyPath:[vb objectForKey:NSObservedKeyPathKey] options:lvb]; - } - [self _localizeStringsInObject:[control cell] table:table]; - - } else - [self _localizeStringsInObject:[control cell] table:table]; - - } else if ([view isKindOfClass:[NSTabView class]]) { - NSTabView *tabView = (NSTabView *)view; - for (NSTabViewItem *tabViewItem in [tabView tabViewItems]) { - [self _localizeLabelOfObject:tabViewItem table:table]; - if ([tabViewItem respondsToSelector:@selector(toolTip)]) // 10.6+ - [self _localizeToolTipOfObject:tabViewItem table:table]; - [self _localizeStringsInObject:[tabViewItem view] table:table]; - } - - } - - [self _localizeStringsInObject:[view subviews] table:table]; - - } else if ([object isKindOfClass:[NSWindow class]]) { - NSWindow *window = object; - [self _localizeTitleOfObject:window table:table]; - - [self _localizeStringsInObject:[window contentView] table:table]; - - } -} - -+ (NSString *)_localizedStringForString:(NSString *)string table:(NSString *)table -{ - if (![string length]) - return nil; - - static NSString *defaultValue = @"I AM THE DEFAULT VALUE"; - NSString *localizedString = [[NSBundle mainBundle] localizedStringForKey:string value:defaultValue table:table]; - if (localizedString != defaultValue) { - return localizedString; - } else { -#ifdef BETA_BUILD - NSLog(@" not going to localize string %@", string); -#endif - return nil; - } -} - - -#define DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(blahName, capitalizedBlahName) \ -+ (void)_localize ##capitalizedBlahName ##OfObject:(id)object table:(NSString *)table; \ -{ \ - NSString *localizedBlah = [self _localizedStringForString:[object blahName] table:table]; \ - if (localizedBlah) \ - [object set ##capitalizedBlahName:localizedBlah]; \ -} - -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(title, Title) -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(alternateTitle, AlternateTitle) -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(stringValue, StringValue) -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(placeholderString, PlaceholderString) -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(toolTip, ToolTip) -DM_DEFINE_LOCALIZE_BLAH_OF_OBJECT(label, Label) - -@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index e021848d..9d5f6ffd 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -293,7 +293,6 @@ 588B2CCA0FE5641E00EC5FC0 /* ssh-disconnected.png in Resources */ = {isa = PBXBuildFile; fileRef = 588B2CC70FE5641E00EC5FC0 /* ssh-disconnected.png */; }; 589235321020C1230011DE00 /* SPHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589235301020C1230011DE00 /* SPHistoryController.m */; }; 589582151154F8F400EDCC28 /* SPMainThreadTrampoline.m in Sources */ = {isa = PBXBuildFile; fileRef = 589582141154F8F400EDCC28 /* SPMainThreadTrampoline.m */; }; - 589ED05B11E0ACD100C1DCEA /* DMLocalizedNib.m in Sources */ = {isa = PBXBuildFile; fileRef = 589ED05A11E0ACD100C1DCEA /* DMLocalizedNib.m */; }; 58A137CD123ED5E6000B1B75 /* titlebarlock.png in Resources */ = {isa = PBXBuildFile; fileRef = 58A137CC123ED5E6000B1B75 /* titlebarlock.png */; }; 58A8A72711A0149100B95749 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58A8A72611A0149100B95749 /* MainWindow.xib */; }; 58A8A79111A036C000B95749 /* SPWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A8A79011A036C000B95749 /* SPWindowController.m */; }; @@ -332,7 +331,6 @@ 58B907CA11BDA541000826E5 /* PSMTabBar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B906E611BD989A000826E5 /* PSMTabBar.framework */; }; 58B907FB11BDA5A9000826E5 /* PSMTabBar.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 58B906E611BD989A000826E5 /* PSMTabBar.framework */; }; 58B9097B11C3A4A2000826E5 /* xibLocalizationPostprocessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B9095B11C3A3EC000826E5 /* xibLocalizationPostprocessor.m */; }; - 58B909A511C3B919000826E5 /* DMLocalizedNibBundle.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B909A411C3B919000826E5 /* DMLocalizedNibBundle.m */; }; 58C3506510B9A56C00D37E14 /* button_left.png in Resources */ = {isa = PBXBuildFile; fileRef = 58C3506410B9A56C00D37E14 /* button_left.png */; }; 58C3506710B9A57300D37E14 /* button_right.png in Resources */ = {isa = PBXBuildFile; fileRef = 58C3506610B9A57300D37E14 /* button_right.png */; }; 58C3506B10B9AA8B00D37E14 /* button_pagination.png in Resources */ = {isa = PBXBuildFile; fileRef = 58C3506A10B9AA8B00D37E14 /* button_pagination.png */; }; @@ -1020,7 +1018,6 @@ 589235311020C1230011DE00 /* SPHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPHistoryController.h; sourceTree = ""; }; 589582131154F8F400EDCC28 /* SPMainThreadTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPMainThreadTrampoline.h; sourceTree = ""; }; 589582141154F8F400EDCC28 /* SPMainThreadTrampoline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPMainThreadTrampoline.m; sourceTree = ""; }; - 589ED05A11E0ACD100C1DCEA /* DMLocalizedNib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DMLocalizedNib.m; sourceTree = ""; }; 58A137CC123ED5E6000B1B75 /* titlebarlock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = titlebarlock.png; sourceTree = ""; }; 58A2F3791AAAE1BE0018141B /* nightlybuildupload.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = nightlybuildupload.sh; sourceTree = ""; }; 58A2F37B1AAAE1C80018141B /* nightlybuildscript.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = nightlybuildscript.sh; sourceTree = ""; }; @@ -1095,7 +1092,6 @@ 58B9088711BDB7AA000826E5 /* PSMTabBar-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "PSMTabBar-Info.plist"; path = "Plists/PSMTabBar-Info.plist"; sourceTree = ""; }; 58B9095B11C3A3EC000826E5 /* xibLocalizationPostprocessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = xibLocalizationPostprocessor.m; sourceTree = ""; }; 58B9096111C3A42B000826E5 /* xibLocalizationPostprocessor */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xibLocalizationPostprocessor; sourceTree = BUILT_PRODUCTS_DIR; }; - 58B909A411C3B919000826E5 /* DMLocalizedNibBundle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DMLocalizedNibBundle.m; sourceTree = ""; }; 58C3506410B9A56C00D37E14 /* button_left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button_left.png; sourceTree = ""; }; 58C3506610B9A57300D37E14 /* button_right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button_right.png; sourceTree = ""; }; 58C3506A10B9AA8B00D37E14 /* button_pagination.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button_pagination.png; sourceTree = ""; }; @@ -2515,8 +2511,6 @@ 58B909A111C3B8EC000826E5 /* Localization */ = { isa = PBXGroup; children = ( - 589ED05A11E0ACD100C1DCEA /* DMLocalizedNib.m */, - 58B909A411C3B919000826E5 /* DMLocalizedNibBundle.m */, 58B9095B11C3A3EC000826E5 /* xibLocalizationPostprocessor.m */, ); name = Localization; @@ -3222,9 +3216,7 @@ 173C839311AAD32A00B8B084 /* SPPDFExporterDelegate.m in Sources */, 173C839411AAD32A00B8B084 /* SPSQLExporterDelegate.m in Sources */, 173C839511AAD32A00B8B084 /* SPXMLExporterDelegate.m in Sources */, - 58B909A511C3B919000826E5 /* DMLocalizedNibBundle.m in Sources */, 17A7773411C52D8E001E27B4 /* SPIndexesController.m in Sources */, - 589ED05B11E0ACD100C1DCEA /* DMLocalizedNib.m in Sources */, 17AF787B11FC41C00073D043 /* SPExportFilenameUtilities.m in Sources */, 17F90E481210B42700274C98 /* SPExportFile.m in Sources */, 17F90E4B1210B43A00274C98 /* SPExportFileUtilities.m in Sources */, -- cgit v1.2.3 From 8eadd956e7b28695a3204ed2ba695a771a2b8da4 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 Apr 2015 18:23:11 +0200 Subject: Add support for FULLTEXT indexes in InnoDB tables Fixes #1917 --- Source/SPIndexesController.h | 3 ++- Source/SPIndexesController.m | 16 +++++++++------- Source/SPServerSupport.h | 6 ++++++ Source/SPServerSupport.m | 3 +++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h index 6ee59226..82bc0a03 100644 --- a/Source/SPIndexesController.h +++ b/Source/SPIndexesController.h @@ -74,7 +74,8 @@ #endif BOOL _mainNibLoaded; - BOOL isMyISAMTale; + BOOL isMyISAMTable; + BOOL isInnoDBTable; NSString *table; NSMutableArray *fields, *indexes, *indexedFields; diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 5cca12f9..93466c27 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -166,7 +166,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // Check whether a save of the current field row is required. if (![tableStructure saveRowOnDeselect]) return; - isMyISAMTale = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"MyISAM"]; + isMyISAMTable = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"MyISAM"]; + isInnoDBTable = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"InnoDB"]; // Reset visibility of the primary key item [[[indexTypePopUpButton menu] itemWithTag:SPPrimaryKeyMenuTag] setHidden:NO]; @@ -236,7 +237,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; #ifndef SP_CODA // MyISAM and InnoDB tables only support BTREE storage types so disable the storage type popup button // as it's the default anyway. - [indexStorageTypePopUpButton setEnabled:(!(isMyISAMTale || [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"InnoDB"]))]; + [indexStorageTypePopUpButton setEnabled:(!(isMyISAMTable || isInnoDBTable))]; // The ability to specify an index's key block size was added in MySQL 5.1.10 so disable the textfield // if it's not supported. @@ -328,10 +329,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; } #ifndef SP_CODA - NSString *engine = [[tableData statusValues] objectForKey:@"Engine"]; - // Specifiying an index storage type (i.e. HASH or BTREE) is not permitted with SPATIAL indexes - [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !(isMyISAMTale || [engine isEqualToString:@"InnoDB"])]; + [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !(isMyISAMTable || isInnoDBTable)]; #endif } @@ -768,8 +767,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [indexTypePopUpButton removeItemAtIndex:[indexTypePopUpButton indexOfItemWithTag:SPFullTextMenuTag]]; } - // FULLTEXT and SPATIAL index types are only available using the MyISAM engine - if (isMyISAMTale) { + // SPATIAL index types are only available using the MyISAM engine + if (isMyISAMTable) { if ([[dbDocument serverSupport] supportsSpatialExtensions]) { NSMenuItem *spatialMenuItem = [[[NSMenuItem alloc] init] autorelease]; @@ -778,7 +777,10 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [[indexTypePopUpButton menu] addItem:spatialMenuItem]; } + } + // FULLTEXT only works with MyISAM and (InnoDB since 5.6.4) + if(isMyISAMTable || (isInnoDBTable && [[dbDocument serverSupport] supportsFulltextOnInnoDB])) { NSMenuItem *fullTextMenuItem = [[[NSMenuItem alloc] init] autorelease]; [fullTextMenuItem setTitle:NSLocalizedString(@"FULLTEXT", @"full text index menu item title")]; diff --git a/Source/SPServerSupport.h b/Source/SPServerSupport.h index e8b8a613..8052ed90 100644 --- a/Source/SPServerSupport.h +++ b/Source/SPServerSupport.h @@ -85,6 +85,7 @@ // Indexes BOOL supportsIndexKeyBlockSize; + BOOL supportsFulltextOnInnoDB; // Events BOOL supportsEvents; @@ -253,6 +254,11 @@ */ @property (readonly) BOOL supportsFractionalSeconds; +/** + * @property supportsFulltextOnInnoDB Indicates whether the server supports FULLTEXT indexes with the InnoDb engine. + */ +@property (readonly) BOOL supportsFulltextOnInnoDB; + - (id)initWithMajorVersion:(NSInteger)majorVersion minor:(NSInteger)minorVersion release:(NSInteger)releaseVersion; - (void)evaluate; diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m index bf74a61e..5537e476 100644 --- a/Source/SPServerSupport.m +++ b/Source/SPServerSupport.m @@ -76,6 +76,7 @@ @synthesize serverMajorVersion; @synthesize serverMinorVersion; @synthesize serverReleaseVersion; +@synthesize supportsFulltextOnInnoDB; #pragma mark - #pragma mark Initialisation @@ -198,6 +199,7 @@ // Fractional second support wasn't added until MySQL 5.6.4 supportsFractionalSeconds = [self isEqualToOrGreaterThanMajorVersion:5 minor:6 release:4]; + supportsFulltextOnInnoDB = supportsFractionalSeconds; //introduced in 5.6.4 too } /** @@ -288,6 +290,7 @@ supportsIndexKeyBlockSize = NO; supportsQuotingEngineTypeInCreateSyntax = NO; supportsFractionalSeconds = NO; + supportsFulltextOnInnoDB = NO; } /** -- cgit v1.2.3 From 438e86702a2337423d880e52fd043a74fa982ebd Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 Apr 2015 19:37:25 +0200 Subject: Remove a hidden, unconnected button Curiosly this button was supposed to display a "NSSwitch" image, which stems from OpenStep but is no longer present in OS X. Hopefully 2000 won't call and demand it back... --- Interfaces/English.lproj/IndexesView.xib | 46 -------------------------------- 1 file changed, 46 deletions(-) diff --git a/Interfaces/English.lproj/IndexesView.xib b/Interfaces/English.lproj/IndexesView.xib index 38edda7f..0de04c01 100644 --- a/Interfaces/English.lproj/IndexesView.xib +++ b/Interfaces/English.lproj/IndexesView.xib @@ -752,35 +752,6 @@ 0 NO - - - 268 - {{-83, 41}, {100, 18}} - - - YES - - 67108864 - 131072 - - - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - NO - {{-2, -30}, {335, 67}} @@ -1448,7 +1419,6 @@ - Advanced View for INSERT @@ -1477,19 +1447,6 @@ - - 68 - - - - - - - - 69 - - - 64 @@ -1842,8 +1799,6 @@ 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 @@ -5342,7 +5297,6 @@ {11, 11} {10, 3} - {15, 15} {32, 23} {10, 23} {32, 23} -- cgit v1.2.3 From 7a60951df49c129a7e24ec302d976d32dbe9af79 Mon Sep 17 00:00:00 2001 From: George Gardiner Date: Mon, 13 Apr 2015 09:11:51 +0100 Subject: Fixed a typo --- Source/SPSQLExporter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index f9dde93c..079ea8b9 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -729,7 +729,7 @@ // A NULL result indicates a permission problem if ([createProcedure isNSNull]) { - NSString *errorString = [NSString stringWithFormat:NSLocalizedString(@"Could not export the %@ '%@' because of a permisions error.\n", @"Procedure/function export permission error"), procedureType, procedureName]; + NSString *errorString = [NSString stringWithFormat:NSLocalizedString(@"Could not export the %@ '%@' because of a permissions error.\n", @"Procedure/function export permission error"), procedureType, procedureName]; [errors appendString:errorString]; if ([self sqlOutputIncludeErrors]) { [[self exportOutputFile] writeData:[[NSString stringWithFormat:@"# Error: %@\n", errorString] dataUsingEncoding:NSUTF8StringEncoding]]; -- cgit v1.2.3 From 9537631e044312f6639c14b0dc5ba158ca3d3ff8 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 13 Apr 2015 16:27:15 +0200 Subject: Fix a previous commit not catching all cases. --- Source/SPTableContentDelegate.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index 19bbc4b3..4d7bbb04 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -263,7 +263,14 @@ // Retrieve the column definition NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]]; - + + // TODO: Fix editing of "Display as Hex" columns and remove this (also see above) + if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { + NSBeep(); + [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")]; + return NO; + } + // Open the editing sheet if required if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) { @@ -347,13 +354,6 @@ return NO; } - // TODO: Fix editing of "Display as Hex" columns and remove this (also see above) - if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { - NSBeep(); - [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")]; - return NO; - } - return YES; } -- cgit v1.2.3 From 9a5cb83cdf913e616a0f96f4f720dc3187d650ce Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 13 Apr 2015 17:04:21 +0200 Subject: Dim the database name in relations view if foreign database == local database. --- Source/SPTableRelations.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 2374ea81..5734a96d 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -376,7 +376,13 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { - return [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]]; + id data = [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]]; + //dim the database name if it matches the current database + if([[tableColumn identifier] isEqualToString:SPRelationFKDatabaseKey] && [[tableDocumentInstance database] isEqual:data]) { + NSDictionary *textAttributes = @{NSForegroundColorAttributeName: [NSColor lightGrayColor]}; + data = [[[NSAttributedString alloc] initWithString:(NSString *)data attributes:textAttributes] autorelease]; + } + return data; } #pragma mark - -- cgit v1.2.3 From 028f1ff9ac1e22db9abec6ea3838079a08aa471e Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 16 Apr 2015 00:24:53 +0200 Subject: Restore detailed error messages for FK errors in MySQL 5.5+ --- Source/SPServerSupport.h | 16 ++++++++++++++++ Source/SPServerSupport.m | 24 ++++++++++++++++++++++++ Source/SPTableRelations.m | 24 ++++++++++++++---------- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/Source/SPServerSupport.h b/Source/SPServerSupport.h index 8052ed90..e4551643 100644 --- a/Source/SPServerSupport.h +++ b/Source/SPServerSupport.h @@ -28,6 +28,11 @@ // // More info at +typedef struct { + NSString *queryString; + NSUInteger columnIndex; +} SPInnoDBStatusQueryFormat; + /** * @class SPServerSupport SPServerSupport.h * @@ -79,6 +84,7 @@ BOOL supportsArchiveStorageEngine; BOOL supportsCSVStorageEngine; BOOL supportsQuotingEngineTypeInCreateSyntax; + BOOL supportsShowEngine; // Triggers BOOL supportsTriggers; @@ -259,9 +265,19 @@ */ @property (readonly) BOOL supportsFulltextOnInnoDB; +/** + * @property supportsShowEngine Indicates whether the server supports the "SHOW ENGINE x {LOGS|STATUS}" query. + */ +@property (readonly) BOOL supportsShowEngine; + - (id)initWithMajorVersion:(NSInteger)majorVersion minor:(NSInteger)minorVersion release:(NSInteger)releaseVersion; - (void)evaluate; - (BOOL)isEqualToOrGreaterThanMajorVersion:(NSInteger)majorVersion minor:(NSInteger)minorVersion release:(NSInteger)releaseVersion; +/** + * @return The correct query to get the InnoDB engine status. queryString is nil for unsupported versions. + * The columnIndex tells the index of the column (starting with 0) in which the status text is returned. + */ +- (SPInnoDBStatusQueryFormat)innoDBStatusQuery; @end diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m index 5537e476..489acc04 100644 --- a/Source/SPServerSupport.m +++ b/Source/SPServerSupport.m @@ -77,6 +77,7 @@ @synthesize serverMinorVersion; @synthesize serverReleaseVersion; @synthesize supportsFulltextOnInnoDB; +@synthesize supportsShowEngine; #pragma mark - #pragma mark Initialisation @@ -200,6 +201,28 @@ // Fractional second support wasn't added until MySQL 5.6.4 supportsFractionalSeconds = [self isEqualToOrGreaterThanMajorVersion:5 minor:6 release:4]; supportsFulltextOnInnoDB = supportsFractionalSeconds; //introduced in 5.6.4 too + + // The SHOW ENGINE query wasn't added until MySQL 4.1.2 + supportsShowEngine = [self isEqualToOrGreaterThanMajorVersion:4 minor:1 release:2]; +} + +- (SPInnoDBStatusQueryFormat)innoDBStatusQuery +{ + SPInnoDBStatusQueryFormat tuple = {nil,0}; + + //if we have SHOW ENGINE go with that + if(supportsShowEngine) { + tuple.queryString = @"SHOW ENGINE INNODB STATUS"; + tuple.columnIndex = 2; + } + //up to mysql 5.5 we could also use the old SHOW INNODB STATUS + if([self isEqualToOrGreaterThanMajorVersion:3 minor:23 release:52] && + ![self isEqualToOrGreaterThanMajorVersion:5 minor:5 release:0]) { + tuple.queryString = @"SHOW INNODB STATUS"; + tuple.columnIndex = 0; + } + + return tuple; } /** @@ -291,6 +314,7 @@ supportsQuotingEngineTypeInCreateSyntax = NO; supportsFractionalSeconds = NO; supportsFulltextOnInnoDB = NO; + supportsShowEngine = NO; } /** diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 5734a96d..43156eae 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -35,6 +35,7 @@ #import "SPTableView.h" #import "SPAlertSheets.h" #import "RegexKitLite.h" +#import "SPServerSupport.h" #import @@ -192,16 +193,19 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; // most common are 121 (name probably in use) and 150 (types don't exactly match). // Retrieve the InnoDB status and extract the most recent error for more helpful text. if ([connection lastErrorID] == 1005) { - NSString *statusText = [connection getFirstFieldFromQuery:@"SHOW INNODB STATUS"]; - NSString *detailErrorString = [statusText stringByMatching:@"latest foreign key error\\s+-----*\\s+[0-9: ]*(.*?)\\s+-----" options:(RKLCaseless | RKLDotAll) inRange:NSMakeRange(0, [statusText length]) capture:1L error:NULL]; - if (detailErrorString) { - errorText = [NSString stringWithFormat:NSLocalizedString(@"%@\n\nDetail: %@", @"Add relation error detail intro"), errorText, [detailErrorString stringByReplacingOccurrencesOfString:@"\n" withString:@" "]]; - } - - // Detect name duplication if appropriate - if ([errorText isMatchedByRegex:@"errno: 121"] && [errorText isMatchedByRegex:@"already exists"]) { - [takenConstraintNames addObject:[[constraintName stringValue] lowercaseString]]; - [self controlTextDidChange:[NSNotification notificationWithName:@"dummy" object:constraintName]]; + SPInnoDBStatusQueryFormat status = [[tableDocumentInstance serverSupport] innoDBStatusQuery]; + if(status.queryString) { + NSString *statusText = [[[connection queryString:status.queryString] getRowAsArray] objectAtIndex:status.columnIndex]; + NSString *detailErrorString = [statusText stringByMatching:@"latest foreign key error\\s+-----*\\s+[0-9: ]*(.*?)\\s+-----" options:(RKLCaseless | RKLDotAll) inRange:NSMakeRange(0, [statusText length]) capture:1L error:NULL]; + if (detailErrorString) { + errorText = [NSString stringWithFormat:NSLocalizedString(@"%@\n\nDetail: %@", @"Add relation error detail intro"), errorText, [detailErrorString stringByReplacingOccurrencesOfString:@"\n" withString:@" "]]; + } + + // Detect name duplication if appropriate + if ([errorText isMatchedByRegex:@"errno: 121"] && [errorText isMatchedByRegex:@"already exists"]) { + [takenConstraintNames addObject:[[constraintName stringValue] lowercaseString]]; + [self controlTextDidChange:[NSNotification notificationWithName:@"dummy" object:constraintName]]; + } } } -- cgit v1.2.3 From 734d3a90187734b7d7d4678229644573ccdbf7bb Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 16 Apr 2015 02:45:16 +0200 Subject: Change the visual appearance of the FK creation error dialog a bit --- Interfaces/English.lproj/DBView.xib | 894 +++++++++++++++++++++++++++++++++--- Source/SPTableRelations.h | 5 +- Source/SPTableRelations.m | 27 +- 3 files changed, 853 insertions(+), 73 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 192a0566..ecfca35c 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 6254 + 6751 1265.21 698.00 - 6254 - 6254 + 6751 + 6751 NSBox @@ -109,7 +109,7 @@ {218, 38} - + YES NO YES @@ -250,7 +250,7 @@ {{-1, -13}, {220, 40}} - + 133122 @@ -349,7 +349,7 @@ {214, 334} - + YES NO YES @@ -446,7 +446,7 @@ {214, 334} - + 133648 @@ -495,7 +495,7 @@ {216, 166} - + YES NO YES @@ -592,7 +592,7 @@ {{-1, 0}, {216, 166}} - + 133648 @@ -616,7 +616,7 @@ {214, 166} - + YES NO YES @@ -714,7 +714,7 @@ {214, 166} - + 133632 @@ -2048,7 +2048,6 @@ - 1 YES 1 YES @@ -2633,7 +2632,7 @@ {{93, 0}, {601, 23}} - + YES 0 @@ -3982,7 +3981,7 @@ 4352 - {694, 182} + {693, 182} YES @@ -3991,7 +3990,7 @@ 256 - {694, 17} + {693, 17} @@ -4103,7 +4102,6 @@ - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -6948,7 +6946,7 @@ {384, 133} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {384, 155} {600, 155} YES @@ -7125,7 +7123,7 @@ {384, 119} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {384, 141} {600, 141} YES @@ -7318,7 +7316,7 @@ {379, 154} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {379, 176} {379, 176} YES @@ -7430,7 +7428,7 @@ {314, 112} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {292, 134} {650, 134} YES @@ -7447,7 +7445,7 @@ {600, 162} {384, 142} - + 256 @@ -7455,6 +7453,7 @@ 256 {{5, 125}, {128, 14}} + YES @@ -7474,6 +7473,7 @@ 256 {{5, 100}, {128, 14}} + YES @@ -7493,6 +7493,7 @@ 258 {{138, 124}, {226, 18}} + YES @@ -7513,6 +7514,8 @@ 257 {{291, 13}, {78, 28}} + + {250, 750} 1 YES @@ -7538,6 +7541,7 @@ 258 {{135, 95}, {232, 22}} + YES @@ -7571,6 +7575,7 @@ 256 {{5, 75}, {128, 14}} + YES @@ -7590,6 +7595,7 @@ 258 {{135, 70}, {232, 22}} + YES @@ -7623,6 +7629,7 @@ 256 {{5, 49}, {128, 14}} + YES @@ -7642,6 +7649,7 @@ 258 {{135, 45}, {232, 22}} + YES @@ -7675,6 +7683,7 @@ 257 {{209, 13}, {84, 28}} + {250, 750} YES @@ -7696,9 +7705,11 @@ {384, 162} + + - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {384, 164} {600, 184} YES @@ -7834,7 +7845,7 @@ {260, 127} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {260, 149} {600, 149} YES @@ -7995,7 +8006,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {306, 122} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {213, 129} {10000000000000, 10000000000000} YES @@ -8195,7 +8206,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {303, 95} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {255, 117} {10000000000000, 10000000000000} YES @@ -8210,7 +8221,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - + 256 @@ -8226,6 +8237,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{115, 10}, {171, 22}} + YES @@ -8293,6 +8305,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 15}, {98, 14}} + YES @@ -8310,11 +8323,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 1}, {343, 40}} + {{17, 231}, {345, 56}} + {0, 0} @@ -8351,6 +8366,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 17}, {98, 14}} + YES @@ -8370,6 +8386,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{118, 14}, {165, 19}} + YES @@ -8389,11 +8406,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 1}, {343, 42}} + {{17, 291}, {345, 58}} + {0, 0} @@ -8430,6 +8449,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{116, 40}, {170, 22}} + YES @@ -8522,6 +8542,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{116, 10}, {170, 22}} + YES @@ -8614,6 +8635,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 45}, {99, 14}} + YES @@ -8633,6 +8655,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 15}, {98, 14}} + YES @@ -8650,11 +8673,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 1}, {343, 71}} + {{17, 49}, {345, 87}} + {0, 0} @@ -8691,6 +8716,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{115, 40}, {171, 22}} + YES @@ -8758,6 +8784,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{115, 10}, {171, 22}} + YES @@ -8825,6 +8852,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 45}, {98, 14}} + YES @@ -8844,6 +8872,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{15, 15}, {98, 14}} + YES @@ -8861,11 +8890,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 1}, {343, 71}} + {{17, 140}, {345, 87}} + {0, 0} @@ -8894,6 +8925,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{268, 13}, {96, 28}} + + {250, 750} 1 YES @@ -8918,6 +8951,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{174, 13}, {96, 28}} + {250, 750} YES @@ -8942,6 +8976,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 -2147483356 {{20, 20}, {16, 16}} + {750, 750} 28942 @@ -8952,6 +8987,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 -2147483356 {{41, 21}, {133, 14}} + YES @@ -8968,9 +9004,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {379, 369} + + - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} YES @@ -9378,7 +9416,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {360, 348} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {360, 370} {10000000000000, 10000000000000} YES @@ -9511,7 +9549,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {379, 139} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {213, 72} {10000000000000, 10000000000000} YES @@ -9658,7 +9696,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {381, 247} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {213, 129} {10000000000000, 10000000000000} YES @@ -9894,7 +9932,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {411, 341} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {350, 222} {10000000000000, 10000000000000} SPCreateSyntaxSheet @@ -10083,7 +10121,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {405, 267} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {213, 129} {10000000000000, 10000000000000} YES @@ -10500,7 +10538,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {505, 308} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {351, 136} {10000000000000, 10000000000000} MYSQL_HELP_WINDOW @@ -11029,7 +11067,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {752, 317} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {600, 339} {10000000000000, 10000000000000} SPTableFilterPanel @@ -11222,7 +11260,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {251, 102} - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {251, 124} {251, 124} YES @@ -11239,7 +11277,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {600, 127} {260, 127} - + 256 @@ -11247,7 +11285,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{17, 93}, {225, 14}} - YES @@ -11267,7 +11304,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{19, 67}, {220, 18}} - YES @@ -11288,7 +11324,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 289 {{150, 13}, {94, 28}} - {250, 750} 1 YES @@ -11314,7 +11349,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 292 {{14, 13}, {99, 28}} - {250, 750} YES @@ -11339,7 +11373,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{18, 43}, {224, 18}} - YES @@ -11361,11 +11394,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {260, 127} - - - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {260, 149} {600, 149} YES @@ -11380,7 +11411,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - + 256 @@ -11388,7 +11419,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{228, 12}, {96, 32}} - {250, 750} 1 YES @@ -11413,7 +11443,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{132, 12}, {96, 32}} - {250, 750} YES @@ -11438,7 +11467,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{20, 60}, {298, 22}} - YES @@ -11462,7 +11490,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{17, 113}, {304, 17}} - YES @@ -11482,7 +11509,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{17, 90}, {304, 14}} - YES @@ -11499,11 +11525,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {338, 150} - - - {{0, 0}, {1920, 1178}} + {{0, 0}, {1440, 878}} {10000000000000, 10000000000000} YES @@ -11924,7 +11948,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NSView - + 4364 @@ -11932,7 +11956,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{20, 1}, {176, 19}} - YES 342884417 @@ -11984,8 +12007,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {217, 20} - - NSView @@ -12485,6 +12506,175 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + + + 268 + + + + 274 + + + + 2322 + + + + 2322 + {392, 110} + + + + _NS:13 + + + + + + + + + + + + 166 + + + + 392 + 1 + + + 16912129 + 0 + + + + + + + + + + + + + + + 0 + + 6 + {463, 10000000} + + + + {{1, 1}, {392, 110}} + + + + _NS:11 + + + + {4, 5} + + 12582912 + + + + + + TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym +SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA +AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA +AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA +AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA + + + + + + 3 + MCAwAA + + + + 4 + + + + -2147483392 + {{244, 1}, {15, 76}} + + + + _NS:85 + NO + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + + _NS:33 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{1, 0}, {394, 112}} + + + + _NS:9 + 133650 + + + + 0.25 + 4 + 1 + + + + 266 + {{-1, 118}, {398, 17}} + + + + _NS:526 + {251, 750} + YES + + 68157504 + 272630784 + Details: + + _NS:526 + + + + + NO + 1 + + + {395, 135} + + + + _NS:9 + + NO @@ -16369,6 +16559,22 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 5917 + + + detailErrorView + + + + tnS-Wc-vbj + + + + detailErrorText + + + + JXS-FR-qOe + delegate @@ -24013,6 +24219,54 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + + VCn-3k-MdI + + + + + + + MySQL Error Accessory View + + + GVI-VY-JuM + + + + + + + + 00a-86-EQq + + + + + qxR-EW-V6F + + + + + + + + + + UVh-gz-xnJ + + + + + TRD-dk-r1Q + + + + + mRm-ts-hRV + + + @@ -24022,6 +24276,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -26799,8 +27054,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {-318.5, -215.5} + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -26814,6 +27075,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -30803,6 +31066,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NSButton NSTextField NSProgressIndicator + NSTextView + NSView NSTextField NSPopUpButton NSPopUpButton @@ -30846,6 +31111,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 dataProgressIndicator NSProgressIndicator + + detailErrorText + NSTextView + + + detailErrorView + NSView + labelTextField NSTextField @@ -31878,6 +32151,513 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSComboBox + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSComboBox.h + + + + NSComboBoxCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSComboBoxCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSNumberFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSNumberFormatter.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSRuleEditor + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSRuleEditor.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSSecureTextFieldCell + NSTextFieldCell + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSStepper + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSStepper.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSTokenField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSTokenField.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSViewController + NSResponder + + view + NSView + + + view + + view + NSView + + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + QCView + NSView + + id + id + id + + + + play: + id + + + start: + id + + + stop: + id + + + + IBFrameworkSource + Quartz.framework/Frameworks/QuartzComposer.framework/Headers/QCView.h + + + + WebView + NSView + + id + id + id + id + id + id + id + id + id + id + id + + + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 IBCocoaFramework diff --git a/Source/SPTableRelations.h b/Source/SPTableRelations.h index 4bb998c9..1ab7f1b7 100644 --- a/Source/SPTableRelations.h +++ b/Source/SPTableRelations.h @@ -58,7 +58,10 @@ IBOutlet NSButton *confirmAddRelationButton; IBOutlet NSProgressIndicator *dataProgressIndicator; IBOutlet NSTextField *progressStatusTextField; - + + IBOutlet NSView *detailErrorView; + IBOutlet NSTextView *detailErrorText; + SPMySQLConnection *connection; NSUserDefaults *prefs; diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 43156eae..0caf78b6 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -53,7 +53,6 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; - (void)_refreshRelationDataForcingCacheRefresh:(BOOL)clearAllCaches; - (void)_updateAvailableTableColumns; -- (void)_reopenRelationSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; @end @@ -188,6 +187,12 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; // Retrieve the last connection error message. NSString *errorText = [connection lastErrorMessage]; + + NSAlert *alert = [[[NSAlert alloc] init] autorelease]; + + [alert setMessageText:NSLocalizedString(@"Error creating relation", @"error creating relation message")]; + [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")]; + [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"The specified relation could not be created.\n\nMySQL said: %@", @"error creating relation informative message"), errorText]]; // An error ID of 1005 indicates a foreign key error. These are thrown for many reasons, but the two // most common are 121 (name probably in use) and 150 (types don't exactly match). @@ -198,7 +203,8 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; NSString *statusText = [[[connection queryString:status.queryString] getRowAsArray] objectAtIndex:status.columnIndex]; NSString *detailErrorString = [statusText stringByMatching:@"latest foreign key error\\s+-----*\\s+[0-9: ]*(.*?)\\s+-----" options:(RKLCaseless | RKLDotAll) inRange:NSMakeRange(0, [statusText length]) capture:1L error:NULL]; if (detailErrorString) { - errorText = [NSString stringWithFormat:NSLocalizedString(@"%@\n\nDetail: %@", @"Add relation error detail intro"), errorText, [detailErrorString stringByReplacingOccurrencesOfString:@"\n" withString:@" "]]; + [alert setAccessoryView:detailErrorView]; + [detailErrorText setString:[detailErrorString stringByReplacingOccurrencesOfString:@"\n" withString:@" "]]; } // Detect name duplication if appropriate @@ -209,11 +215,10 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; } } - SPBeginAlertSheet(NSLocalizedString(@"Error creating relation", @"error creating relation message"), - NSLocalizedString(@"OK", @"OK button"), - nil, nil, [NSApp mainWindow], self, @selector(_reopenRelationSheet:returnCode:contextInfo:), nil, - [NSString stringWithFormat:NSLocalizedString(@"The specified relation was unable to be created.\n\nMySQL said: %@", @"error creating relation informative message"), errorText]); - } + [[alert onMainThread] beginSheetModalForWindow:[tableDocumentInstance parentWindow] completionHandler:^(NSModalResponse returnCode) { + [self performSelector:@selector(openRelationSheet:) withObject:self afterDelay:0.0]; + }]; + } else { [self _refreshRelationDataForcingCacheRefresh:YES]; } @@ -661,14 +666,6 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; [columnInfo release]; } -/** - * Reopen the add relation sheet, usually after an error message, with the previous content. - */ -- (void)_reopenRelationSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo -{ - [self performSelector:@selector(openRelationSheet:) withObject:self afterDelay:0.0]; -} - #pragma mark - - (void)dealloc -- cgit v1.2.3 From 55951d00cde44cfc654a2a6cb97e941eca2eb70f Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 16 Apr 2015 03:06:42 +0200 Subject: =?UTF-8?q?Silly=20me,=20tried=20to=20use=20a=20method=20that=20wa?= =?UTF-8?q?s=20newer=20than=2010.6=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableRelations.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 0caf78b6..134aa2fb 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -53,6 +53,7 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; - (void)_refreshRelationDataForcingCacheRefresh:(BOOL)clearAllCaches; - (void)_updateAvailableTableColumns; +- (void)addAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; @end @@ -215,15 +216,18 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; } } - [[alert onMainThread] beginSheetModalForWindow:[tableDocumentInstance parentWindow] completionHandler:^(NSModalResponse returnCode) { - [self performSelector:@selector(openRelationSheet:) withObject:self afterDelay:0.0]; - }]; + [[alert onMainThread] beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(addAlertDidEnd:returnCode:contextInfo:) contextInfo:NULL]; } else { [self _refreshRelationDataForcingCacheRefresh:YES]; } } +- (void)addAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + [self performSelector:@selector(openRelationSheet:) withObject:self afterDelay:0.0]; +} + /** * Updates the available columns when the user selects a table. */ -- cgit v1.2.3 From 75738e17389d9d66713fdde60cfd59774c934557 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 22 Apr 2015 22:30:57 +0200 Subject: Fixed two case of background thread interacting with UI aka "deleted uncommited CA transaction" --- Source/SPDatabaseDocument.m | 5 +++-- Source/SPHistoryController.m | 2 +- Source/SPTableContent.m | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 506e78f6..0b4abdb9 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4577,8 +4577,9 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [sessionState setObject:[NSNumber numberWithBool:[tableContentInstance sortColumnIsAscending]] forKey:@"contentSortColIsAsc"]; [sessionState setObject:[NSNumber numberWithInteger:[tableContentInstance pageNumber]] forKey:@"contentPageNumber"]; [sessionState setObject:NSStringFromRect([tableContentInstance viewport]) forKey:@"contentViewport"]; - if ([tableContentInstance filterSettings]) - [sessionState setObject:[tableContentInstance filterSettings] forKey:@"contentFilter"]; + NSDictionary *filterSettings = [tableContentInstance filterSettings]; + if (filterSettings) + [sessionState setObject:filterSettings forKey:@"contentFilter"]; NSDictionary *contentSelectedRows = [tableContentInstance selectionDetailsAllowingIndexSelection:YES]; if (contentSelectedRows) { diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m index aa504bc2..87cc4eab 100644 --- a/Source/SPHistoryController.m +++ b/Source/SPHistoryController.m @@ -276,7 +276,7 @@ NSUInteger contentPageNumber = [tableContentInstance pageNumber]; NSDictionary *contentSelectedRows = [tableContentInstance selectionDetailsAllowingIndexSelection:YES]; NSRect contentViewport = [tableContentInstance viewport]; - NSDictionary *contentFilter = [tableContentInstance filterSettings]; + NSDictionary *contentFilter = [[tableContentInstance onMainThread] filterSettings]; NSData *filterTableData = [tableContentInstance filterTableData]; if (!theDatabase) return; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 45add266..7b60d152 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -811,7 +811,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper [self fieldListForQuery], [selectedTable backtickQuotedString]]; // Add a filter string if appropriate - filterString = [self tableFilterString]; + filterString = [[self onMainThread] tableFilterString]; if (filterString) { [queryString appendFormat:@" WHERE %@", filterString]; @@ -1071,6 +1071,8 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper * Returns the query string for the current filter settings, * ready to be dropped into a WHERE clause, or nil if no filtering * is active. + * + * @warning Uses UI. ONLY call from main thread! */ - (NSString *)tableFilterString { @@ -3912,6 +3914,8 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper /** * Provide a getter for the current filter details + * + * @warning Uses UI. MUST call from main thread! */ - (NSDictionary *) filterSettings { -- cgit v1.2.3 From 5ef3f0df72d89ad85680a02048c27e2460e2c685 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 22 Apr 2015 22:41:58 +0200 Subject: Move some complex logic into its own class so it will easier to write some unit tests and refactor some of the code. --- Source/SPTableContent.m | 167 ++------------------------ Source/SPTableFilterParser.h | 61 ++++++++++ Source/SPTableFilterParser.m | 225 +++++++++++++++++++++++++++++++++++ sequel-pro.xcodeproj/project.pbxproj | 6 + 4 files changed, 303 insertions(+), 156 deletions(-) create mode 100644 Source/SPTableFilterParser.h create mode 100644 Source/SPTableFilterParser.m diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 7b60d152..308c101b 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -61,6 +61,7 @@ #endif #import "SPCustomQuery.h" #import "SPThreadAdditions.h" +#import "SPTableFilterParser.h" #import #import @@ -1104,8 +1105,6 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper BOOL caseSensitive = (([[[NSApp onMainThread] currentEvent] modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)) > 0); - NSString *filterString; - if(contentFilters == nil) { NSLog(@"Fatal error while retrieving content filters. No filters found."); NSBeep(); @@ -1133,160 +1132,16 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper return nil; } - - NSUInteger numberOfArguments = [[filter objectForKey:@"NumberOfArguments"] integerValue]; - - BOOL suppressLeadingTablePlaceholder = NO; - if([filter objectForKey:@"SuppressLeadingFieldPlaceholder"]) - suppressLeadingTablePlaceholder = YES; - - // argument if Filter requires only one argument - NSMutableString *argument = [[NSMutableString alloc] initWithString:[argumentField stringValue]]; - - // If the filter field is empty and the selected filter does not require - // only one argument, then no filtering is required - return nil. - if (![argument length] && numberOfArguments == 1) { - [argument release]; - return nil; - } - - // arguments if Filter requires two arguments - NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:[firstBetweenField stringValue]]; - NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:[secondBetweenField stringValue]]; - - // If filter requires two arguments and either of the argument fields are empty - // return nil. - if (numberOfArguments == 2) { - if (([firstBetweenArgument length] == 0) || ([secondBetweenArgument length] == 0)) { - [argument release]; - [firstBetweenArgument release]; - [secondBetweenArgument release]; - return nil; - } - } - - // Retrieve actual WHERE clause - NSMutableString *clause = [[NSMutableString alloc] init]; - [clause setString:[filter objectForKey:@"Clause"]]; - - [clause replaceOccurrencesOfRegex:@"(? 0) - [clause replaceOccurrencesOfRegex:@"%" withString:@"%%"]; - [clause flushCachedRegexData]; - - // Replace placeholder ${} by %@ - NSRange matchedRange; - NSString *re = @"(? 2) { - NSLog(@"Filter with more than 2 arguments is not yet supported."); - NSBeep(); - } - } - } else { - if (numberOfArguments == 2) { - filterString = [NSString stringWithFormat:@"%@ %@", - [[fieldField titleOfSelectedItem] backtickQuotedString], - [NSString stringWithFormat:clause, - [self escapeFilterArgument:firstBetweenArgument againstClause:clause], - [self escapeFilterArgument:secondBetweenArgument againstClause:clause]]]; - } else if (numberOfArguments == 1) { - filterString = [NSString stringWithFormat:@"%@ %@", - [[fieldField titleOfSelectedItem] backtickQuotedString], - [NSString stringWithFormat:clause, [self escapeFilterArgument:argument againstClause:clause]]]; - } else { - filterString = [NSString stringWithFormat:@"%@ %@", - [[fieldField titleOfSelectedItem] backtickQuotedString], clause]; - if(numberOfArguments > 2) { - NSLog(@"Filter with more than 2 arguments is not yet supported."); - NSBeep(); - } - } - } - - [argument release]; - [firstBetweenArgument release]; - [secondBetweenArgument release]; - [clause release]; - - // Return the filter string - return filterString; -} - -/** - * Escape argument by looking for used quoting strings in a clause. Attempt to - * be smart - use a single escape for most clauses, doubling up for LIKE clauses. - * Also attempt to not escape what look like common escape sequences - \n, \r, \t. - * - * @param argument The to be used filter argument which should be be escaped - * - * @param clause The entire WHERE filter clause - * - */ -- (NSString *)escapeFilterArgument:(NSString *)argument againstClause:(NSString *)clause -{ - BOOL clauseIsLike = [clause isMatchedByRegex:@"(?i)\\blike\\b.*?%(?!@)"]; - NSString *recognizedEscapeSequences, *escapeSequence, *regexTerm; - NSMutableString *arg = [argument mutableCopy]; - - // Determine the character set not to escape slashes before, and the escape depth - if (clauseIsLike) { - recognizedEscapeSequences = @"nrt_%"; - escapeSequence = @"\\\\\\\\\\\\\\\\"; - } else { - recognizedEscapeSequences = @"nrt"; - escapeSequence = @"\\\\\\\\"; - } - regexTerm = [NSString stringWithFormat:@"(\\\\)(?![%@])", recognizedEscapeSequences]; - - // Escape slashes appropriately - [arg replaceOccurrencesOfRegex:regexTerm withString:escapeSequence]; - [arg flushCachedRegexData]; - - // Get quote sign for escaping - this should work for 99% of all cases - NSString *quoteSign = [clause stringByMatching:@"([\"'])[^\\1]*?%@[^\\1]*?\\1" capture:1L]; - - // Escape argument - if(quoteSign != nil && [quoteSign length] == 1) { - [arg replaceOccurrencesOfRegex:[NSString stringWithFormat:@"(%@)", quoteSign] withString:@"\\\\$1"]; - [arg flushCachedRegexData]; - } - - return [arg autorelease]; + + SPTableFilterParser *parser = [[[SPTableFilterParser alloc] initWithFilterClause:[filter objectForKey:@"Clause"] numberOfArguments:[[filter objectForKey:@"NumberOfArguments"] integerValue]] autorelease]; + [parser setArgument:[argumentField stringValue]]; + [parser setFirstBetweenArgument:[firstBetweenField stringValue]]; + [parser setSecondBetweenArgument:[secondBetweenField stringValue]]; + [parser setSuppressLeadingTablePlaceholder:(!![filter objectForKey:@"SuppressLeadingFieldPlaceholder"])]; + [parser setCaseSensitive:caseSensitive]; + [parser setCurrentField:[fieldField titleOfSelectedItem]]; + + return [parser filterString]; } /** diff --git a/Source/SPTableFilterParser.h b/Source/SPTableFilterParser.h new file mode 100644 index 00000000..069c802c --- /dev/null +++ b/Source/SPTableFilterParser.h @@ -0,0 +1,61 @@ +// +// SPTableFilterParser.h +// sequel-pro +// +// Created by Max Lohrmann on 22.04.15. +// Relocated from existing files. Previous copyright applies. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import + +@interface SPTableFilterParser : NSObject +{ + NSString *_clause; + NSUInteger numberOfArguments; + + NSString *_currentField; + NSString *_argument; + NSString *_firstBetweenArgument; + NSString *_secondsBetweenArgument; + + BOOL caseSensitive; + BOOL suppressLeadingTablePlaceholder; +} + +- (id)initWithFilterClause:(NSString *)filter numberOfArguments:(NSUInteger)numArgs; + +@property(readonly) NSString *clause; +@property(readonly) NSUInteger numberOfArguments; + +@property BOOL suppressLeadingTablePlaceholder; +@property BOOL caseSensitive; +@property(copy) NSString *currentField; +@property(copy) NSString *argument; +@property(copy) NSString *firstBetweenArgument; +@property(copy) NSString *secondBetweenArgument; + +- (NSString *)filterString; + +@end diff --git a/Source/SPTableFilterParser.m b/Source/SPTableFilterParser.m new file mode 100644 index 00000000..96ba8368 --- /dev/null +++ b/Source/SPTableFilterParser.m @@ -0,0 +1,225 @@ +// +// SPTableFilterParser.m +// sequel-pro +// +// Created by Max Lohrmann on 22.04.15. +// Relocated from existing files. Previous copyright applies. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import "SPTableFilterParser.h" +#import "RegexKitLite.h" + +@interface SPTableFilterParser (Private) ++ (NSString *)escapeFilterArgument:(NSString *)argument againstClause:(NSString *)clause; +@end + +@implementation SPTableFilterParser + +@synthesize suppressLeadingTablePlaceholder = suppressLeadingTablePlaceholder; +@synthesize caseSensitive = caseSensitive; +@synthesize currentField = _currentField; +@synthesize argument = _argument; +@synthesize firstBetweenArgument = _firstBetweenArgument; +@synthesize secondBetweenArgument = _secondBetweenArgument; +@synthesize numberOfArguments = numberOfArguments; +@synthesize clause = _clause; + +- (id)initWithFilterClause:(NSString *)filter numberOfArguments:(NSUInteger)numArgs +{ + self = [super init]; + if (self) { + numberOfArguments = numArgs; + _clause = [filter copy]; + } + return self; +} + +- (void)dealloc +{ + SPClear(_clause); + + [self setCurrentField:nil]; + [self setArgument:nil]; + [self setFirstBetweenArgument:nil]; + [self setSecondBetweenArgument:nil]; + + [super dealloc]; +} + +- (NSString *)filterString +{ + NSString *filterString; + + // argument if Filter requires only one argument + NSMutableString *argument = [[NSMutableString alloc] initWithString:_argument]; + + // If the filter field is empty and the selected filter does not require + // only one argument, then no filtering is required - return nil. + if (![argument length] && numberOfArguments == 1) { + [argument release]; + return nil; + } + + // arguments if Filter requires two arguments + NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:_firstBetweenArgument]; + NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:_secondBetweenArgument]; + + // If filter requires two arguments and either of the argument fields are empty + // return nil. + if (numberOfArguments == 2) { + if (([firstBetweenArgument length] == 0) || ([secondBetweenArgument length] == 0)) { + [argument release]; + [firstBetweenArgument release]; + [secondBetweenArgument release]; + return nil; + } + } + + // Retrieve actual WHERE clause + NSMutableString *clause = [[NSMutableString alloc] init]; + [clause setString:_clause]; + + [clause replaceOccurrencesOfRegex:@"(? 0) + [clause replaceOccurrencesOfRegex:@"%" withString:@"%%"]; + [clause flushCachedRegexData]; + + // Replace placeholder ${} by %@ + NSRange matchedRange; + NSString *re = @"(? 2) { + SPLog(@"Filter with more than 2 arguments is not yet supported."); + NSBeep(); + } + } + } else { + if (numberOfArguments == 2) { + filterString = [NSString stringWithFormat:@"%@ %@", + [_currentField backtickQuotedString], + [NSString stringWithFormat:clause, + [[self class] escapeFilterArgument:firstBetweenArgument againstClause:clause], + [[self class] escapeFilterArgument:secondBetweenArgument againstClause:clause]]]; + } else if (numberOfArguments == 1) { + filterString = [NSString stringWithFormat:@"%@ %@", + [_currentField backtickQuotedString], + [NSString stringWithFormat:clause, [[self class] escapeFilterArgument:argument againstClause:clause]]]; + } else { + filterString = [NSString stringWithFormat:@"%@ %@", + [_currentField backtickQuotedString], clause]; + if(numberOfArguments > 2) { + SPLog(@"Filter with more than 2 arguments is not yet supported."); + NSBeep(); + } + } + } + + [argument release]; + [firstBetweenArgument release]; + [secondBetweenArgument release]; + [clause release]; + + // Return the filter string + return filterString; +} + +/** + * Escape argument by looking for used quoting strings in a clause. Attempt to + * be smart - use a single escape for most clauses, doubling up for LIKE clauses. + * Also attempt to not escape what look like common escape sequences - \n, \r, \t. + * + * @param argument The to be used filter argument which should be be escaped + * + * @param clause The entire WHERE filter clause + * + */ ++ (NSString *)escapeFilterArgument:(NSString *)argument againstClause:(NSString *)clause +{ + BOOL clauseIsLike = [clause isMatchedByRegex:@"(?i)\\blike\\b.*?%(?!@)"]; + NSString *recognizedEscapeSequences, *escapeSequence, *regexTerm; + NSMutableString *arg = [argument mutableCopy]; + + // Determine the character set not to escape slashes before, and the escape depth + if (clauseIsLike) { + recognizedEscapeSequences = @"nrt_%"; + escapeSequence = @"\\\\\\\\\\\\\\\\"; + } else { + recognizedEscapeSequences = @"nrt"; + escapeSequence = @"\\\\\\\\"; + } + regexTerm = [NSString stringWithFormat:@"(\\\\)(?![%@])", recognizedEscapeSequences]; + + // Escape slashes appropriately + [arg replaceOccurrencesOfRegex:regexTerm withString:escapeSequence]; + [arg flushCachedRegexData]; + + // Get quote sign for escaping - this should work for 99% of all cases + NSString *quoteSign = [clause stringByMatching:@"([\"'])[^\\1]*?%@[^\\1]*?\\1" capture:1L]; + + // Escape argument + if(quoteSign != nil && [quoteSign length] == 1) { + [arg replaceOccurrencesOfRegex:[NSString stringWithFormat:@"(%@)", quoteSign] withString:@"\\\\$1"]; + [arg flushCachedRegexData]; + } + + return [arg autorelease]; +} + + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 9d5f6ffd..9b319e1e 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -179,6 +179,7 @@ 4DECC48F0EC2B436008D359E /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3320EC2A170008D359E /* Sparkle.framework */; }; 4DECC4910EC2B436008D359E /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3340EC2A170008D359E /* Growl.framework */; }; 501B1D181728A3DA0017C92E /* SPCharsetCollationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */; }; + 503B02CA1AE82C5E0060CAB1 /* SPTableFilterParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */; }; 503CDBB21ACDC204004F8A2F /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503CDBB11ACDC204004F8A2F /* Quartz.framework */; }; 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; @@ -887,6 +888,8 @@ 4DECC3340EC2A170008D359E /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = ""; }; 501B1D161728A3DA0017C92E /* SPCharsetCollationHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCharsetCollationHelper.h; sourceTree = ""; }; 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; + 503B02C81AE82C5E0060CAB1 /* SPTableFilterParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableFilterParser.h; sourceTree = ""; }; + 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFilterParser.m; sourceTree = ""; }; 503CDBB11ACDC204004F8A2F /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableContentFilterController.h; sourceTree = ""; }; 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = ""; }; @@ -2551,6 +2554,8 @@ 1755A25C16B33BEA00B35787 /* SPSyntaxParser.h */, 50D3C3501A77135F00B5429C /* SPParserUtils.c */, 50D3C3511A77135F00B5429C /* SPParserUtils.h */, + 503B02C81AE82C5E0060CAB1 /* SPTableFilterParser.h */, + 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */, ); name = Parsing; sourceTree = ""; @@ -3166,6 +3171,7 @@ BC9F0881100FCF2C00A80D32 /* SPFieldEditorController.m in Sources */, 58D2E229101222670063EF1D /* SPTextAndLinkCell.m in Sources */, BC05F1C5101241DF008A97F8 /* YRKSpinningProgressIndicator.m in Sources */, + 503B02CA1AE82C5E0060CAB1 /* SPTableFilterParser.m in Sources */, 4D90B79A101E0CDF00D116A1 /* SPUserManager.m in Sources */, 4D90B79E101E0CF200D116A1 /* SPUserManager.xcdatamodel in Sources */, 4D90B79F101E0CF200D116A1 /* SPUserMO.m in Sources */, -- cgit v1.2.3 From d828290bdc4229db1beb7e8e2f9df0b8f0a35a72 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 23 Apr 2015 21:34:15 +0200 Subject: Added some basic unit tests for SPTableFilterParser --- Source/SPTableFilterParser.m | 12 ++++---- UnitTests/SPTableFilterParserTest.m | 57 ++++++++++++++++++++++++++++++++++++ sequel-pro.xcodeproj/project.pbxproj | 8 +++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 UnitTests/SPTableFilterParserTest.m diff --git a/Source/SPTableFilterParser.m b/Source/SPTableFilterParser.m index 96ba8368..f7c9ed62 100644 --- a/Source/SPTableFilterParser.m +++ b/Source/SPTableFilterParser.m @@ -50,8 +50,10 @@ { self = [super init]; if (self) { - numberOfArguments = numArgs; - _clause = [filter copy]; + numberOfArguments = numArgs; + _clause = [filter copy]; + caseSensitive = NO; + suppressLeadingTablePlaceholder = NO; } return self; } @@ -73,7 +75,7 @@ NSString *filterString; // argument if Filter requires only one argument - NSMutableString *argument = [[NSMutableString alloc] initWithString:_argument]; + NSMutableString *argument = [[NSMutableString alloc] initWithString:(_argument? _argument : @"")]; // If the filter field is empty and the selected filter does not require // only one argument, then no filtering is required - return nil. @@ -83,8 +85,8 @@ } // arguments if Filter requires two arguments - NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:_firstBetweenArgument]; - NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:_secondBetweenArgument]; + NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:(_firstBetweenArgument? _firstBetweenArgument : @"")]; + NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:(_secondBetweenArgument? _secondBetweenArgument : @"")]; // If filter requires two arguments and either of the argument fields are empty // return nil. diff --git a/UnitTests/SPTableFilterParserTest.m b/UnitTests/SPTableFilterParserTest.m new file mode 100644 index 00000000..d5f46969 --- /dev/null +++ b/UnitTests/SPTableFilterParserTest.m @@ -0,0 +1,57 @@ +// +// SPTableFilterParserTest.m +// sequel-pro +// +// Created by Max Lohrmann on 23.04.15. +// +// + +#import +#import "SPTableFilterParser.h" + +#define USE_APPLICATION_UNIT_TEST 1 + +#import +#import + +@interface SPTableFilterParserTest : SenTestCase + +- (void)testFilterString; + +@end + +@implementation SPTableFilterParserTest + +- (void)testFilterString { + //simple zero argument case + { + SPTableFilterParser *p = [[[SPTableFilterParser alloc] initWithFilterClause:@" constant $BINARY string" numberOfArguments:0] autorelease]; + [p setCurrentField:@"FLD"]; + + // binary matches as "$BINARY ", eating the one additional whitespace + STAssertEqualObjects([p filterString],@"`FLD` constant string", @"Constant replacement"); + } + //simple one argument case with binary + { + SPTableFilterParser *p = [[[SPTableFilterParser alloc] initWithFilterClause:@"= FOO($BINARY ${})" numberOfArguments:1] autorelease]; + [p setCurrentField:@"FLD2"]; + [p setCaseSensitive:YES]; + [p setArgument:@"arg1"]; + + STAssertEqualObjects([p filterString], @"`FLD2` = FOO(BINARY arg1)", @"One Argument, $BINARY variable"); + } + //simple two argument case with explicit current field + { + SPTableFilterParser *p = [[[SPTableFilterParser alloc] initWithFilterClause:@"MIN($CURRENT_FIELD,${}) = ${}" numberOfArguments:2] autorelease]; + [p setCurrentField:@"FLD3"]; + [p setSuppressLeadingTablePlaceholder:YES]; + [p setFirstBetweenArgument:@"LA"]; + [p setSecondBetweenArgument:@"RA"]; + + STAssertEqualObjects([p filterString], @"MIN(`FLD3`,LA) = RA", @"Two Arguments, $CURRENT_FIELD variable"); + } + +} + + +@end diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 9b319e1e..ee3b0018 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -180,6 +180,9 @@ 4DECC4910EC2B436008D359E /* Growl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4DECC3340EC2A170008D359E /* Growl.framework */; }; 501B1D181728A3DA0017C92E /* SPCharsetCollationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */; }; 503B02CA1AE82C5E0060CAB1 /* SPTableFilterParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */; }; + 503B02CF1AE95C2C0060CAB1 /* SPTableFilterParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 503B02CE1AE95C2C0060CAB1 /* SPTableFilterParserTest.m */; }; + 503B02D11AE95DD40060CAB1 /* SPTableFilterParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */; }; + 503B02D21AE95E010060CAB1 /* SPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 173284E91088FEDE0062E892 /* SPConstants.m */; }; 503CDBB21ACDC204004F8A2F /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503CDBB11ACDC204004F8A2F /* Quartz.framework */; }; 506CE9311A311C6C0039F736 /* SPTableContentFilterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */; }; 50A9F8B119EAD4B90053E571 /* SPGotoDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A9F8B019EAD4B90053E571 /* SPGotoDatabaseController.m */; }; @@ -890,6 +893,7 @@ 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; 503B02C81AE82C5E0060CAB1 /* SPTableFilterParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableFilterParser.h; sourceTree = ""; }; 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFilterParser.m; sourceTree = ""; }; + 503B02CE1AE95C2C0060CAB1 /* SPTableFilterParserTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFilterParserTest.m; sourceTree = ""; }; 503CDBB11ACDC204004F8A2F /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; 506CE92F1A311C6C0039F736 /* SPTableContentFilterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableContentFilterController.h; sourceTree = ""; }; 506CE9301A311C6C0039F736 /* SPTableContentFilterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableContentFilterController.m; sourceTree = ""; }; @@ -2363,6 +2367,7 @@ isa = PBXGroup; children = ( 50D3C35B1A771C4C00B5429C /* SPParserUtilsTest.m */, + 503B02CE1AE95C2C0060CAB1 /* SPTableFilterParserTest.m */, ); name = Other; sourceTree = ""; @@ -3045,6 +3050,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 503B02D21AE95E010060CAB1 /* SPConstants.m in Sources */, + 503B02D11AE95DD40060CAB1 /* SPTableFilterParser.m in Sources */, + 503B02CF1AE95C2C0060CAB1 /* SPTableFilterParserTest.m in Sources */, 50EA92681AB23EFC008D3C4F /* SPTableCopy.m in Sources */, 50EA926A1AB246B8008D3C4F /* SPDatabaseActionTest.m in Sources */, 50EA92651AB23EC8008D3C4F /* SPDatabaseAction.m in Sources */, -- cgit v1.2.3 From ace145be795f25dfa42080e459a63cc0c885a9fa Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 28 Apr 2015 20:53:26 +0200 Subject: Choosing a custom SSH binary via file picker no longer resolves softlinks --- Source/SPNetworkPreferencePane.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/SPNetworkPreferencePane.m b/Source/SPNetworkPreferencePane.m index 4f13c433..c734f07b 100644 --- a/Source/SPNetworkPreferencePane.m +++ b/Source/SPNetworkPreferencePane.m @@ -119,6 +119,7 @@ static NSString *SPSSLCipherPboardTypeName = @"SSLCipherPboardType"; [_currentFilePanel setCanChooseDirectories:NO]; [_currentFilePanel setAllowsMultipleSelection:NO]; [_currentFilePanel setAccessoryView:hiddenFileView]; + [_currentFilePanel setResolvesAliases:NO]; [self updateHiddenFiles]; [prefs addObserver:self -- cgit v1.2.3 From 80a2088f43bd3a901fb20d714318d4b5d3dc60a9 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 1 May 2015 02:08:48 +0200 Subject: Significantly reduce risk of a race condition in a certain setup (see #2107) * Replaced a run loop sleep with a thread sleep as it was on a background thread where a) a regular sleep is fine, b) the run loop sleep did not seem to have any effect * While we are at it, cut done some duplicate code * Removed a redundant if() --- Source/SPConnectionHandler.m | 10 +++++--- Source/SPSSHTunnel.m | 56 +++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index 80e9c3f5..c216142f 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -174,8 +174,12 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; if (![mySQLConnection isConnected]) { if (sshTunnel && !cancellingConnection) { - // If an SSH tunnel is running, temporarily block to allow the tunnel to register changes in state - [[NSRunLoop currentRunLoop] runMode:NSModalPanelRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.2]]; + // This is a race condition we cannot fix "properly": + // For meaningful error handling we need to also consider the debug output from the SSH connection. + // The SSH debug output might be sligthly delayed though (flush, delegates, ...) or + // there might not even by any output at all (when it is purely a libmysql issue). + // TL;DR: No guaranteed events we could wait for, just trying our luck. + [NSThread sleepForTimeInterval:0.1]; // 100ms // If the state is connection refused, attempt the MySQL connection again with the host using the hostfield value. if ([sshTunnel state] == SPMySQLProxyForwardingFailed) { @@ -184,7 +188,7 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; [mySQLConnection connect]; if (![mySQLConnection isConnected]) { - [[NSRunLoop currentRunLoop] runMode:NSModalPanelRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.2]]; + [NSThread sleepForTimeInterval:0.1]; //100ms } } } diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 8e9ffb13..d2c999c4 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -40,6 +40,8 @@ #import #import +static unsigned short getRandomPort(); + @implementation SPSSHTunnel @synthesize passwordPromptCancelled; @@ -264,36 +266,10 @@ // If no local port has yet been chosen, choose one if (!localPort) { - int tempSocket; - struct sockaddr_in tempSocketAddress; - size_t addressLength = sizeof(tempSocketAddress); - if((tempSocket = socket(AF_INET, SOCK_STREAM, 0)) > 0) { - memset(&tempSocketAddress, 0, sizeof(tempSocketAddress)); - tempSocketAddress.sin_family = AF_INET; - tempSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY); - tempSocketAddress.sin_port = 0; - if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, (socklen_t)addressLength) >= 0) { - if (getsockname(tempSocket, (struct sockaddr *)&tempSocketAddress, (uint32_t *)&addressLength) >= 0) { - localPort = ntohs(tempSocketAddress.sin_port); - } - } - close(tempSocket); - } + localPort = getRandomPort(); if (useHostFallback) { - if((tempSocket = socket(AF_INET, SOCK_STREAM, 0)) > 0) { - memset(&tempSocketAddress, 0, sizeof(tempSocketAddress)); - tempSocketAddress.sin_family = AF_INET; - tempSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY); - tempSocketAddress.sin_port = 0; - if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, (socklen_t)addressLength) >= 0) { - if (getsockname(tempSocket, (struct sockaddr *)&tempSocketAddress, (uint32_t *)&addressLength) >= 0) { - localPortFallback = ntohs(tempSocketAddress.sin_port); - } - } - close(tempSocket); - } - + localPortFallback = getRandomPort(); } // Abort if no local free port could be allocated @@ -748,7 +724,7 @@ { delegate = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; - if (connectionState != SPMySQLProxyIdle) [self disconnect]; + [self disconnect]; [NSObject cancelPreviousPerformRequestsWithTarget:self]; SPClear(sshHost); SPClear(sshLogin); @@ -775,3 +751,25 @@ } @end + +#pragma mark - + +unsigned short getRandomPort() { + int port = 0; + int tempSocket; + struct sockaddr_in tempSocketAddress; + size_t addressLength = sizeof(tempSocketAddress); + if((tempSocket = socket(AF_INET, SOCK_STREAM, 0)) > 0) { + memset(&tempSocketAddress, 0, sizeof(tempSocketAddress)); + tempSocketAddress.sin_family = AF_INET; + tempSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY); + tempSocketAddress.sin_port = 0; + if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, (socklen_t)addressLength) >= 0) { + if (getsockname(tempSocket, (struct sockaddr *)&tempSocketAddress, (uint32_t *)&addressLength) >= 0) { + port = ntohs(tempSocketAddress.sin_port); + } + } + close(tempSocket); + } + return port; +} -- cgit v1.2.3 From 7b579c9ddc7c161cfd4ed99e07bf83ccd72a83ee Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 2 May 2015 00:47:50 +0200 Subject: Fix a typo that caused build failures with older Xcode versions --- Source/SPTableFilterParser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SPTableFilterParser.h b/Source/SPTableFilterParser.h index 069c802c..828b4b4a 100644 --- a/Source/SPTableFilterParser.h +++ b/Source/SPTableFilterParser.h @@ -38,7 +38,7 @@ NSString *_currentField; NSString *_argument; NSString *_firstBetweenArgument; - NSString *_secondsBetweenArgument; + NSString *_secondBetweenArgument; BOOL caseSensitive; BOOL suppressLeadingTablePlaceholder; -- cgit v1.2.3 From 4d82718f43d92f2ef2193dc603a4486f85fb1582 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 7 May 2015 16:30:51 +0200 Subject: * Copying text from the query console without having a database selected could cause an exception (fixes #2111) * Text copied from the query console could have an invalid format in some setups --- Source/SPQueryController.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 4aba3a14..c57621d8 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -171,20 +171,23 @@ static SPQueryController *sharedQueryController = nil; if (i < [messagesVisibleSet count]) { SPConsoleMessage *message = NSArrayObjectAtIndex(messagesVisibleSet, i); - if (includeTimestamps || includeConnections) [string appendString:@"/* "]; + if (includeTimestamps || includeConnections || includeDatabases) [string appendString:@"/* "]; - if (includeTimestamps) { - [string appendString:[dateFormatter stringFromDate:[message messageDate]]]; + NSDate *date = [message messageDate]; + if (includeTimestamps && date) { + [string appendString:[dateFormatter stringFromDate:date]]; [string appendString:@" "]; } - if (includeConnections) { - [string appendString:[message messageConnection]]; + NSString *connection = [message messageConnection]; + if (includeConnections && connection) { + [string appendString:connection]; [string appendString:@" "]; } - if (includeDatabases) { - [string appendString:[message messageDatabase]]; + NSString *database = [message messageDatabase]; + if (includeDatabases && database) { + [string appendString:database]; [string appendString:@" "]; } -- cgit v1.2.3 From 7dbcadc2c0523dc3c3bcc0a8cd7ceea9f44fc655 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 9 May 2015 23:27:05 +0200 Subject: Fix a possible crash caused by a use-after-free in some rare cases when closing a connection tab. --- Source/NoodleLineNumberView.m | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m index 24b76be1..8b678434 100644 --- a/Source/NoodleLineNumberView.m +++ b/Source/NoodleLineNumberView.m @@ -59,6 +59,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range); - (void)invalidateLineIndices; - (void)calculateLines; - (void)updateGutterThicknessConstants; +- (void)setRuleThicknessNumber:(NSNumber *)aNum; @end @@ -112,6 +113,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range); - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [NSObject cancelPreviousPerformRequestsWithTarget:self]; if (lineIndices) [lineIndices release]; if (textAttributes) [textAttributes release]; @@ -566,17 +568,23 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range); currentRuleThickness = newThickness; // Not a good idea to resize the view during calculations (which can happen during - // display). Do a delayed perform (using NSInvocation since arg is a float). - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(setRuleThickness:)]]; - [invocation setSelector:@selector(setRuleThickness:)]; - [invocation setTarget:self]; - [invocation setArgument:&newThickness atIndex:2]; - - [invocation performSelector:@selector(invoke) withObject:nil afterDelay:0.0]; + // display). Do a delayed perform. + [self performSelector:@selector(setRuleThicknessNumber:) withObject:[NSNumber numberWithFloat:newThickness] afterDelay:0.0]; } } } +- (void)setRuleThicknessNumber:(NSNumber *)aNum +{ + // We want to do a delayed perform, but setRuleThickness: does take a CGFloat + // and not an object. In the past we used NSInvocation to work around that, + // however that has one major issue: >>This class does not retain the arguments + // for the contained invocation by default.<< (NSInvocation doc). + // A perform with delay 0.0 is queued with the run loop, so a dealloc can very + // well happen before that! + [self setRuleThickness:[aNum floatValue]]; +} + - (void)updateGutterThicknessConstants { maxWidthOfGlyph1 = ceilf(MAX(DEFAULT_THICKNESS, maxWidthOfGlyph + RULER_MARGIN2)); -- cgit v1.2.3 From 0f11cb74639d17a2fe512ed81d67ccf33601b605 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 10 May 2015 01:24:34 +0200 Subject: * Fix an exception that would occur if a user tried to export favorites when no favorites are selected * Select "Quick Connect" after deleting a favorite --- Source/SPConnectionController.m | 20 +++++++++++++------- Source/SPConnectionControllerDelegate.m | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 7cde1e4e..25049d44 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1039,10 +1039,17 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, */ - (IBAction)exportFavorites:(id)sender { - NSSavePanel *savePanel = [NSSavePanel savePanel]; + // additional empty selection check + if(![[self selectedFavoriteNodes] count]) return; - NSString *fileName = [[self selectedFavoriteNodes] count] > 1 ? SPExportFavoritesFilename : [[[self selectedFavorite] objectForKey:SPFavoriteNameKey] stringByAppendingPathExtension:@"plist"]; + NSSavePanel *savePanel = [NSSavePanel savePanel]; + // suggest the name of the favorite or a default name for multiple selection + NSString *fileName = ([[self selectedFavoriteNodes] count] == 1)? [[[self selectedFavorite] objectForKey:SPFavoriteNameKey] stringByAppendingPathExtension:@"plist"] : nil; + // This if() is so we can also catch nil due to favorite corruption (NSSavePanel will @throw if nil is passed in) + if(!fileName) + fileName = SPExportFavoritesFilename; + [savePanel setAccessoryView:exportPanelAccessoryView]; [savePanel setNameFieldStringValue:fileName]; @@ -1652,7 +1659,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, { [favoritesOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[favoritesOutlineView rowForItem:node]] byExtendingSelection:NO]; [self _scrollToSelectedNode]; - } +} /** * Scroll to the currently selected node. @@ -1663,7 +1670,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if ([favoritesOutlineView selectedRow] == -1) return; [favoritesOutlineView scrollRowToVisible:[favoritesOutlineView selectedRow]]; - } +} /** * Removes the supplied tree node. @@ -1678,9 +1685,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self _reloadFavoritesViewData]; - // Clear the selection and update the interface to match - [favoritesOutlineView selectRowIndexes:nil byExtendingSelection:NO]; - [self updateFavoriteSelection:self]; + // Select Quick Connect item to prevent empty selection + [self _selectNode:quickConnectItem]; [connectionResizeContainer setHidden:NO]; [connectionInstructionsTextField setStringValue:NSLocalizedString(@"Enter connection details below, or choose a favorite", @"enter connection details label")]; diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index f0813292..f2a57e53 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -656,7 +656,7 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; // Favorites export if (action == @selector(exportFavorites:)) { - if ([[favoritesRoot allChildLeafs] count] == 0) { + if ([[favoritesRoot allChildLeafs] count] == 0 || selectedRows == 0) { return NO; } else if (selectedRows == 1) { -- cgit v1.2.3 From 11b8718ddfd44dc5786ac745f90fa390aaf57a06 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 11 May 2015 02:04:06 +0200 Subject: * Fully enable export of favorite groups * Favorites can now be imported, sorted even if "Quick Connect" is selected * Favorite files containing groups will now be imported correctly * If a favorite and the group containing said favorite are exported, the favorite will no longer be included twice --- Source/SPConnectionController.m | 5 +++-- Source/SPConnectionControllerDelegate.m | 12 +++++----- Source/SPFavoriteNode.h | 3 ++- Source/SPFavoriteNode.m | 8 ++++++- Source/SPFavoritesController.m | 40 ++++++++++++++++++++++++++++----- Source/SPFavoritesExporter.m | 5 ++++- Source/SPGroupNode.h | 5 ++++- Source/SPGroupNode.m | 15 +++++++++++++ Source/SPNamedNode.h | 37 ++++++++++++++++++++++++++++++ Source/SPTreeNode.h | 1 + Source/SPTreeNode.m | 36 ++++++++++++++++++++++++++--- sequel-pro.xcodeproj/project.pbxproj | 2 ++ 12 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 Source/SPNamedNode.h diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 25049d44..d7fce6fb 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -51,6 +51,7 @@ #import "SPFavoritesImporter.h" #import "SPThreadAdditions.h" #import "SPFavoriteColorSupport.h" +#import "SPNamedNode.h" #import @@ -738,7 +739,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, { SPTreeNode *node = [self selectedFavoriteNode]; - return (![node isGroup]) ? [[node representedObject] nodeFavorite] : nil; + return (![node isGroup]) ? [(SPFavoriteNode *)[node representedObject] nodeFavorite] : nil; } /** @@ -1045,7 +1046,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, NSSavePanel *savePanel = [NSSavePanel savePanel]; // suggest the name of the favorite or a default name for multiple selection - NSString *fileName = ([[self selectedFavoriteNodes] count] == 1)? [[[self selectedFavorite] objectForKey:SPFavoriteNameKey] stringByAppendingPathExtension:@"plist"] : nil; + NSString *fileName = ([[self selectedFavoriteNodes] count] == 1)? [[(id)[[self selectedFavoriteNode] representedObject] nodeName] stringByAppendingPathExtension:@"plist"] : nil; // This if() is so we can also catch nil due to favorite corruption (NSSavePanel will @throw if nil is passed in) if(!fileName) fileName = SPExportFavoritesFilename; diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index f2a57e53..99af9e35 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -617,8 +617,6 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; SPTreeNode *node = [self selectedFavoriteNode]; NSInteger selectedRows = [favoritesOutlineView numberOfSelectedRows]; - - if (node == quickConnectItem) return NO; if ((action == @selector(sortFavorites:)) || (action == @selector(reverseSortFavorites:))) { @@ -634,7 +632,14 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; if (action == @selector(reverseSortFavorites:)) { [menuItem setState:reverseFavoritesSort]; } + + return YES; } + + // import does not depend on a selection + if(action == @selector(importFavorites:)) return YES; + + if (node == quickConnectItem) return NO; // Remove/rename the selected node if (action == @selector(removeNode:) || action == @selector(renameNode:)) { @@ -659,9 +664,6 @@ static NSString *SPQuickConnectImageWhite = @"quick-connect-icon-white.pdf"; if ([[favoritesRoot allChildLeafs] count] == 0 || selectedRows == 0) { return NO; } - else if (selectedRows == 1) { - return (![[self selectedFavoriteNode] isGroup]); - } else if (selectedRows > 1) { [menuItem setTitle:NSLocalizedString(@"Export Selected...", @"export selected favorites menu item")]; } diff --git a/Source/SPFavoriteNode.h b/Source/SPFavoriteNode.h index a26c9a3b..6a132767 100644 --- a/Source/SPFavoriteNode.h +++ b/Source/SPFavoriteNode.h @@ -28,6 +28,7 @@ // // More info at +#import "SPNamedNode.h" /** * @class SPFavoriteNode SPFavoriteNode.h * @@ -35,7 +36,7 @@ * * Tree node the represents a connection favorite. */ -@interface SPFavoriteNode : NSObject +@interface SPFavoriteNode : NSObject { NSMutableDictionary *nodeFavorite; } diff --git a/Source/SPFavoriteNode.m b/Source/SPFavoriteNode.m index b2b99c64..b51980f7 100644 --- a/Source/SPFavoriteNode.m +++ b/Source/SPFavoriteNode.m @@ -81,6 +81,7 @@ static NSString *SPFavoriteNodeKey = @"SPFavoriteNode"; - (id)initWithCoder:(NSCoder *)coder { +#warning This is not a valid initializer. [self setNodeFavorite:[coder decodeObjectForKey:SPFavoriteNodeKey]]; return self; @@ -96,7 +97,12 @@ static NSString *SPFavoriteNodeKey = @"SPFavoriteNode"; - (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p ('%@')>", [self className], self, [[self nodeFavorite] objectForKey:SPFavoriteNameKey]]; + return [NSString stringWithFormat:@"<%@: %p ('%@')>", [self className], self, [self nodeName]]; +} + +- (NSString *)nodeName +{ + return [[self nodeFavorite] objectForKey:SPFavoriteNameKey]; } #pragma mark - diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index ce6e5427..625b46cc 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -45,7 +45,7 @@ static SPFavoritesController *sharedFavoritesController = nil; - (void)_addNode:(SPTreeNode *)node asChildOfNode:(SPTreeNode *)parent; - (SPTreeNode *)_constructBranchForNodeData:(NSDictionary *)nodeData; - +- (SPTreeNode *)_addFavoriteNodeWithData:(NSMutableDictionary *)data asChildOfNode:(SPTreeNode *)parent; @end @implementation SPFavoritesController @@ -164,6 +164,7 @@ static SPFavoritesController *sharedFavoritesController = nil; [self _addNode:node asChildOfNode:parent]; + [self saveFavorites]; [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; return node; @@ -179,11 +180,40 @@ static SPFavoritesController *sharedFavoritesController = nil; */ - (SPTreeNode *)addFavoriteNodeWithData:(NSMutableDictionary *)data asChildOfNode:(SPTreeNode *)parent { - SPTreeNode *node = [SPTreeNode treeNodeWithRepresentedObject:[SPFavoriteNode favoriteNodeWithDictionary:data]]; - + SPTreeNode *node = [self _addFavoriteNodeWithData:data asChildOfNode:parent]; + + [self saveFavorites]; + [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; + + return node; +} + +/** + * Inner recursive variant of the method above + */ +- (SPTreeNode *)_addFavoriteNodeWithData:(NSMutableDictionary *)data asChildOfNode:(SPTreeNode *)parent +{ + id object; + NSArray *childs = nil; + //if it has "Children" it must be a group node, otherwise assume favorite node + if ([data objectForKey:SPFavoriteChildrenKey]) { + object = [SPGroupNode groupNodeWithDictionary:data]; + childs = [data objectForKey:SPFavoriteChildrenKey]; + } + else { + object = [SPFavoriteNode favoriteNodeWithDictionary:data]; + } + + SPTreeNode *node = [SPTreeNode treeNodeWithRepresentedObject:object]; + [self _addNode:node asChildOfNode:parent]; - [[NSNotificationCenter defaultCenter] postNotificationName:SPConnectionFavoritesChangedNotification object:self]; + //also add the children + if(childs) { + for (NSMutableDictionary *childData in childs) { + [self _addFavoriteNodeWithData:childData asChildOfNode:node]; + } + } return node; } @@ -460,8 +490,6 @@ static SPFavoritesController *sharedFavoritesController = nil; else { [[[[favoritesTree mutableChildNodes] objectAtIndex:0] mutableChildNodes] addObject:node]; } - - [self saveFavorites]; } #pragma mark - diff --git a/Source/SPFavoritesExporter.m b/Source/SPFavoritesExporter.m index a8b78a86..d37ce07d 100644 --- a/Source/SPFavoritesExporter.m +++ b/Source/SPFavoritesExporter.m @@ -74,7 +74,10 @@ // Get a dictionary representation of all favorites for (SPTreeNode *node in [self exportFavorites]) { - [favorites addObject:[node dictionaryRepresentation]]; + // The selection could contain a group as well as items in that group. + // So we skip those items, as their group will already export them. + if(![node isDescendantOfNodes:[self exportFavorites]]) + [favorites addObject:[node dictionaryRepresentation]]; } NSDictionary *dictionary = @{SPFavoritesDataRootKey : favorites}; diff --git a/Source/SPGroupNode.h b/Source/SPGroupNode.h index a6583dc1..d12f7465 100644 --- a/Source/SPGroupNode.h +++ b/Source/SPGroupNode.h @@ -28,6 +28,7 @@ // // More info at +#import "SPNamedNode.h" /** * @class SPGroupNode SPGroupNode.h * @@ -35,7 +36,7 @@ * * Tree node that represents a group. */ -@interface SPGroupNode : NSObject +@interface SPGroupNode : NSObject { BOOL nodeIsExpanded; @@ -53,7 +54,9 @@ @property (readwrite, assign) BOOL nodeIsExpanded; - (id)initWithName:(NSString *)name; +- (id)initWithDictionary:(NSDictionary *)dict; + (SPGroupNode *)groupNodeWithName:(NSString *)name; ++ (SPGroupNode *)groupNodeWithDictionary:(NSDictionary *)dict; @end diff --git a/Source/SPGroupNode.m b/Source/SPGroupNode.m index 4d90c0c1..e1a0dfb3 100644 --- a/Source/SPGroupNode.m +++ b/Source/SPGroupNode.m @@ -61,11 +61,25 @@ static NSString *SPGroupNodeIsExpandedKey = @"SPGroupNodeIsExpanded"; return self; } +- (id)initWithDictionary:(NSDictionary *)dict +{ + if ((self = [self initWithName:[dict objectForKey:SPFavoritesGroupNameKey]])) { + [self setNodeIsExpanded:[(NSNumber *)[dict objectForKey:SPFavoritesGroupIsExpandedKey] boolValue]]; + } + + return self; +} + + (SPGroupNode *)groupNodeWithName:(NSString *)name { return [[[self alloc] initWithName:name] autorelease]; } ++ (SPGroupNode *)groupNodeWithDictionary:(NSDictionary *)dict +{ + return [[[self alloc] initWithDictionary:dict] autorelease]; +} + #pragma mark - #pragma mark Copying protocol methods @@ -84,6 +98,7 @@ static NSString *SPGroupNodeIsExpandedKey = @"SPGroupNodeIsExpanded"; - (id)initWithCoder:(NSCoder *)coder { +#warning This is not a valid initializer. [self setNodeName:[coder decodeObjectForKey:SPGroupNodeNameKey]]; [self setNodeIsExpanded:[[coder decodeObjectForKey:SPGroupNodeIsExpandedKey] boolValue]]; diff --git a/Source/SPNamedNode.h b/Source/SPNamedNode.h new file mode 100644 index 00000000..2ce99fdf --- /dev/null +++ b/Source/SPNamedNode.h @@ -0,0 +1,37 @@ +// +// SPNamedNode.h +// sequel-pro +// +// Created by Max Lohrmann on 11.05.15. +// Copyright (c) 2015 Max Lohrmann. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +#import + +@protocol SPNamedNode + +- (NSString *)nodeName; + +@end diff --git a/Source/SPTreeNode.h b/Source/SPTreeNode.h index abbb179c..aa2edbdc 100644 --- a/Source/SPTreeNode.h +++ b/Source/SPTreeNode.h @@ -55,6 +55,7 @@ - (SPTreeNode *)parentFromArray:(NSArray *)array; - (BOOL)isDescendantOfOrOneOfNodes:(NSArray *)nodes; +- (BOOL)isDescendantOfNodes:(NSArray *)nodes; - (NSDictionary *)dictionaryRepresentation; diff --git a/Source/SPTreeNode.m b/Source/SPTreeNode.m index 13c86f27..22cfb1da 100644 --- a/Source/SPTreeNode.m +++ b/Source/SPTreeNode.m @@ -50,7 +50,7 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; - (id)initWithRepresentedObject:(id)object { if ((self = [super initWithRepresentedObject:object])) { - [self setIsGroup:NO]; + [self setIsGroup:[object isKindOfClass:[SPGroupNode class]]]; } return self; @@ -197,11 +197,12 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; /** * Returns YES if self is contained anywhere inside the children or children of - * sub-nodes of the nodes contained inside the supplied array. + * sub-nodes of the nodes contained inside the supplied array or is itself a + * member of the array. * * @param nodes The array of nodes to search * - * @return A BOOL indicating whether or not it's a descendent + * @return A BOOL indicating whether or not it's a descendent or array member */ - (BOOL)isDescendantOfOrOneOfNodes:(NSArray *)nodes { @@ -220,6 +221,34 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; return NO; } +/** + * Returns YES if self is contained anywhere inside the children or children of + * sub-nodes of the nodes contained inside the supplied array, but NOT the given + * array itself. + * This means, if self is a member of nodes but not a child of any + * other node in nodes it will still return NO. + * + * @param nodes The array of nodes to search + * + * @return A BOOL indicating whether or not it's a descendent + */ +- (BOOL)isDescendantOfNodes:(NSArray *)nodes +{ + for (SPTreeNode *node in nodes) + { + if (node == self) continue; + + // Check all the sub-nodes + if ([node isGroup]) { + if ([self isDescendantOfOrOneOfNodes:[node childNodes]]) { + return YES; + } + } + } + + return NO; +} + /** * Constructs a dictionary representation of the favorite. * @@ -265,6 +294,7 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; - (id)initWithCoder:(NSCoder *)coder { +#warning This is not a valid initializer. [self setIsGroup:[[coder decodeObjectForKey:SPTreeNodeIsGroupKey] boolValue]]; return self; diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index ee3b0018..af6723bf 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -891,6 +891,7 @@ 4DECC3340EC2A170008D359E /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = Frameworks/Growl.framework; sourceTree = ""; }; 501B1D161728A3DA0017C92E /* SPCharsetCollationHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCharsetCollationHelper.h; sourceTree = ""; }; 501B1D171728A3DA0017C92E /* SPCharsetCollationHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPCharsetCollationHelper.m; sourceTree = ""; }; + 5037F79A1B00148000733564 /* SPNamedNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPNamedNode.h; sourceTree = ""; }; 503B02C81AE82C5E0060CAB1 /* SPTableFilterParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableFilterParser.h; sourceTree = ""; }; 503B02C91AE82C5E0060CAB1 /* SPTableFilterParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFilterParser.m; sourceTree = ""; }; 503B02CE1AE95C2C0060CAB1 /* SPTableFilterParserTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFilterParserTest.m; sourceTree = ""; }; @@ -1756,6 +1757,7 @@ 1798F1941550181B004B0AB8 /* SPGroupNode.m */, 17D3C22012859E070047709F /* SPFavoriteNode.h */, 17D3C22112859E070047709F /* SPFavoriteNode.m */, + 5037F79A1B00148000733564 /* SPNamedNode.h */, ); name = "Tree Nodes"; sourceTree = ""; -- cgit v1.2.3 From 6bbc6a50e215b16863498bc7a1f5e2fa9195fcc6 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 12 May 2015 10:16:09 +0200 Subject: Fix some minor UI misalignment --- Interfaces/English.lproj/DBView.xib | 856 +++++++++++++--------------- Resources/English.lproj/DBView.strings | Bin 106116 -> 106324 bytes Resources/English.lproj/Localizable.strings | Bin 250678 -> 250498 bytes 3 files changed, 411 insertions(+), 445 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index ecfca35c..03afa230 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -68,7 +68,7 @@ NSApplication - + 274 @@ -108,7 +108,6 @@ 4362 {218, 38} - YES NO @@ -218,7 +217,6 @@ {{1, 1}, {218, 38}} - 2 @@ -228,7 +226,6 @@ -2147483392 {{-100, -100}, {15, 8}} - NO @@ -239,7 +236,6 @@ -2147483392 {{-100, -100}, {223, 15}} - NO 1 @@ -249,7 +245,6 @@ {{-1, -13}, {220, 40}} - 133122 @@ -265,7 +260,6 @@ 290 {{5, 2}, {204, 19}} - YES YES @@ -327,7 +321,6 @@ {214, 24} - YES @@ -348,7 +341,6 @@ 4352 {214, 334} - YES NO @@ -414,7 +406,6 @@ {214, 334} - @@ -423,7 +414,6 @@ -2147483392 {{197, 0}, {15, 292}} - NO @@ -435,7 +425,6 @@ -2147483392 {{-100, -100}, {141, 11}} - NO 257 @@ -445,7 +434,6 @@ {214, 334} - 133648 @@ -459,21 +447,18 @@ {{0, 25}, {214, 334}} - YES {214, 359} - 2 {214, 359} - YES @@ -494,7 +479,6 @@ 4352 {216, 166} - YES NO @@ -560,7 +544,6 @@ {216, 166} - 2 @@ -570,7 +553,6 @@ -2147483392 {{-100, -100}, {15, 20}} - NO @@ -581,7 +563,6 @@ -2147483392 {{-100, -100}, {141, 11}} - NO 257 @@ -591,7 +572,6 @@ {{-1, 0}, {216, 166}} - 133648 @@ -615,7 +595,6 @@ 4352 {214, 166} - YES NO @@ -681,7 +660,6 @@ {214, 166} - 2 @@ -691,7 +669,6 @@ -2147483392 {{-100, -100}, {15, 20}} - NO @@ -703,7 +680,6 @@ -2147483392 {{-100, -100}, {141, 11}} - NO 257 @@ -713,7 +689,6 @@ {214, 166} - 133632 @@ -727,14 +702,12 @@ {{0, 360}, {214, 166}} - YES {{0, 23}, {214, 526}} - 2 @@ -751,7 +724,6 @@ {214, 23} - YES @@ -782,7 +754,6 @@ {{199, 0}, {15, 23}} - YES @@ -805,7 +776,6 @@ 260 {{-1, -1}, {32, 25}} - YES @@ -832,7 +802,6 @@ 260 {{92, -1}, {32, 25}} - YES @@ -863,7 +832,6 @@ 260 {{29, 0}, {36, 23}} - {250, 250} YES @@ -1102,7 +1070,6 @@ 260 {{61, -1}, {32, 25}} - YES @@ -1127,7 +1094,6 @@ {214, 549} - YES @@ -1138,15 +1104,14 @@ 274 - {{-6, -10}, {740, 564}} + {{-7, -10}, {741, 564}} - - + source - + 274 @@ -1162,7 +1127,6 @@ -2147483356 {{124, -1}, {33, 25}} - YES @@ -1195,9 +1159,8 @@ 4352 - {693, 288} + {694, 288} - YES NO @@ -1205,9 +1168,8 @@ 256 - {693, 17} + {694, 17} - @@ -1216,13 +1178,12 @@ -2147483392 {15, 20} - name - 59 + 60 50 1000 @@ -1780,9 +1741,8 @@ 1 - {{1, 17}, {693, 288}} + {{1, 17}, {694, 288}} - @@ -1794,9 +1754,8 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} - @@ -1805,7 +1764,6 @@ -2147483392 {{674, 17}, {15, 274}} - NO @@ -1817,7 +1775,6 @@ -2147483392 {{1, 289}, {689, 16}} - NO 1 @@ -1826,9 +1783,8 @@ - {{-1, 22}, {695, 306}} + {{-1, 22}, {696, 306}} - 133682 @@ -1846,7 +1802,6 @@ 292 {{-1, -1}, {32, 25}} - YES @@ -1870,7 +1825,6 @@ 292 {{93, -1}, {32, 25}} - YES @@ -1894,7 +1848,6 @@ 292 {{30, -1}, {32, 25}} - YES @@ -1921,7 +1874,6 @@ 292 {{61, -1}, {32, 25}} - YES @@ -1946,9 +1898,8 @@ 289 - {{662, 0}, {36, 23}} + {{663, 0}, {36, 23}} - {250, 250} YES @@ -2066,9 +2017,8 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{125, 0}, {506, 23}} + {{125, 0}, {507, 23}} - YES @@ -2086,9 +2036,8 @@ 289 - {{631, -1}, {32, 25}} + {{632, -1}, {32, 25}} - YES @@ -2111,9 +2060,8 @@ NO - {694, 328} + {695, 328} - YES NSView @@ -2131,7 +2079,6 @@ 268 {{3, 3}, {58, 14}} - YES @@ -2167,9 +2114,8 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{677, 3}, {10, 13}} + {{678, 3}, {10, 13}} - YES @@ -2188,9 +2134,8 @@ YES - {{0, 181}, {694, 20}} + {{0, 181}, {695, 20}} - @@ -2204,9 +2149,8 @@ 4352 - {693, 141} + {694, 141} - YES NO @@ -2214,9 +2158,8 @@ 256 - {693, 17} + {694, 17} - @@ -2225,13 +2168,12 @@ -2147483392 {15, 20} - Non_unique - 79 + 80 40 1000 @@ -2486,9 +2428,8 @@ 1 - {{1, 17}, {693, 141}} + {{1, 17}, {694, 141}} - @@ -2500,9 +2441,8 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} - @@ -2511,7 +2451,6 @@ -2147483392 {{611, 17}, {15, 126}} - NO @@ -2522,7 +2461,6 @@ -2147483392 {{1, 143}, {610, 15}} - NO 1 @@ -2531,9 +2469,8 @@ - {{-1, 22}, {695, 159}} + {{-1, 22}, {696, 159}} - 133682 @@ -2551,7 +2488,6 @@ 292 {{-1, -1}, {32, 25}} - YES @@ -2575,7 +2511,6 @@ 292 {{61, -1}, {32, 25}} - YES @@ -2599,7 +2534,6 @@ 292 {{30, -1}, {32, 25}} - YES @@ -2629,10 +2563,8 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{93, 0}, {601, 23}} + {{93, 0}, {602, 23}} - - YES 0 @@ -2647,24 +2579,20 @@ YES - {{0, 329}, {694, 201}} + {{0, 329}, {695, 201}} - YES NSView - {{7, 10}, {694, 530}} + {{7, 10}, {695, 530}} - 2 - {{10, 7}, {705, 544}} - - + {{10, 7}, {706, 544}} Structure @@ -2682,7 +2610,7 @@ 292 {{6, 9}, {32, 25}} - + YES 603979776 @@ -2780,7 +2708,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{163, 10}, {538, 23}} + {{163, 10}, {539, 23}} YES @@ -2829,7 +2757,7 @@ 290 - {{166, 6}, {420, 22}} + {{166, 6}, {421, 22}} YES @@ -2848,7 +2776,7 @@ 289 - {{653, 9}, {32, 25}} + {{654, 9}, {32, 25}} YES @@ -2874,7 +2802,7 @@ 289 - {{591, 9}, {32, 25}} + {{592, 9}, {32, 25}} YES @@ -2900,7 +2828,7 @@ 289 - {{622, 9}, {32, 25}} + {{623, 9}, {32, 25}} YES @@ -2934,7 +2862,7 @@ 289 - {{614, 1.5}, {54, 19}} + {{615, 2}, {54, 19}} {250, 750} @@ -2970,7 +2898,7 @@ 274 - {606, 25.5} + {607, 27} @@ -2978,9 +2906,9 @@ NSRuleEditorItemPBoardType - {606, 25.5} + {607, 27} - + {250, 250} YES NO @@ -3004,7 +2932,7 @@ - {606, 25.5} + {607, 27} @@ -3035,9 +2963,9 @@ 1 - {{0, -0.5}, {606, 25.5}} + {{0, -1}, {607, 27}} - + 133632 @@ -3047,7 +2975,7 @@ 1 - {695, 24.5} + {696, 25} YES @@ -3068,24 +2996,26 @@ 4352 - {693, 432.5} + {694, 432} - + YES NO YES 256 - {693, 17} + {694, 17} - - - 256 + + + -2147483392 {15, 20} + + @@ -3134,7 +3064,7 @@ 1 - {{1, 17}, {693, 432.5}} + {{1, 17}, {694, 432}} @@ -3147,42 +3077,44 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} - + -2147483392 - {{1, 458}, {429, 15}} + {{680, 17}, {15, 450}} - + NO - 1 _doScroller: - 0.021626397967338562 - + -2147483392 - {{680, 17}, {15, 450}} + {{1, 458}, {429, 15}} - + NO + 1 _doScroller: + 0.021626397967338562 + - {{-1, -1.5}, {695, 450.5}} + {{-1, -2}, {696, 450}} - + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -3199,7 +3131,7 @@ 265 - {{205.5, 0}, {105, 25}} + {{206, 0}, {105, 25}} YES @@ -3244,7 +3176,7 @@ 266 - {{80, 3}, {118.5, 20}} + {{80, 3}, {119, 20}} YES @@ -3306,7 +3238,7 @@ 1 - {313, 27} + {314, 27} YES @@ -3319,7 +3251,7 @@ 266 - {{5, 4}, {276.5, 19}} + {{5, 4}, {276, 19}} YES @@ -3375,7 +3307,7 @@ -2147483379 - {{127.5, 6}, {28, 14}} + {{128, 6}, {28, 14}} YES @@ -3448,7 +3380,7 @@ -2147483381 - {{168.5, 4}, {109.99999995072373, 19}} + {{168, 4}, {110, 19}} YES @@ -3502,14 +3434,14 @@ 1 - {{322, 0}, {283, 27}} + {{323, 0}, {283, 27}} YES NSView - {{-0.5, 452}, {605, 27}} + {{-1, 451}, {606, 27}} YES @@ -3517,7 +3449,7 @@ 265 - {{613, 456}, {54, 19}} + {{614, 455}, {54, 19}} {250, 750} @@ -3541,7 +3473,7 @@ 265 - {{673, 458.5}, {16, 16}} + {{674, 458}, {16, 16}} {750, 750} @@ -3549,22 +3481,22 @@ 100 - {{0, 25.5}, {695, 479.5}} + {{0, 26}, {696, 479}} YES NSView - {{6.5, 33.5}, {695, 505}} + {{6, 33}, {696, 505}} 2 - {{10, 7}, {705, 544}} - + {{10, 7}, {706, 544}} + Content @@ -3587,7 +3519,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{6, 10}, {695, 23}} + {{6, 10}, {696, 23}} YES @@ -3763,9 +3695,9 @@ 6418 - {693, 141} + {694, 141} - + @@ -3781,7 +3713,7 @@ - 693 + 694 1 @@ -3821,7 +3753,7 @@ - {{1, 1}, {693, 141}} + {{1, 1}, {694, 141}} @@ -3855,9 +3787,9 @@ _doScroller: - {{0, 1}, {695, 143}} + {{0, 1}, {696, 143}} - + 133650 @@ -3867,7 +3799,7 @@ 1 - {695, 143} + {696, 143} YES @@ -3880,7 +3812,7 @@ 265 - {{507, 214}, {180, 22}} + {{508, 214}, {180, 22}} YES @@ -3981,16 +3913,16 @@ 4352 - {693, 182} + {694, 197} - + YES NO YES 256 - {693, 17} + {694, 17} @@ -4048,8 +3980,7 @@ 1 - {{1, 17}, {693, 182}} - {{0.5, 0}, {693, 182}} + {{1, 17}, {694, 197}} @@ -4062,7 +3993,7 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} @@ -4080,28 +4011,28 @@ - 256 + -2147483392 {{1, 199}, {693, 15}} - YES NO 1 _doScroller: - 0.5 - 0.99855907780979825 + 1 + 0.99927901946647435 - {{0, -1}, {695, 215}} + {{0, -1}, {696, 215}} - - 133810 + + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -4647,7 +4578,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{26, 214}, {669, 23}} + {{26, 214}, {670, 23}} YES @@ -4664,19 +4595,19 @@ YES - {{0, 152}, {695, 237}} + {{0, 152}, {696, 237}} YES NSView - {695, 389} + {696, 389} - {695, 391} + {696, 391} YES @@ -4715,9 +4646,9 @@ 2322 - {671, 72} + {672, 72} - + @@ -4733,7 +4664,7 @@ - 671 + 672 1 @@ -4760,7 +4691,7 @@ - {671, 72} + {672, 72} @@ -4791,9 +4722,9 @@ _doScroller: - {{12, 12}, {671, 72}} + {{12, 12}, {672, 72}} - + 133648 @@ -4803,13 +4734,13 @@ 1 - {{0, 392}, {695, 117}} + {{0, 392}, {696, 117}} YES - {{6, 33}, {695, 509}} + {{6, 33}, {696, 509}} 2 @@ -4817,8 +4748,9 @@ 290 - {{103, 12}, {581, 17}} + {{103, 12}, {582, 17}} + YES 67108864 @@ -4833,7 +4765,7 @@ 1 - {{10, 7}, {705, 544}} + {{10, 7}, {706, 544}} Custom Query @@ -4865,9 +4797,9 @@ 2322 - {551, 70} + {541, 70} - + @@ -4883,7 +4815,7 @@ - 551 + 541 1 @@ -4910,7 +4842,7 @@ - {{1, 1}, {551, 70}} + {{1, 1}, {541, 70}} @@ -4933,7 +4865,7 @@ 256 - {{538, 1}, {14, 70}} + {{542, 1}, {11, 70}} NO @@ -4942,9 +4874,9 @@ _doScroller: - {{109, 0}, {553, 72}} + {{109, 0}, {554, 72}} - + 133138 @@ -4973,7 +4905,7 @@ 1 - {662, 72} + {663, 72} YES @@ -4994,9 +4926,9 @@ 2322 - {551, 197} + {541, 197} - + @@ -5012,7 +4944,7 @@ - 551 + 541 1 @@ -5039,7 +4971,7 @@ - {{1, 1}, {551, 197}} + {{1, 1}, {541, 197}} @@ -5062,7 +4994,7 @@ 256 - {{538, 1}, {14, 197}} + {{542, 1}, {11, 197}} NO @@ -5071,9 +5003,9 @@ _doScroller: - {{109, 0.5}, {553, 199}} + {{109, 1}, {554, 199}} - + 133138 @@ -5102,14 +5034,14 @@ 1 - {{0, 81}, {662, 199}} + {{0, 81}, {663, 199}} YES NSView - {{12, 30}, {662, 280}} + {{12, 30}, {663, 280}} TableInfoSplitter @@ -5136,7 +5068,7 @@ 266 - {{369, 475}, {304, 14}} + {{369, 475}, {305, 14}} YES @@ -5155,7 +5087,7 @@ 266 - {{369, 500}, {304, 14}} + {{369, 500}, {305, 14}} YES @@ -5312,7 +5244,7 @@ 10 - {{25, 427}, {649, 5}} + {{25, 427}, {650, 5}} {250, 750} @@ -5337,7 +5269,7 @@ 10 - {{24, 316}, {649, 5}} + {{24, 316}, {650, 5}} {250, 750} @@ -5547,7 +5479,7 @@ 266 - {{401, 354}, {272, 14}} + {{401, 354}, {273, 14}} YES @@ -5566,7 +5498,7 @@ 266 - {{401, 332}, {272, 14}} + {{401, 332}, {273, 14}} YES @@ -5847,7 +5779,7 @@ 1 - {{10, 7}, {705, 544}} + {{10, 7}, {706, 544}} Status @@ -5871,29 +5803,31 @@ 4352 - {693, 454} + {694, 456} - + YES NO YES 256 - {693, 17} + {694, 17} - - - 256 + + + -2147483392 {15, 20} + + name - 125 + 126 8 1000 @@ -6100,7 +6034,7 @@ 1 - {{1, 17}, {693, 454}} + {{1, 17}, {694, 456}} @@ -6113,41 +6047,43 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} - + -2147483392 - {{1, 470}, {688, 15}} + {{674, 17}, {15, 453}} - + NO - 1 _doScroller: - + -2147483392 - {{674, 17}, {15, 453}} + {{1, 470}, {688, 15}} - + NO + 1 _doScroller: + - {{6, 33}, {695, 472}} + {{6, 32}, {696, 474}} - + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -6156,7 +6092,7 @@ 292 - {{6, 10}, {32, 25}} + {{6, 9}, {32, 25}} YES @@ -6179,7 +6115,7 @@ 292 - {{68, 10}, {32, 25}} + {{68, 9}, {32, 25}} YES @@ -6202,7 +6138,7 @@ 292 - {{37, 10}, {32, 25}} + {{37, 9}, {32, 25}} YES @@ -6233,7 +6169,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{100, 11}, {601, 23}} + {{100, 10}, {602, 23}} YES @@ -6252,7 +6188,7 @@ 266 - {{14, 515}, {686, 14}} + {{14, 515}, {687, 14}} YES @@ -6269,7 +6205,7 @@ 1 - {{10, 7}, {705, 544}} + {{10, 7}, {706, 544}} Relations @@ -6279,7 +6215,7 @@ triggers - + 274 @@ -6293,16 +6229,16 @@ 4352 - {693, 454} + {694, 456} - + YES NO YES 256 - {693, 17} + {694, 17} @@ -6312,6 +6248,7 @@ -2147483392 {15, 20} + @@ -6520,7 +6457,7 @@ 1 - {{1, 17}, {693, 454}} + {{1, 17}, {694, 456}} @@ -6533,7 +6470,7 @@ - {{1, 0}, {693, 17}} + {{1, 0}, {694, 17}} @@ -6547,6 +6484,7 @@ NO _doScroller: + 0.96696035242290745 @@ -6561,14 +6499,15 @@ - {{6, 33}, {695, 472}} + {{6, 32}, {696, 474}} - + 133682 + QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -6577,7 +6516,7 @@ 292 - {{6, 10}, {32, 25}} + {{6, 9}, {32, 25}} YES @@ -6600,7 +6539,7 @@ 292 - {{68, 10}, {32, 25}} + {{68, 9}, {32, 25}} YES @@ -6623,7 +6562,7 @@ 292 - {{37, 10}, {32, 25}} + {{37, 9}, {32, 25}} YES @@ -6654,9 +6593,8 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{100, 11}, {601, 23}} + {{100, 10}, {602, 23}} - YES 0 @@ -6673,7 +6611,7 @@ 266 - {{14, 515}, {686, 14}} + {{14, 515}, {687, 14}} YES @@ -6690,7 +6628,8 @@ 1 - {{10, 7}, {705, 544}} + {{10, 7}, {706, 544}} + Triggers @@ -6698,26 +6637,24 @@ - + 134217731 YES YES - + {{215, 0}, {728, 549}} - YES {943, 549} - YES 2 @@ -6725,8 +6662,6 @@ {943, 549} - - NSView @@ -6742,7 +6677,7 @@ {600, 133} {384, 133} - + 256 @@ -6750,7 +6685,8 @@ 268 {{5, 96}, {134, 14}} - + + YES 68157504 @@ -6769,6 +6705,7 @@ 268 {{5, 71}, {134, 14}} + YES @@ -6788,6 +6725,7 @@ 268 {{5, 46}, {134, 14}} + YES @@ -6802,36 +6740,13 @@ NO 1 - - - 266 - {{146, 95}, {218, 18}} - - - YES - - -1804599231 - 4326400 - - - - YES - - - 6 - System - textColor - - - - NO - 1 - 289 {{289, 13}, {80, 28}} + + {250, 750} 1 YES @@ -6857,6 +6772,7 @@ 289 {{205, 13}, {86, 28}} + {250, 750} YES @@ -6881,6 +6797,7 @@ 266 {{143, 66}, {224, 22}} + YES @@ -6914,6 +6831,7 @@ 266 {{143, 41}, {224, 22}} + YES @@ -6942,11 +6860,41 @@ NO + + + 268 + {{146, 94}, {218, 19}} + + + + _NS:9 + YES + + -1804599231 + 272761856 + + + _NS:9 + + YES + + + 6 + System + textColor + + + + NO + 1 + {384, 133} + + - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {384, 155} {600, 155} YES @@ -7123,7 +7071,7 @@ {384, 119} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {384, 141} {600, 141} YES @@ -7316,7 +7264,7 @@ {379, 154} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {379, 176} {379, 176} YES @@ -7428,7 +7376,7 @@ {314, 112} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {292, 134} {650, 134} YES @@ -7709,7 +7657,7 @@ - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {384, 164} {600, 184} YES @@ -7726,7 +7674,7 @@ {600, 127} {260, 127} - + 256 @@ -7734,7 +7682,8 @@ 266 {{17, 93}, {226, 14}} - + + YES 67108928 @@ -7748,31 +7697,12 @@ NO 1 - - - 258 - {{20, 67}, {220, 18}} - - - YES - - -1804599231 - 4326400 - - - - YES - - - - NO - 1 - 292 {{19, 43}, {223, 18}} + YES @@ -7797,6 +7727,8 @@ 289 {{148, 13}, {97, 28}} + + {250, 750} 1 YES @@ -7822,6 +7754,7 @@ 289 {{59, 13}, {91, 28}} + {250, 750} YES @@ -7841,11 +7774,36 @@ NO + + + 268 + {{20, 66}, {222, 19}} + + + + _NS:9 + YES + + -1804599231 + 272761856 + + + _NS:9 + + YES + + + + NO + 1 + {260, 127} + + - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {260, 149} {600, 149} YES @@ -8006,7 +7964,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {306, 122} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {213, 129} {10000000000000, 10000000000000} YES @@ -8206,7 +8164,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {303, 95} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {255, 117} {10000000000000, 10000000000000} YES @@ -9008,7 +8966,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {10000000000000, 10000000000000} YES @@ -9416,7 +9374,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {360, 348} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {360, 370} {10000000000000, 10000000000000} YES @@ -9549,7 +9507,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {379, 139} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {213, 72} {10000000000000, 10000000000000} YES @@ -9696,7 +9654,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {381, 247} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {213, 129} {10000000000000, 10000000000000} YES @@ -9932,7 +9890,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {411, 341} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {350, 222} {10000000000000, 10000000000000} SPCreateSyntaxSheet @@ -9949,33 +9907,15 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {213, 107} - + 256 - - - 264 - {{20, 233}, {140, 14}} - - - YES - - 67108864 - 4194304 - There have been errors! - - - - - - NO - 1 - 257 {{314, 13}, {76, 28}} + {250, 750} YES @@ -10000,6 +9940,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 257 {{350, -130}, {80, 28}} + + {250, 750} YES @@ -10029,9 +9971,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 2322 - {352, 178} + {352, 175} - + + @@ -10074,8 +10017,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - {{1, 1}, {352, 178}} + {{1, 1}, {352, 175}} + @@ -10087,6 +10031,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 -2147483392 {{-100, -100}, {87, 11}} + NO 257 @@ -10097,18 +10042,20 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 256 - {{353, 1}, {11, 178}} + {{353, 1}, {11, 175}} - + + NO 256 _doScroller: - {{20, 45}, {365, 180}} + {{20, 45}, {365, 177}} - + + 133138 @@ -10117,11 +10064,36 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 4 1 + + + 266 + {{18, 230}, {369, 17}} + + + + _NS:526 + {251, 750} + YES + + 68157504 + 272630784 + There have been errors! + + _NS:526 + + + + + NO + 1 + {405, 267} - + + + - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {213, 129} {10000000000000, 10000000000000} YES @@ -10538,7 +10510,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {505, 308} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {351, 136} {10000000000000, 10000000000000} MYSQL_HELP_WINDOW @@ -11067,7 +11039,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {752, 317} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {600, 339} {10000000000000, 10000000000000} SPTableFilterPanel @@ -11260,7 +11232,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {251, 102} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {251, 124} {251, 124} YES @@ -11396,7 +11368,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {260, 127} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {260, 149} {600, 149} YES @@ -11527,7 +11499,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {338, 150} - {{0, 0}, {1440, 878}} + {{0, 0}, {1920, 1178}} {10000000000000, 10000000000000} YES @@ -12673,7 +12645,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA _NS:9 - + NSView @@ -12815,14 +12787,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 4778 - - - databaseNameField - - - - 7029 - databaseRenameNameField @@ -13319,6 +13283,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 6898 + + + databaseNameField + + + + LR5-fT-2qb + addDatabase: @@ -14087,14 +14059,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 5427 - - - copyTableNameField - - - - 519 - copyTableSheet @@ -14503,6 +14467,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA uJ9-sX-zir + + + copyTableNameField + + + + i9F-Er-ve6 + toggleColumnView: @@ -15751,37 +15723,13 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 8203 - - - delegate - - - - 5706 - - - - delegate - - - - 4781 - - - - nextKeyView - - - - 7021 - nextKeyView - + - 7024 + L78-2b-cKV @@ -17677,6 +17625,22 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA RW4-XM-XQS + + + delegate + + + + m0B-z4-t6u + + + + nextKeyView + + + + Apc-YB-OnC + delegate @@ -17685,6 +17649,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 28j-fv-HkI + + + delegate + + + + FTJ-Fb-vbI + @@ -20307,11 +20279,11 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - + @@ -20354,19 +20326,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - - 580 - - - - - - - - 3836 - - - 581 @@ -20945,10 +20904,10 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - + @@ -20965,19 +20924,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - - 513 - - - - - - - - 3831 - - - 514 @@ -22088,26 +22034,13 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 960 - + - - 961 - - - - - - - - 3867 - - - 964 @@ -24267,6 +24200,45 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA + + zPq-c4-GfK + + + + + + + + n3P-gU-pX8 + + + + + n5n-Ef-ROd + + + + + + + + SPm-RJ-YgI + + + + + 0kM-iB-j0E + + + + + + + + j3N-dd-SyM + + + @@ -24277,6 +24249,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -24457,8 +24430,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -24467,16 +24438,12 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 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 @@ -24631,6 +24598,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -24644,9 +24612,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin @@ -24997,6 +24962,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -25257,9 +25223,6 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin @@ -27036,12 +26999,10 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin @@ -27056,6 +27017,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -27071,11 +27033,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 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 @@ -27084,6 +27049,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin diff --git a/Resources/English.lproj/DBView.strings b/Resources/English.lproj/DBView.strings index c70f501e..3d5ad7b9 100644 Binary files a/Resources/English.lproj/DBView.strings and b/Resources/English.lproj/DBView.strings differ diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings index 8454df44..a571d298 100644 Binary files a/Resources/English.lproj/Localizable.strings and b/Resources/English.lproj/Localizable.strings differ -- cgit v1.2.3 From 6afd5253d3162c67012fcf835183a5de0f19b05c Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 13 May 2015 00:23:04 +0200 Subject: Remove keyboard shortcut from the database dropdown (cmd+shift+D) and give it to "Go to Database..." instead --- Interfaces/English.lproj/DBView.xib | 172 ++++++--- Interfaces/English.lproj/MainMenu.xib | 700 +++++++++++++++++++++++++++++++++- 2 files changed, 812 insertions(+), 60 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 03afa230..524e0482 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -68,7 +68,7 @@ NSApplication - + 274 @@ -108,7 +108,8 @@ 4362 {218, 38} - + + YES NO YES @@ -217,6 +218,7 @@ {{1, 1}, {218, 38}} + 2 @@ -226,6 +228,7 @@ -2147483392 {{-100, -100}, {15, 8}} + NO @@ -236,6 +239,7 @@ -2147483392 {{-100, -100}, {223, 15}} + NO 1 @@ -245,7 +249,8 @@ {{-1, -13}, {220, 40}} - + + 133122 @@ -260,6 +265,7 @@ 290 {{5, 2}, {204, 19}} + YES YES @@ -321,6 +327,7 @@ {214, 24} + YES @@ -341,7 +348,8 @@ 4352 {214, 334} - + + YES NO YES @@ -406,6 +414,7 @@ {214, 334} + @@ -414,6 +423,7 @@ -2147483392 {{197, 0}, {15, 292}} + NO @@ -425,6 +435,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -434,7 +445,8 @@ {214, 334} - + + 133648 @@ -447,18 +459,21 @@ {{0, 25}, {214, 334}} + YES {214, 359} + 2 {214, 359} + YES @@ -479,7 +494,8 @@ 4352 {216, 166} - + + YES NO YES @@ -544,6 +560,7 @@ {216, 166} + 2 @@ -553,6 +570,7 @@ -2147483392 {{-100, -100}, {15, 20}} + NO @@ -563,6 +581,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -572,7 +591,8 @@ {{-1, 0}, {216, 166}} - + + 133648 @@ -595,7 +615,8 @@ 4352 {214, 166} - + + YES NO YES @@ -660,6 +681,7 @@ {214, 166} + 2 @@ -669,6 +691,7 @@ -2147483392 {{-100, -100}, {15, 20}} + NO @@ -680,6 +703,7 @@ -2147483392 {{-100, -100}, {141, 11}} + NO 257 @@ -689,7 +713,8 @@ {214, 166} - + + 133632 @@ -702,12 +727,14 @@ {{0, 360}, {214, 166}} + YES {{0, 23}, {214, 526}} + 2 @@ -724,6 +751,7 @@ {214, 23} + YES @@ -754,6 +782,7 @@ {{199, 0}, {15, 23}} + YES @@ -776,6 +805,7 @@ 260 {{-1, -1}, {32, 25}} + YES @@ -802,6 +832,7 @@ 260 {{92, -1}, {32, 25}} + YES @@ -832,6 +863,7 @@ 260 {{29, 0}, {36, 23}} + {250, 250} YES @@ -1070,6 +1102,7 @@ 260 {{61, -1}, {32, 25}} + YES @@ -1094,6 +1127,7 @@ {214, 549} + YES @@ -1106,12 +1140,13 @@ 274 {{-7, -10}, {741, 564}} - + + source - + 274 @@ -1127,6 +1162,7 @@ -2147483356 {{124, -1}, {33, 25}} + YES @@ -1161,6 +1197,7 @@ 4352 {694, 288} + YES NO @@ -1170,6 +1207,7 @@ 256 {694, 17} + @@ -1178,6 +1216,7 @@ -2147483392 {15, 20} + @@ -1743,6 +1782,7 @@ {{1, 17}, {694, 288}} + @@ -1756,6 +1796,7 @@ {{1, 0}, {694, 17}} + @@ -1764,6 +1805,7 @@ -2147483392 {{674, 17}, {15, 274}} + NO @@ -1775,6 +1817,7 @@ -2147483392 {{1, 289}, {689, 16}} + NO 1 @@ -1785,6 +1828,7 @@ {{-1, 22}, {696, 306}} + 133682 @@ -1802,6 +1846,7 @@ 292 {{-1, -1}, {32, 25}} + YES @@ -1825,6 +1870,7 @@ 292 {{93, -1}, {32, 25}} + YES @@ -1848,6 +1894,7 @@ 292 {{30, -1}, {32, 25}} + YES @@ -1874,6 +1921,7 @@ 292 {{61, -1}, {32, 25}} + YES @@ -1900,6 +1948,7 @@ 289 {{663, 0}, {36, 23}} + {250, 250} YES @@ -2019,6 +2068,7 @@ {{125, 0}, {507, 23}} + YES @@ -2038,6 +2088,7 @@ 289 {{632, -1}, {32, 25}} + YES @@ -2062,6 +2113,7 @@ {695, 328} + YES NSView @@ -2079,6 +2131,7 @@ 268 {{3, 3}, {58, 14}} + YES @@ -2116,6 +2169,7 @@ {{678, 3}, {10, 13}} + YES @@ -2136,6 +2190,7 @@ {{0, 181}, {695, 20}} + @@ -2151,6 +2206,7 @@ 4352 {694, 141} + YES NO @@ -2160,6 +2216,7 @@ 256 {694, 17} + @@ -2168,6 +2225,7 @@ -2147483392 {15, 20} + @@ -2430,6 +2488,7 @@ {{1, 17}, {694, 141}} + @@ -2443,6 +2502,7 @@ {{1, 0}, {694, 17}} + @@ -2451,6 +2511,7 @@ -2147483392 {{611, 17}, {15, 126}} + NO @@ -2461,6 +2522,7 @@ -2147483392 {{1, 143}, {610, 15}} + NO 1 @@ -2471,6 +2533,7 @@ {{-1, 22}, {696, 159}} + 133682 @@ -2488,6 +2551,7 @@ 292 {{-1, -1}, {32, 25}} + YES @@ -2511,6 +2575,7 @@ 292 {{61, -1}, {32, 25}} + YES @@ -2534,6 +2599,7 @@ 292 {{30, -1}, {32, 25}} + YES @@ -2565,6 +2631,8 @@ {{93, 0}, {602, 23}} + + YES 0 @@ -2581,6 +2649,7 @@ {{0, 329}, {695, 201}} + YES NSView @@ -2588,11 +2657,14 @@ {{7, 10}, {695, 530}} + 2 {{10, 7}, {706, 544}} + + Structure @@ -2908,7 +2980,7 @@ {607, 27} - + {250, 250} YES NO @@ -2965,7 +3037,7 @@ {{0, -1}, {607, 27}} - + 133632 @@ -2998,7 +3070,7 @@ 4352 {694, 432} - + YES NO YES @@ -3108,13 +3180,12 @@ {{-1, -2}, {696, 450}} - + 133682 - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -3697,7 +3768,7 @@ 6418 {694, 141} - + @@ -3759,7 +3830,7 @@ - {5, 5} + {1, -1} 0 4 @@ -3789,7 +3860,7 @@ {{0, 1}, {696, 143}} - + 133650 @@ -3915,7 +3986,7 @@ 4352 {694, 197} - + YES NO YES @@ -4026,13 +4097,12 @@ {{0, -1}, {696, 215}} - + 133682 - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -4648,7 +4718,7 @@ 2322 {672, 72} - + @@ -4724,7 +4794,7 @@ {{12, 12}, {672, 72}} - + 133648 @@ -4799,7 +4869,7 @@ 2322 {541, 70} - + @@ -4876,7 +4946,7 @@ {{109, 0}, {554, 72}} - + 133138 @@ -4928,7 +4998,7 @@ 2322 {541, 197} - + @@ -5005,7 +5075,7 @@ {{109, 1}, {554, 199}} - + 133138 @@ -5805,7 +5875,7 @@ 4352 {694, 456} - + YES NO YES @@ -6077,13 +6147,12 @@ {{6, 32}, {696, 474}} - + 133682 - QSAAAEEgAABBkAAAQZAAAA 0.25 4 @@ -6215,7 +6284,7 @@ triggers - + 274 @@ -6231,7 +6300,7 @@ 4352 {694, 456} - + YES NO YES @@ -6253,7 +6322,7 @@ TriggerName - 95 + 94 10 3.4028230607370965e+38 @@ -6334,7 +6403,7 @@ TriggerStatement - 231.7109375 + 230.7109375 10 3.4028230607370965e+38 @@ -6361,7 +6430,7 @@ TriggerDefiner - 71 + 71.5 10 3.4028230607370965e+38 @@ -6388,7 +6457,7 @@ TriggerCreated - 49 + 49.5 10 3.4028234663852886e+38 @@ -6484,7 +6553,7 @@ NO _doScroller: - 0.96696035242290745 + 0.96710526315789469 @@ -6501,7 +6570,7 @@ {{6, 32}, {696, 474}} - + 133682 @@ -6629,7 +6698,6 @@ {{10, 7}, {706, 544}} - Triggers @@ -6637,24 +6705,26 @@ - + 134217731 YES YES - + {{215, 0}, {728, 549}} + YES {943, 549} + YES 2 @@ -6662,6 +6732,8 @@ {943, 549} + + NSView @@ -10045,7 +10117,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{353, 1}, {11, 175}} - + NO 256 @@ -10070,7 +10142,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{18, 230}, {369, 17}} - + _NS:526 {251, 750} YES @@ -10091,7 +10163,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {405, 267} - + {{0, 0}, {1920, 1178}} {213, 129} @@ -11504,7 +11576,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 YES - + 301 @@ -11512,6 +11584,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 298 {{0, 3}, {200, 26}} + YES @@ -11520,14 +11593,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 -2038284288 - 268435491 + 35 .LucidaGrandeUI 12 16 - D + 400 75 @@ -11596,6 +11669,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 301 {{208, 3}, {57, 25}} + YES 75497472 @@ -11635,6 +11709,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {269, 32} + + NSView diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 22664443..54bebacb 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -3,12 +3,12 @@ 1060 13F34 - 6254 + 6751 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 6254 + 6751 NSCustomObject @@ -1230,7 +1230,7 @@ Go to Database… - d + D 1048576 2147483647 @@ -10124,6 +10124,7 @@ id NSPopUpButton id + SPTableContentFilterController NSButton NSButton NSButton @@ -10203,6 +10204,10 @@ filterButton id + + filterControllerInstance + SPTableContentFilterController + filterTableClearButton NSButton @@ -10453,6 +10458,43 @@ ../Source/SPTableContent.m + + SPTableContentFilterController + NSObject + + SPSplitView + NSRuleEditor + SPTableData + SPDatabaseDocument + SPTablesList + + + + contentSplitView + SPSplitView + + + filterRuleEditor + NSRuleEditor + + + tableDataInstance + SPTableData + + + tableDocumentInstance + SPDatabaseDocument + + + tablesListInstance + SPTablesList + + + + IBProjectSource + ../Source/SPTableContentFilterController.h + + SPTableData NSObject @@ -11369,30 +11411,597 @@ - PSMTabBarControl + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSButton NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSComboBox + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSComboBox.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSDocument + NSObject + + id + id + id + id + id + id + + + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocumentController + NSObject + + id + id + id + id + + + + clearRecentDocuments: + id + + + newDocument: + id + + + openDocument: + id + + + saveAllDocuments: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSPopover + NSResponder + + performClose: + id + + + performClose: + + performClose: + id + + + NSViewController id - id - NSTabView + + contentViewController + NSViewController + delegate id - - partnerView + + + IBFrameworkSource + AppKit.framework/Headers/NSPopover.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSRuleEditor + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSRuleEditor.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSStepper + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSStepper.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSTokenField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSTokenField.h + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSViewController + NSResponder + + view + NSView + + + view + + view + NSView + + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: id - - tabView - NSTabView + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + PDFView + NSView + + id + id + id + id + id + id + id + id + id + id + + + + goBack: + id + + + goForward: + id + + + goToFirstPage: + id + + + goToLastPage: + id + + + goToNextPage: + id + + + goToPreviousPage: + id + + + selectAll: + id + + + takeBackgroundColorFrom: + id + + + zoomIn: + id + + + zoomOut: + id + + + + IBFrameworkSource + Quartz.framework/Frameworks/PDFKit.framework/Headers/PDFView.h + + + + QCView + NSView + + id + id + id + + + + play: + id + + + start: + id + + + stop: + id IBFrameworkSource - PSMTabBar.framework/Headers/PSMTabBarControl.h + Quartz.framework/Frameworks/QuartzComposer.framework/Headers/QCView.h @@ -11444,6 +12053,73 @@ Sparkle.framework/Headers/SUUpdater.h + + WebView + NSView + + id + id + id + id + id + id + id + id + id + id + id + + + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + 0 -- cgit v1.2.3 From dfcbabf42c877ba6b5d626d02095d34559e5fee2 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 14 May 2015 20:13:06 +0200 Subject: Fix a data corruption issue in custom query editor (fixes #2113) ... which occurred if ALL of the following conditions were met: * A cell of a custom query result was being edited * At the same time another process removed said row * The custom query was rerun without canceling or finishing the edit first (also added a NSBeep() for a certain tooltip error message) --- Source/SPCustomQuery.m | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 70ff07ff..a6e14b34 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -563,6 +563,9 @@ { NSString *taskString; + //ensure there is no pending edit, which could be messed up (#2113) + [[tableDocumentInstance parentWindow] endEditingFor:nil]; + if ([queries count] > 1) { taskString = [NSString stringWithFormat:NSLocalizedString(@"Running query %i of %lu...", @"Running multiple queries string"), 1, (unsigned long)[queries count]]; } @@ -3822,27 +3825,31 @@ pos.y -= 20; switch(numberOfPossibleUpdateRows) { case -1: - [SPTooltip showWithObject:kCellEditorErrorNoMultiTabDb - atLocation:pos - ofType:@"text"]; - shouldBeginEditing = NO; + NSBeep(); + [SPTooltip showWithObject:kCellEditorErrorNoMultiTabDb + atLocation:pos + ofType:@"text"]; + shouldBeginEditing = NO; break; + case 0: - [SPTooltip showWithObject:[NSString stringWithFormat:kCellEditorErrorNoMatch, [columnDefinition objectForKey:@"org_table"]] - atLocation:pos - ofType:@"text"]; - shouldBeginEditing = NO; + NSBeep(); + [SPTooltip showWithObject:[NSString stringWithFormat:kCellEditorErrorNoMatch, [columnDefinition objectForKey:@"org_table"]] + atLocation:pos + ofType:@"text"]; + shouldBeginEditing = NO; break; case 1: - shouldBeginEditing = YES; + shouldBeginEditing = YES; break; default: - [SPTooltip showWithObject:[NSString stringWithFormat:kCellEditorErrorTooManyMatches, (long)numberOfPossibleUpdateRows] - atLocation:pos - ofType:@"text"]; - shouldBeginEditing = NO; + NSBeep(); + [SPTooltip showWithObject:[NSString stringWithFormat:kCellEditorErrorTooManyMatches, (long)numberOfPossibleUpdateRows] + atLocation:pos + ofType:@"text"]; + shouldBeginEditing = NO; } isFieldEditable = shouldBeginEditing; -- cgit v1.2.3 From 0f0c43eb74408b6a65a42e2c6fd46f4142ef8e3f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 15 May 2015 00:07:41 +0200 Subject: * Fix some spacing issues for localization * Removed some leftover elements in Prefs from the old favorites UI --- Interfaces/English.lproj/ConnectionView.xib | 432 ++++++++++++++++++++++-- Interfaces/English.lproj/Preferences.xib | 504 ++-------------------------- Source/SPConnectionController.m | 20 +- 3 files changed, 441 insertions(+), 515 deletions(-) diff --git a/Interfaces/English.lproj/ConnectionView.xib b/Interfaces/English.lproj/ConnectionView.xib index 75941fbf..ae601deb 100644 --- a/Interfaces/English.lproj/ConnectionView.xib +++ b/Interfaces/English.lproj/ConnectionView.xib @@ -3,12 +3,12 @@ 1060 13F34 - 6254 + 6751 1265.21 698.00 com.apple.InterfaceBuilder.CocoaPlugin - 6254 + 6751 NSButton @@ -54,7 +54,7 @@ NSApplication - + 274 @@ -78,6 +78,7 @@ {{0, 1}, {200, 22}} + YES @@ -100,6 +101,7 @@ 292 {{61, -1}, {32, 25}} + YES @@ -130,6 +132,7 @@ 292 {{30, -1}, {32, 25}} + YES @@ -156,7 +159,8 @@ 292 {{-2, 0}, {36, 23}} - + + YES 67108928 @@ -364,6 +368,7 @@ + -1 YES 1 YES @@ -384,6 +389,7 @@ {{185, 1}, {15, 22}} + YES @@ -414,6 +420,7 @@ 4352 {200, 489} + YES NO @@ -517,6 +524,7 @@ {200, 489} + @@ -530,6 +538,7 @@ -2147483392 {{229, 1}, {15, 524}} + NO @@ -541,7 +550,8 @@ -2147483392 {{1, 525}, {228, 15}} - + + NO 1 @@ -551,6 +561,7 @@ {{0, 23}, {200, 489}} + 133680 @@ -564,7 +575,8 @@ {200, 513} - + + YES @@ -594,8 +606,9 @@ 268 - {{158.5, 3}, {125, 28}} + {{159, 3}, {139, 28}} + YES @@ -616,8 +629,9 @@ 268 - {{15, 3}, {145, 28}} + {{3, 3}, {157, 28}} + YES @@ -638,8 +652,9 @@ 265 - {{286, 3}, {145, 28}} + {{297, 3}, {146, 28}} + YES @@ -660,14 +675,17 @@ {446, 37} + NSView 274 - {{13, 61}, {420, 417}} + {{3, 61}, {440, 417}} + + 1 @@ -975,7 +993,7 @@ 1 - {{6, 101}, {377, 287}} + {{22, 101}, {377, 287}} NSView @@ -1194,13 +1212,13 @@ NO - {{6, -3}, {377, 104}} + {{22, -3}, {377, 104}} NSView - {{10, 33}, {400, 371}} + {{10, 33}, {420, 371}} Standard @@ -1448,7 +1466,7 @@ 1 - {{6, 142}, {377, 246}} + {{22, 142}, {377, 246}} NSView @@ -1506,6 +1524,7 @@ 268 {{328, 12}, {29, 24}} + YES 67108864 @@ -1660,13 +1679,13 @@ NO - {{6, 38}, {377, 104}} + {{22, 38}, {377, 104}} NSView - {{10, 33}, {400, 371}} + {{10, 33}, {420, 371}} Socket @@ -1688,6 +1707,7 @@ 268 {{108, 3}, {251, 18}} + YES @@ -1712,6 +1732,7 @@ 268 {{110, 343}, {247, 22}} + SPColorSelectorView @@ -1720,6 +1741,7 @@ 268 {{110, 313}, {247, 22}} + YES @@ -1740,6 +1762,7 @@ 268 {{7, 315}, {98, 17}} + YES @@ -1759,6 +1782,7 @@ 268 {{110, 279}, {247, 22}} + YES @@ -1779,6 +1803,7 @@ 268 {{7, 281}, {98, 17}} + YES @@ -1798,6 +1823,7 @@ 268 {{110, 245}, {247, 22}} + YES @@ -1818,6 +1844,7 @@ 268 {{7, 247}, {98, 17}} + YES @@ -1837,6 +1864,7 @@ 268 {{110, 211}, {247, 22}} + YES @@ -1858,6 +1886,7 @@ 268 {{7, 213}, {98, 17}} + YES @@ -1877,6 +1906,7 @@ 268 {{110, 177}, {247, 22}} + YES @@ -1898,6 +1928,7 @@ 268 {{10, 179}, {95, 17}} + YES @@ -1917,6 +1948,7 @@ 268 {{110, 129}, {247, 22}} + YES @@ -1937,6 +1969,7 @@ 268 {{10, 131}, {95, 17}} + YES @@ -1956,6 +1989,7 @@ 268 {{110, 95}, {247, 22}} + YES @@ -1976,6 +2010,7 @@ 268 {{7, 97}, {98, 17}} + YES @@ -1995,6 +2030,7 @@ 268 {{110, 61}, {219, 22}} + YES @@ -2015,6 +2051,7 @@ 268 {{7, 63}, {98, 17}} + YES @@ -2034,6 +2071,7 @@ 268 {{110, 27}, {247, 22}} + YES @@ -2055,6 +2093,7 @@ 268 {{7, 29}, {98, 17}} + YES @@ -2074,6 +2113,7 @@ 268 {{110, 373}, {247, 22}} + YES @@ -2095,6 +2135,7 @@ 268 {{7, 375}, {98, 17}} + YES @@ -2114,6 +2155,7 @@ 268 {{328, 60}, {29, 24}} + YES @@ -2138,6 +2180,7 @@ 268 {{7, 63}, {98, 17}} + YES @@ -2157,6 +2200,7 @@ 268 {{110, 61}, {219, 22}} + YES @@ -2176,8 +2220,9 @@ 1 - {{12, -34}, {377, 422}} + {{22, -34}, {377, 422}} + NSView @@ -2190,6 +2235,7 @@ 268 {{-3, 15}, {107, 17}} + YES @@ -2209,6 +2255,7 @@ 268 {{109, 13}, {220, 22}} + YES @@ -2234,6 +2281,8 @@ 268 {{328, 12}, {29, 24}} + + YES 67108864 @@ -2257,6 +2306,7 @@ 268 {{-3, 49}, {107, 17}} + YES @@ -2276,6 +2326,7 @@ 268 {{109, 47}, {220, 22}} + YES @@ -2301,6 +2352,7 @@ 268 {{328, 46}, {29, 24}} + YES @@ -2325,6 +2377,7 @@ 268 {{-3, 83}, {107, 17}} + YES @@ -2344,6 +2397,7 @@ 268 {{109, 81}, {220, 22}} + YES @@ -2368,6 +2422,7 @@ 268 {{328, 80}, {29, 24}} + YES @@ -2388,14 +2443,16 @@ NO - {{12, -146}, {377, 104}} + {{22, -146}, {377, 104}} + NSView - {{10, 33}, {400, 371}} + {{10, 33}, {420, 371}} + SSH @@ -2415,8 +2472,9 @@ 289 - {{285, 33}, {147, 32}} + {{295, 33}, {147, 32}} + YES @@ -2437,8 +2495,9 @@ 1316 - {{20, 43}, {16, 16}} + {{7, 43}, {16, 16}} + 28938 16 @@ -2447,8 +2506,9 @@ -2147483356 - {{41, 43}, {252, 17}} + {{29, 43}, {264, 17}} + YES @@ -2466,8 +2526,9 @@ 292 - {{15, 37}, {25, 25}} + {{3, 37}, {25, 25}} + YES @@ -2486,20 +2547,23 @@ NO - {{116.5, 5}, {446, 472}} + {{116, 5}, {446, 472}} + NSCustomView {681, 480} + SPFlippedView {681, 481} + @@ -2510,6 +2574,8 @@ -2147483392 {{663, 0}, {16, 580}} + + NO _doScroller: @@ -2521,6 +2587,7 @@ -2147483392 {{0, 466}, {663, 15}} + NO 1 @@ -2531,6 +2598,7 @@ {681, 481} + 133680 @@ -2545,6 +2613,7 @@ 266 {{17, 489}, {647, 17}} + YES @@ -2566,12 +2635,14 @@ {{201, 0}, {681, 513}} + YES {882, 513} + YES 2 @@ -2579,6 +2650,8 @@ {882, 513} + + SPFlippedView @@ -2890,7 +2963,7 @@ {580, 320} - {{0, 0}, {1680, 1028}} + {{0, 0}, {1920, 1178}} {100, 119} {10000000000000, 10000000000000} @@ -2900,7 +2973,7 @@ YES - + 274 @@ -2908,7 +2981,6 @@ 292 {{14, 14}, {273, 18}} - YES 67108864 @@ -2932,7 +3004,6 @@ 274 {{2, 42}, {575, 34}} - YES 67108864 @@ -2948,8 +3019,6 @@ {579, 83} - - NSView @@ -3165,7 +3234,7 @@ - + 268 @@ -3173,7 +3242,6 @@ 268 {{-3, 12}, {371, 34}} - YES 67108864 @@ -3189,8 +3257,6 @@ {365, 52} - - NSView @@ -6150,11 +6216,12 @@ 5862 - + + Edit Connection Buttons Box 5863 @@ -7420,6 +7487,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -7888,6 +7956,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -8707,6 +8776,299 @@ + + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSOutlineView + NSTableView + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSViewController + NSResponder + + view + NSView + + + view + + view + NSView + + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + 0 IBCocoaFramework diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 6839a930..28387db8 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -93,7 +93,6 @@ {580, 172} - {{0, 0}, {1920, 1178}} {580, 72} @@ -114,14 +113,15 @@ {247, 124} {227, 114} - + 256 - 256 - {{17, 86}, {213, 14}} + 266 + {{17, 86}, {192, 14}} + YES 68157504 @@ -157,9 +157,10 @@ - 256 - {{18, 45}, {212, 11}} + 266 + {{18, 45}, {191, 11}} + YES 68157504 @@ -179,9 +180,10 @@ - 258 + 266 {{20, 60}, {187, 18}} + YES -1804599231 @@ -211,9 +213,10 @@ - 259 + 265 {{112, 13}, {100, 28}} + 1 YES @@ -239,9 +242,10 @@ - 259 + 265 {{15, 13}, {99, 28}} + YES 67108864 @@ -261,6 +265,8 @@ {227, 114} + + {{0, 0}, {1920, 1178}} {227, 136} @@ -2009,14 +2015,15 @@ NSView - + 268 268 - {{230, 174}, {332, 28}} + {{202, 174}, {360, 28}} + _NS:9 {250, 750} @@ -2048,6 +2055,7 @@ 268 {{202, 208}, {360, 18}} + YES @@ -2072,6 +2080,7 @@ 12 {{202, 136}, {360, 5}} + {0, 0} @@ -2095,6 +2104,7 @@ 268 {{202, 150}, {360, 18}} + YES @@ -2119,6 +2129,7 @@ 268 {{202, 110}, {360, 18}} + YES @@ -2143,6 +2154,7 @@ 268 {{230, 87}, {332, 18}} + YES @@ -2167,6 +2179,7 @@ 268 {{230, 41}, {332, 18}} + YES @@ -2191,6 +2204,7 @@ 268 {{230, 64}, {332, 18}} + YES @@ -2215,6 +2229,7 @@ 268 {{230, 18}, {332, 18}} + YES 67108864 @@ -2235,6 +2250,8 @@ {580, 244} + + NSView @@ -2548,7 +2565,6 @@ AQAAAAA {{264, 20}, {298, 28}} - _NS:526 {251, 750} YES @@ -3138,7 +3154,7 @@ AQAAAAA 256 {220, 286} - + YES NO YES @@ -3254,7 +3270,7 @@ AQAAAAA {{20, 50}, {222, 288}} - + 133122 @@ -4021,204 +4037,6 @@ AQAAAAA NSView - - - 274 - - - - 292 - {{14, 14}, {273, 18}} - - YES - - 67108864 - 0 - Show hidden files - - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 274 - {{2, 42}, {575, 34}} - - - YES - - 67108864 - 138674176 - Choose a custom SSH key file to use with this connection. Note that standard locations like ~/.ssh are checked automatically, as are any files in your SSH configuration. - - - - - - NO - 1 - - - {579, 83} - - NSView - - - - 274 - - - - 292 - {{14, 14}, {273, 18}} - - YES - - 67108864 - 0 - Show hidden files - - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 274 - {{2, 42}, {575, 17}} - - YES - - 67108864 - 138674176 - Please select the SSL key file to use when establishing a secure connection. - - - - - - NO - 1 - - - {579, 66} - NSView - - - - 274 - - - - 292 - {{14, 14}, {273, 18}} - - YES - - 67108864 - 0 - Show hidden files - - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 274 - {{6, 42}, {575, 17}} - - YES - - 67108864 - 138674176 - Please select the client SSL certificate file to use when establishing a secure connection. - - - - - - NO - 1 - - - {598, 66} - NSView - - - - 274 - - - - 292 - {{14, 14}, {273, 18}} - - YES - - 67108864 - 0 - Show hidden files - - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 274 - {{0, 42}, {575, 34}} - - YES - - 67108864 - 138674176 - Please select the client SSL Certificate Authority certificate to use when establishing a secure connection. This must be the same as the server CA certificate. - - - - - - NO - 1 - - - {579, 83} - NSView - @@ -4293,7 +4111,6 @@ AQAAAAA {{-2, 0}, {408, 14}} - _NS:526 {251, 750} YES @@ -4341,7 +4158,7 @@ AQAAAAA _NS:9 - + NSView @@ -4353,7 +4170,6 @@ AQAAAAA {{18, 18}, {273, 18}} - YES 67108864 @@ -4378,7 +4194,7 @@ AQAAAAA _NS:9 - + NSView @@ -5980,94 +5796,6 @@ AQAAAAA 2205 - - - value: values.KeySelectionHiddenFilesVisibility - - - - - - value: values.KeySelectionHiddenFilesVisibility - value - values.KeySelectionHiddenFilesVisibility - - - - - - - 2 - - - 2239 - - - - value: values.KeySelectionHiddenFilesVisibility - - - - - - value: values.KeySelectionHiddenFilesVisibility - value - values.KeySelectionHiddenFilesVisibility - - - - - - - 2 - - - 2243 - - - - value: values.KeySelectionHiddenFilesVisibility - - - - - - value: values.KeySelectionHiddenFilesVisibility - value - values.KeySelectionHiddenFilesVisibility - - - - - - - 2 - - - 2247 - - - - value: values.KeySelectionHiddenFilesVisibility - - - - - - value: values.KeySelectionHiddenFilesVisibility - value - values.KeySelectionHiddenFilesVisibility - - - - - - - 2 - - - 2251 - nextKeyView @@ -7986,98 +7714,6 @@ AQAAAAA - - 1873 - - - - - - - SSH Key Selection Help - - - 1874 - - - - - - - - 1875 - - - - - 2040 - - - - - - - SSL CA Cert File Selection Help - - - 2041 - - - - - - - SSL Key File Selection Help - - - 2042 - - - - - - - SSL Certificate File Selection Help - - - 2043 - - - - - - - - 2044 - - - - - 2045 - - - - - - - - 2046 - - - - - 2047 - - - - - - - - 2048 - - - 2074 @@ -8166,58 +7802,6 @@ AQAAAAA - - 2229 - - - - - - - - 2230 - - - - - 2240 - - - - - - - - 2241 - - - - - 2244 - - - - - - - - 2245 - - - - - 2248 - - - - - - - - 2249 - - - 2252 @@ -8781,20 +8365,8 @@ AQAAAAA 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 - 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 @@ -8811,14 +8383,6 @@ AQAAAAA 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 ToolTip @@ -8925,7 +8489,7 @@ biBjb21tb24sIHlvdSB3aWxsIG5vIGxvbmdlciBiZSBhYmxlIHRvIGNvbm5lY3QhA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {230, 75} + {200, 537} com.apple.InterfaceBuilder.CocoaPlugin @@ -8957,7 +8521,7 @@ biBjb21tb24sIHlvdSB3aWxsIG5vIGxvbmdlciBiZSBhYmxlIHRvIGNvbm5lY3QhA - {-458, 578} + {200, 870} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index d7fce6fb..dcdaec93 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1545,7 +1545,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, */ - (void)_favoriteTypeDidChange - { +{ NSDictionary *favorite = [self selectedFavorite]; // If either socket or host is localhost, clear. @@ -1560,7 +1560,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self setName:favoriteName]; } } - } +} /** * Convenience method for reloading the outline view, expanding the root item and scrolling to the selected item. @@ -1768,7 +1768,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } return favoriteNode; - } +} #endif /** @@ -1780,7 +1780,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, NSString *result = [subject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; return [result stringByReplacingOccurrencesOfString:@"\n" withString:@""]; - } +} #ifndef SP_CODA /** @@ -1803,7 +1803,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } return aName; - } +} /** @@ -1816,7 +1816,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, // If not connecting, hide the connection status text to reflect changes if (!isConnecting) { [progressIndicatorText setHidden:YES]; - } + } if (isEditingConnection) return; @@ -1833,13 +1833,13 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, // Show the area to allow saving the changes [self setIsEditingConnection:YES]; [favoritesOutlineView setNeedsDisplayInRect:[favoritesOutlineView rectOfRow:[favoritesOutlineView selectedRow]]]; - } +} /** * If editing is active, mark editing as complete, triggering UI updates to match. */ - (void)_stopEditingConnection - { +{ if (!isEditingConnection) return; [self setIsEditingConnection:NO]; @@ -1847,7 +1847,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [editButtonsView setHidden:YES]; [progressIndicatorText setHidden:YES]; [(NSView *)favoritesOutlineView display]; - } +} #endif - (void)_documentWillClose:(NSNotification *)notification @@ -1863,7 +1863,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } if (sshTunnel) [sshTunnel setConnectionStateChangeSelector:nil delegate:nil], SPClear(sshTunnel); - } +} #pragma mark - -- cgit v1.2.3