From 4c0b75237fd608107cfff54e904f1b424564617e Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 21 Dec 2010 11:23:55 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20form=20redirecting=20output?= =?UTF-8?q?=20actions=20via=20exit=20codes=20if=20Bundle's=20default=20out?= =?UTF-8?q?put=20action=20was=20None=20=E2=80=A2=20renamed=20constants=20t?= =?UTF-8?q?o=20avoid=20confusing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.m | 7 ++++--- Source/SPBundleEditorController.m | 6 +++--- Source/SPConstants.h | 6 +++--- Source/SPConstants.m | 6 +++--- Source/SPCopyTable.m | 7 ++++--- Source/SPStringAdditions.m | 6 +++--- Source/SPTextViewAdditions.m | 7 ++++--- 7 files changed, 24 insertions(+), 21 deletions(-) (limited to 'Source') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a974ebf1..cbadfb85 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -825,7 +825,9 @@ [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -864,8 +866,7 @@ } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { NSPoint pos = [NSEvent mouseLocation]; pos.y -= 16; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 3d64c112..785618d2 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -316,9 +316,9 @@ SPBundleShellVariableExitNone, SPBundleShellVariableExitReplaceContent, SPBundleShellVariableExitReplaceSelection, - SPBundleShellVariableExitInsertAsHTML, - SPBundleShellVariableExitInsertAsHTMLTooltip, - SPBundleShellVariableExitInsertAsTextTooltip, + SPBundleShellVariableExitShowAsHTML, + SPBundleShellVariableExitShowAsHTMLTooltip, + SPBundleShellVariableExitShowAsTextTooltip, SPBundleShellVariableInputFilePath, SPBundleShellVariableInputTableMetaData, SPBundleShellVariableBundlePath, diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 37687ba1..92aa0786 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -527,9 +527,9 @@ extern NSString *SPBundleShellVariableExitReplaceSelection; extern NSString *SPBundleShellVariableExitReplaceContent; extern NSString *SPBundleShellVariableExitInsertAsText; extern NSString *SPBundleShellVariableExitInsertAsSnippet; -extern NSString *SPBundleShellVariableExitInsertAsHTML; -extern NSString *SPBundleShellVariableExitInsertAsTextTooltip; -extern NSString *SPBundleShellVariableExitInsertAsHTMLTooltip; +extern NSString *SPBundleShellVariableExitShowAsHTML; +extern NSString *SPBundleShellVariableExitShowAsTextTooltip; +extern NSString *SPBundleShellVariableExitShowAsHTMLTooltip; extern NSString *SPBundleShellVariableCurrentHost; extern NSString *SPBundleShellVariableCurrentUser; extern NSString *SPBundleShellVariableCurrentPort; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index d2edebfa..4d7c8850 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -326,11 +326,11 @@ NSString *SPBundleShellVariableCurrentUser = @"SP_CURRENT_USER" NSString *SPBundleShellVariableCurrentWord = @"SP_CURRENT_WORD"; NSString *SPBundleShellVariableDatabaseEncoding = @"SP_DATABASE_ENCODING"; NSString *SPBundleShellVariableDataTableSource = @"SP_DATA_TABLE_SOURCE"; -NSString *SPBundleShellVariableExitInsertAsHTML = @"SP_BUNDLE_EXIT_SHOW_AS_HTML"; -NSString *SPBundleShellVariableExitInsertAsHTMLTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP"; +NSString *SPBundleShellVariableExitShowAsHTML = @"SP_BUNDLE_EXIT_SHOW_AS_HTML"; +NSString *SPBundleShellVariableExitShowAsHTMLTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP"; NSString *SPBundleShellVariableExitInsertAsSnippet = @"SP_BUNDLE_EXIT_INSERT_AS_SNIPPET"; NSString *SPBundleShellVariableExitInsertAsText = @"SP_BUNDLE_EXIT_INSERT_AS_TEXT"; -NSString *SPBundleShellVariableExitInsertAsTextTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP"; +NSString *SPBundleShellVariableExitShowAsTextTooltip = @"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP"; NSString *SPBundleShellVariableExitNone = @"SP_BUNDLE_EXIT_NONE"; NSString *SPBundleShellVariableExitReplaceContent = @"SP_BUNDLE_EXIT_REPLACE_CONTENT"; NSString *SPBundleShellVariableExitReplaceSelection = @"SP_BUNDLE_EXIT_REPLACE_SELECTION"; diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index fad9332e..827672b5 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -1276,7 +1276,9 @@ NSInteger kBlobAsImageFile = 4; [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -1315,8 +1317,7 @@ NSInteger kBlobAsImageFile = 4; } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { NSPoint pos = [NSEvent mouseLocation]; pos.y -= 16; diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index b523907c..a8346399 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -526,9 +526,9 @@ [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionReplaceContent] forKey:SPBundleShellVariableExitReplaceContent]; [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsText] forKey:SPBundleShellVariableExitInsertAsText]; [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsSnippet] forKey:SPBundleShellVariableExitInsertAsSnippet]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTML] forKey:SPBundleShellVariableExitInsertAsHTML]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsTextTooltip] forKey:SPBundleShellVariableExitInsertAsTextTooltip]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTMLTooltip] forKey:SPBundleShellVariableExitInsertAsHTMLTooltip]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTML] forKey:SPBundleShellVariableExitShowAsHTML]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsTextTooltip] forKey:SPBundleShellVariableExitShowAsTextTooltip]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTMLTooltip] forKey:SPBundleShellVariableExitShowAsHTMLTooltip]; // Create and set an unique process ID for each SPDatabaseDocument which has to passed // for each sequelpro:// scheme command as user to be able to identify the url scheme command. diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index f04c6684..2e1f8f9b 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -649,7 +649,9 @@ [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; - NSString *action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; + NSString *action = SPBundleOutputActionNone; + if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length]) + action = [[cmdData objectForKey:SPBundleFileOutputActionKey] lowercaseString]; // Redirect due exit code if(err != nil) { @@ -688,8 +690,7 @@ } if(err == nil && output) { - if([cmdData objectForKey:SPBundleFileOutputActionKey] && [[cmdData objectForKey:SPBundleFileOutputActionKey] length] - && ![[cmdData objectForKey:SPBundleFileOutputActionKey] isEqualToString:SPBundleOutputActionNone]) { + if(![action isEqualToString:SPBundleOutputActionNone]) { if([action isEqualToString:SPBundleOutputActionShowAsTextTooltip]) { [SPTooltip showWithObject:output]; -- cgit v1.2.3