From e3a67c9070a9c331c68503be481a6eda18402d96 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 11 Dec 2010 22:22:02 +0000 Subject: - Fix an issue where after failing to select a database the database dropdown stayed disabled --- Source/SPDatabaseDocument.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c51a87e3..731ff3c6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5293,14 +5293,18 @@ if ([chooseDatabaseButton indexOfItemWithTitle:targetDatabaseName] == NSNotFound || ![mySQLConnection selectDB:targetDatabaseName]) { + + // End the task first to ensure the database dropdown can be reselected + [self endTask]; + if ( [mySQLConnection isConnected] ) { - SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to connect to database %@.\nBe sure that you have the necessary privileges.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); // Update the database list [[self onMainThread] setDatabases:self]; + + SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); } - [self endTask]; [taskPool drain]; return; } -- cgit v1.2.3 From e8f4c4a9e16b0747647cc914c13d7597800b108d Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sun, 12 Dec 2010 13:32:48 +0000 Subject: =?UTF-8?q?=E2=80=A2=20HTML=20output=20window's=20JavaScript=20sup?= =?UTF-8?q?port=20-=20changed=20the=20approach=20to=20make=20the=20HTML=20?= =?UTF-8?q?output=20window=20the=20key=20window;=20now=20it=20could=20be?= =?UTF-8?q?=20done=20directly=20via=20a=20JavaScript=20command:=20window.s?= =?UTF-8?q?ystem.makeHTMLOutputWindowKeyWindow()=20-=20added=20the=20chanc?= =?UTF-8?q?e=20to=20ask=20Sequel=20Pro=20via=20JavaScript=20for=20run-time?= =?UTF-8?q?=20shell=20variables=20via=20window.system.getShellEnvironmentF?= =?UTF-8?q?orName('shell=5Fvar=5Fname')=20=E2=80=A2=20more=20usage=20of=20?= =?UTF-8?q?constants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.h | 1 + Source/SPAppController.m | 64 +++++++++++++++++++++++++++++++++++ Source/SPBundleEditorController.m | 1 + Source/SPBundleHTMLOutputController.m | 46 +++++++++++++++++++++---- Source/SPConstants.h | 5 +++ Source/SPConstants.m | 5 +++ Source/SPCopyTable.m | 2 +- Source/SPTextViewAdditions.m | 8 ++--- 8 files changed, 120 insertions(+), 12 deletions(-) diff --git a/Source/SPAppController.h b/Source/SPAppController.h index 938a6423..0d68b26c 100644 --- a/Source/SPAppController.h +++ b/Source/SPAppController.h @@ -113,6 +113,7 @@ - (void)handleEventWithURL:(NSURL*)url; - (IBAction)executeBundleItemForApp:(id)sender; +- (NSDictionary*)shellEnvironment; - (void)addHTMLOutputController:(id)controller; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index aa587aba..a002f5cf 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -37,6 +37,7 @@ #import "SPBundleHTMLOutputController.h" #import "SPAlertSheets.h" #import "SPChooseMenuItemDialog.h" +#import "SPCustomQuery.h" #import #import @@ -884,6 +885,69 @@ } +/** + * Return of certain shell variables mainly for usage in JavaScript support inside the + * HTML output window to allow to ask on run-time + */ +- (NSDictionary*)shellEnvironment +{ + NSMutableDictionary *env = [NSMutableDictionary dictionary]; + SPDatabaseDocument *doc = [self frontDocument]; + if(doc) [env addEntriesFromDictionary:[doc shellVariables]]; + id firstResponder = [[NSApp keyWindow] firstResponder]; + if([firstResponder respondsToSelector:@selector(executeBundleItemForInputField:)]) { + BOOL selfIsQueryEditor = ([[[firstResponder class] description] isEqualToString:@"SPTextView"]) ; + NSRange currentWordRange, currentSelectionRange, currentLineRange, currentQueryRange; + currentSelectionRange = [firstResponder selectedRange]; + currentWordRange = [firstResponder getRangeForCurrentWord]; + currentLineRange = [[firstResponder string] lineRangeForRange:NSMakeRange([firstResponder selectedRange].location, 0)]; + + if(selfIsQueryEditor) { + currentQueryRange = [[firstResponder delegate] currentQueryRange]; + } else { + currentQueryRange = currentLineRange; + } + if(!currentQueryRange.length) + currentQueryRange = currentSelectionRange; + + [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope]; + + if(selfIsQueryEditor && [[firstResponder delegate] currentQueryRange].length) + [env setObject:[[firstResponder string] substringWithRange:[[firstResponder delegate] currentQueryRange]] forKey:SPBundleShellVariableCurrentQuery]; + + if(currentSelectionRange.length) + [env setObject:[[firstResponder string] substringWithRange:currentSelectionRange] forKey:SPBundleShellVariableSelectedText]; + + if(currentWordRange.length) + [env setObject:[[firstResponder string] substringWithRange:currentWordRange] forKey:SPBundleShellVariableCurrentWord]; + + if(currentLineRange.length) + [env setObject:[[firstResponder string] substringWithRange:currentLineRange] forKey:SPBundleShellVariableCurrentLine]; + } + else if([firstResponder respondsToSelector:@selector(executeBundleItemForDataTable:)]) { + + if([[firstResponder delegate] respondsToSelector:@selector(usedQuery)] && [[firstResponder delegate] usedQuery]) + [env setObject:[[firstResponder delegate] usedQuery] forKey:SPBundleShellVariableUsedQueryForTable]; + + if([firstResponder numberOfSelectedRows]) { + NSMutableArray *sel = [NSMutableArray array]; + NSIndexSet *selectedRows = [firstResponder selectedRowIndexes]; + NSUInteger rowIndex = [selectedRows firstIndex]; + while ( rowIndex != NSNotFound ) { + [sel addObject:[NSString stringWithFormat:@"%ld", rowIndex]]; + rowIndex = [selectedRows indexGreaterThanIndex:rowIndex]; + } + [env setObject:[sel componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedRowIndices]; + } + + [env setObject:SPBundleScopeDataTable forKey:SPBundleShellVariableScope]; + + } else { + [env setObject:SPBundleScopeGeneral forKey:SPBundleShellVariableScope]; + } + return env; +} + - (void)registerActivity:(NSDictionary*)commandDict { [runningActivitiesArray addObject:commandDict]; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 272221d4..034200b1 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -344,6 +344,7 @@ @"SP_SELECTED_ROW_INDICES", @"SP_SELECTED_TABLE", @"SP_SELECTED_TABLES", + @"SP_SELECTED_TEXT", @"SP_USED_QUERY_FOR_TABLE", nil ] retain]; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index 365c15a3..1e002ab8 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -328,6 +328,10 @@ { if (aSelector == @selector(run:)) return @"run"; + if (aSelector == @selector(getShellEnvironmentForName:)) + return @"getShellEnvironmentForName"; + if (aSelector == @selector(makeHTMLOutputWindowKeyWindow)) + return @"makeHTMLOutputWindowKeyWindow"; return @""; } @@ -335,6 +339,12 @@ if (selector == @selector(run:)) { return NO; } + if (selector == @selector(getShellEnvironmentForName:)) { + return NO; + } + if (selector == @selector(makeHTMLOutputWindowKeyWindow)) { + return NO; + } return YES; } @@ -342,13 +352,41 @@ if (strcmp(property, "run") == 0) { return NO; } + if (strcmp(property, "getShellEnvironmentForName") == 0) { + return NO; + } + if (strcmp(property, "makeHTMLOutputWindowKeyWindow") == 0) { + return NO; + } return YES; } -- (void) windowScriptObjectAvailable:(WebScriptObject*)webScriptObject { +- (void)windowScriptObjectAvailable:(WebScriptObject*)webScriptObject { [webScriptObject setValue:self forKey:@"system"]; } +/** + * JavaScript window.system.getShellEnvironmentForName('a_key') function to + * return the value for key keyName + */ +- (NSString *)getShellEnvironmentForName:(NSString*)keyName +{ + return [[[NSApp delegate] shellEnvironment] objectForKey:keyName]; +} + +/** + * JavaScript window.system.makeHTMLOutputWindowKeyWindow() function + * to make the HTML output window the first responder + */ +- (void)makeHTMLOutputWindowKeyWindow +{ + [[self window] makeKeyAndOrderFront:nil]; +} + +/** + * JavaScript window.system.run('a_command'|new Array('a_command', 'uuid')) function + * to return the result of the BASH command a_command + */ - (NSString *)run:(id)call { @@ -376,12 +414,6 @@ if(!command) return @"No JavaScript command found."; - // Check for internal commands passed via JavaScript - if([command isEqualToString:@"_SP_self_makeKeyWindow"]) { - [[self window] makeKeyAndOrderFront:nil]; - return @""; - } - NSString *output = nil; if(uuid == nil) output = [command runBashCommandWithEnvironment:nil atCurrentDirectoryPath:nil error:&err]; diff --git a/Source/SPConstants.h b/Source/SPConstants.h index d6a0ee5f..804a067f 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -507,6 +507,11 @@ extern NSString *SPBundleShellVariableCurrentEditedColumnName; extern NSString *SPBundleShellVariableSelectedTable; extern NSString *SPBundleShellVariableCurrentEditedTable; extern NSString *SPBundleShellVariableDataTableSource; +extern NSString *SPBundleShellVariableCurrentQuery; +extern NSString *SPBundleShellVariableSelectedText; +extern NSString *SPBundleShellVariableCurrentWord; +extern NSString *SPBundleShellVariableCurrentLine; +extern NSString *SPBundleShellVariableSelectedRowIndices; extern const NSInteger SPBundleRedirectActionNone; extern const NSInteger SPBundleRedirectActionReplaceSection; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 67c51b53..e6ce8771 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -320,6 +320,11 @@ NSString *SPBundleShellVariableCurrentEditedColumnName = @"SP_CURRENT_EDITE NSString *SPBundleShellVariableSelectedTable = @"SP_SELECTED_TABLE"; NSString *SPBundleShellVariableCurrentEditedTable = @"SP_CURRENT_EDITED_TABLE"; NSString *SPBundleShellVariableDataTableSource = @"SP_DATA_TABLE_SOURCE"; +NSString *SPBundleShellVariableCurrentQuery = @"SP_CURRENT_QUERY"; +NSString *SPBundleShellVariableSelectedText = @"SP_SELECTED_TEXT"; +NSString *SPBundleShellVariableCurrentWord = @"SP_CURRENT_WORD"; +NSString *SPBundleShellVariableCurrentLine = @"SP_CURRENT_LINE"; +NSString *SPBundleShellVariableSelectedRowIndices = @"SP_SELECTED_ROW_INDICES"; const NSInteger SPBundleRedirectActionNone = 200; const NSInteger SPBundleRedirectActionReplaceSection = 201; diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 3c665693..1d833b76 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -1163,7 +1163,7 @@ NSInteger kBlobAsImageFile = 4; [sel addObject:[NSString stringWithFormat:@"%ld", rowIndex]]; rowIndex = [selectedRows indexGreaterThanIndex:rowIndex]; } - [env setObject:[sel componentsJoinedByString:@"\t"] forKey:@"SP_SELECTED_ROW_INDICES"]; + [env setObject:[sel componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedRowIndices]; } NSError *inputFileError = nil; diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 5dd7d06c..a37895b8 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -611,16 +611,16 @@ } if(selfIsQueryEditor && [[self delegate] currentQueryRange].length) - [env setObject:[[self string] substringWithRange:[[self delegate] currentQueryRange]] forKey:@"SP_CURRENT_QUERY"]; + [env setObject:[[self string] substringWithRange:[[self delegate] currentQueryRange]] forKey:SPBundleShellVariableCurrentQuery]; if(currentSelectionRange.length) - [env setObject:[[self string] substringWithRange:currentSelectionRange] forKey:@"SP_SELECTED_TEXT"]; + [env setObject:[[self string] substringWithRange:currentSelectionRange] forKey:SPBundleShellVariableSelectedText]; if(currentWordRange.length) - [env setObject:[[self string] substringWithRange:currentWordRange] forKey:@"SP_CURRENT_WORD"]; + [env setObject:[[self string] substringWithRange:currentWordRange] forKey:SPBundleShellVariableCurrentWord]; if(currentLineRange.length) - [env setObject:[[self string] substringWithRange:currentLineRange] forKey:@"SP_CURRENT_LINE"]; + [env setObject:[[self string] substringWithRange:currentLineRange] forKey:SPBundleShellVariableCurrentLine]; NSError *inputFileError = nil; NSString *input = [NSString stringWithString:[[self string] substringWithRange:replaceRange]]; -- cgit v1.2.3 From afcf7c7886fdd17668fa29b38b491cf6b533b4df Mon Sep 17 00:00:00 2001 From: dmoagx Date: Sun, 12 Dec 2010 18:05:25 +0000 Subject: =?UTF-8?q?*=20Fix=20a=20minor=20typo=20(reported=20by=20S=C3=A9rg?= =?UTF-8?q?io=20Miranda)=20and=20update=20.strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/FieldEditorSheet.xib | 1466 +++++++++++++++------- Resources/English.lproj/FieldEditorSheet.strings | Bin 11502 -> 11502 bytes Resources/English.lproj/Localizable.strings | Bin 197540 -> 200956 bytes 3 files changed, 1035 insertions(+), 431 deletions(-) diff --git a/Interfaces/English.lproj/FieldEditorSheet.xib b/Interfaces/English.lproj/FieldEditorSheet.xib index 9b24c5d2..fcee245d 100644 --- a/Interfaces/English.lproj/FieldEditorSheet.xib +++ b/Interfaces/English.lproj/FieldEditorSheet.xib @@ -2,13 +2,13 @@ 1050 - 10F569 - 788 - 1038.29 + 10H574 + 804 + 1038.35 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 788 + 804 YES @@ -20,13 +20,8 @@ com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -49,7 +44,7 @@ View - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 4370 @@ -364,7 +359,7 @@ selectedTextBackgroundColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -664,7 +659,7 @@ {{0, 0}, {1280, 778}} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -4907,7 +4902,9 @@ YES 0 - + + YES + @@ -6881,9 +6878,9 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{91, 231}, {667, 428}} + {{329, 231}, {667, 428}} com.apple.InterfaceBuilder.CocoaPlugin - {{91, 231}, {667, 428}} + {{329, 231}, {667, 428}} @@ -7133,7 +7130,7 @@ ToolTip - Rotate rigth (⇧⌘R) + Rotate right (⇧⌘R) com.apple.InterfaceBuilder.CocoaPlugin @@ -7262,10 +7259,17 @@ YES - NSObject + NSApplication + + IBProjectSource + Frameworks/PSMTabBar/PSMTabDragAssistant.h + + + + NSMenu IBProjectSource - Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h + Source/SPMenuAdditions.h @@ -7279,7 +7283,14 @@ NSObject IBProjectSource - Source/CMImageView.h + Frameworks/PSMTabBar/PSMTabBarCell.h + + + + NSObject + + IBProjectSource + Frameworks/PSMTabBar/PSMTabBarControl.h @@ -7289,6 +7300,41 @@ Source/SPConnectionController.h + + NSObject + + IBProjectSource + Source/SPContentFilterManager.h + + + + NSObject + + IBProjectSource + Source/SPImageView.h + + + + NSObject + + IBProjectSource + Source/SPMainThreadTrampoline.h + + + + NSObject + + IBProjectSource + Source/SPNotLoaded.h + + + + NSObject + + IBProjectSource + Source/SPQueryFavoriteManager.h + + NSObject @@ -7304,7 +7350,7 @@ IBProjectSource - Source/TablesList.h + Source/SPTablesList.h @@ -7322,7 +7368,10 @@ doSelectionTitleCase: doSelectionUpperCase: doTranspose: + executeBundleItemForInputField: insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: selectCurrentLine: selectCurrentWord: selectEnclosingBrackets: @@ -7342,6 +7391,9 @@ id id id + id + id + id @@ -7357,7 +7409,10 @@ doSelectionTitleCase: doSelectionUpperCase: doTranspose: + executeBundleItemForInputField: insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: selectCurrentLine: selectCurrentWord: selectEnclosingBrackets: @@ -7400,10 +7455,22 @@ doTranspose: id + + executeBundleItemForInputField: + id + insertNULLvalue: id + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + selectCurrentLine: id @@ -7453,12 +7520,16 @@ YES YES + bitSheetBitButtonWasClicked: + bitSheetOperatorButtonWasClicked: + bitSheetSelectBit0: closeEditSheet: dropImage: openEditSheet: quickLookFormatButton: saveEditSheet: segmentControllerChanged: + setToNull: YES @@ -7468,21 +7539,41 @@ id id id + id + id + id + id YES YES + bitSheetBitButtonWasClicked: + bitSheetOperatorButtonWasClicked: + bitSheetSelectBit0: closeEditSheet: dropImage: openEditSheet: quickLookFormatButton: saveEditSheet: segmentControllerChanged: + setToNull: YES + + bitSheetBitButtonWasClicked: + id + + + bitSheetOperatorButtonWasClicked: + id + + + bitSheetSelectBit0: + id + closeEditSheet: id @@ -7507,16 +7598,102 @@ segmentControllerChanged: id + + setToNull: + id + YES YES + bitSheet + bitSheetBitButton0 + bitSheetBitButton1 + bitSheetBitButton10 + bitSheetBitButton11 + bitSheetBitButton12 + bitSheetBitButton13 + bitSheetBitButton14 + bitSheetBitButton15 + bitSheetBitButton16 + bitSheetBitButton17 + bitSheetBitButton18 + bitSheetBitButton19 + bitSheetBitButton2 + bitSheetBitButton20 + bitSheetBitButton21 + bitSheetBitButton22 + bitSheetBitButton23 + bitSheetBitButton24 + bitSheetBitButton25 + bitSheetBitButton26 + bitSheetBitButton27 + bitSheetBitButton28 + bitSheetBitButton29 + bitSheetBitButton3 + bitSheetBitButton30 + bitSheetBitButton31 + bitSheetBitButton32 + bitSheetBitButton33 + bitSheetBitButton34 + bitSheetBitButton35 + bitSheetBitButton36 + bitSheetBitButton37 + bitSheetBitButton38 + bitSheetBitButton39 + bitSheetBitButton4 + bitSheetBitButton40 + bitSheetBitButton41 + bitSheetBitButton42 + bitSheetBitButton43 + bitSheetBitButton44 + bitSheetBitButton45 + bitSheetBitButton46 + bitSheetBitButton47 + bitSheetBitButton48 + bitSheetBitButton49 + bitSheetBitButton5 + bitSheetBitButton50 + bitSheetBitButton51 + bitSheetBitButton52 + bitSheetBitButton53 + bitSheetBitButton54 + bitSheetBitButton55 + bitSheetBitButton56 + bitSheetBitButton57 + bitSheetBitButton58 + bitSheetBitButton59 + bitSheetBitButton6 + bitSheetBitButton60 + bitSheetBitButton61 + bitSheetBitButton62 + bitSheetBitButton63 + bitSheetBitButton7 + bitSheetBitButton8 + bitSheetBitButton9 + bitSheetBitLabel0 + bitSheetBitLabel16 + bitSheetBitLabel24 + bitSheetBitLabel32 + bitSheetBitLabel40 + bitSheetBitLabel48 + bitSheetBitLabel56 + bitSheetBitLabel8 + bitSheetCloseButton + bitSheetFieldName + bitSheetHexTextField + bitSheetIntegerTextField + bitSheetNULLButton + bitSheetOctalTextField + bitSheetOkButton + callerInstance editImage editSheet editSheetCancelButton editSheetFieldName + editSheetIsNotEditableCancelButton editSheetOkButton editSheetOpenButton editSheetProgressBar @@ -7527,10 +7704,94 @@ hexTextScrollView hexTextView sheetEditData + usedSheet YES 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 + id + id + id id id id @@ -7544,409 +7805,6 @@ id id id - - - - YES - - YES - editImage - editSheet - editSheetCancelButton - editSheetFieldName - editSheetOkButton - editSheetOpenButton - editSheetProgressBar - editSheetQuickLookButton - editSheetSegmentControl - editTextScrollView - editTextView - hexTextScrollView - hexTextView - sheetEditData - - - YES - - editImage - id - - - editSheet - id - - - editSheetCancelButton - id - - - editSheetFieldName - id - - - editSheetOkButton - id - - - editSheetOpenButton - id - - - editSheetProgressBar - id - - - editSheetQuickLookButton - id - - - editSheetSegmentControl - id - - - editTextScrollView - id - - - editTextView - id - - - hexTextScrollView - id - - - hexTextView - id - - - sheetEditData - id - - - - - IBProjectSource - Source/SPFieldEditorController.h - - - - SPImageView - NSImageView - - delegate - id - - - delegate - - delegate - id - - - - IBUserSource - - - - - - YES - - SPFieldEditorController - NSWindowController - - YES - - YES - bitSheetBitButtonWasClicked: - bitSheetOperatorButtonWasClicked: - bitSheetSelectBit0: - closeBitSheet: - closeEditSheet: - dropImage: - openEditSheet: - quickLookFormatButton: - saveEditSheet: - segmentControllerChanged: - setToNull: - - - YES - id - id - id - id - id - id - id - id - id - id - id - - - - YES - - YES - bitSheetBitButtonWasClicked: - bitSheetOperatorButtonWasClicked: - bitSheetSelectBit0: - closeBitSheet: - closeEditSheet: - dropImage: - openEditSheet: - quickLookFormatButton: - saveEditSheet: - segmentControllerChanged: - setToNull: - - - YES - - bitSheetBitButtonWasClicked: - id - - - bitSheetOperatorButtonWasClicked: - id - - - bitSheetSelectBit0: - id - - - closeBitSheet: - id - - - closeEditSheet: - id - - - dropImage: - id - - - openEditSheet: - id - - - quickLookFormatButton: - id - - - saveEditSheet: - id - - - segmentControllerChanged: - id - - - setToNull: - id - - - - - YES - - YES - bitSheet - bitSheetBitButton0 - bitSheetBitButton1 - bitSheetBitButton10 - bitSheetBitButton11 - bitSheetBitButton12 - bitSheetBitButton13 - bitSheetBitButton14 - bitSheetBitButton15 - bitSheetBitButton16 - bitSheetBitButton17 - bitSheetBitButton18 - bitSheetBitButton19 - bitSheetBitButton2 - bitSheetBitButton20 - bitSheetBitButton21 - bitSheetBitButton22 - bitSheetBitButton23 - bitSheetBitButton24 - bitSheetBitButton25 - bitSheetBitButton26 - bitSheetBitButton27 - bitSheetBitButton28 - bitSheetBitButton29 - bitSheetBitButton3 - bitSheetBitButton30 - bitSheetBitButton31 - bitSheetBitButton32 - bitSheetBitButton33 - bitSheetBitButton34 - bitSheetBitButton35 - bitSheetBitButton36 - bitSheetBitButton37 - bitSheetBitButton38 - bitSheetBitButton39 - bitSheetBitButton4 - bitSheetBitButton40 - bitSheetBitButton41 - bitSheetBitButton42 - bitSheetBitButton43 - bitSheetBitButton44 - bitSheetBitButton45 - bitSheetBitButton46 - bitSheetBitButton47 - bitSheetBitButton48 - bitSheetBitButton49 - bitSheetBitButton5 - bitSheetBitButton50 - bitSheetBitButton51 - bitSheetBitButton52 - bitSheetBitButton53 - bitSheetBitButton54 - bitSheetBitButton55 - bitSheetBitButton56 - bitSheetBitButton57 - bitSheetBitButton58 - bitSheetBitButton59 - bitSheetBitButton6 - bitSheetBitButton60 - bitSheetBitButton61 - bitSheetBitButton62 - bitSheetBitButton63 - bitSheetBitButton7 - bitSheetBitButton8 - bitSheetBitButton9 - bitSheetBitLabel0 - bitSheetBitLabel16 - bitSheetBitLabel24 - bitSheetBitLabel32 - bitSheetBitLabel40 - bitSheetBitLabel48 - bitSheetBitLabel56 - bitSheetBitLabel8 - bitSheetCloseButton - bitSheetFieldName - bitSheetHexTextField - bitSheetIntegerTextField - bitSheetNULLButton - bitSheetOctalTextField - bitSheetOkButton - editImage - editSheet - editSheetCancelButton - editSheetFieldName - editSheetIsNotEditableCancelButton - editSheetOkButton - editSheetOpenButton - editSheetProgressBar - editSheetQuickLookButton - editSheetSegmentControl - editTextScrollView - editTextView - hexTextScrollView - hexTextView - sheetEditData - - - YES - 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 - id - id - id - id - id - id - id - id - id - id - id - id - id - id @@ -8033,6 +7891,7 @@ bitSheetNULLButton bitSheetOctalTextField bitSheetOkButton + callerInstance editImage editSheet editSheetCancelButton @@ -8048,6 +7907,7 @@ hexTextScrollView hexTextView sheetEditData + usedSheet YES @@ -8371,6 +8231,10 @@ bitSheetOkButton NSButton + + callerInstance + id + editImage id @@ -8431,18 +8295,758 @@ sheetEditData id + + usedSheet + id + + + + + IBProjectSource + Source/SPFieldEditorController.h + + + + SPImageView + NSImageView + + delegate + id + + + delegate + + delegate + id + + + + SPImageView + NSImageView - IBDocumentRelativeSource - ../../Source/SPFieldEditorController.h + IBUserSource + - - 0 - IBCocoaFramework - + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSApplication + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.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 + + + + 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 + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Growl.framework/Headers/GrowlApplicationBridge.h + + + + NSObject + + IBFrameworkSource + Print.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + PrintCore.framework/Headers/PDEPluginInterface.h + + + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderCell.h + + + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderControl.h + + + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRValidator.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.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 + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.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 + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.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 + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSView + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSView+BWAdditions.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindow + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/Resources/English.lproj/FieldEditorSheet.strings b/Resources/English.lproj/FieldEditorSheet.strings index f6f508dd..d2995a33 100644 Binary files a/Resources/English.lproj/FieldEditorSheet.strings and b/Resources/English.lproj/FieldEditorSheet.strings differ diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings index 93af30f2..15ffd56a 100644 Binary files a/Resources/English.lproj/Localizable.strings and b/Resources/English.lproj/Localizable.strings differ -- cgit v1.2.3 From b2015bc3974c04557492bb4a698776824ab6689d Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sun, 12 Dec 2010 19:20:57 +0000 Subject: =?UTF-8?q?=E2=80=A2=20made=20usage=20of=20more=20constants=20to?= =?UTF-8?q?=20avoid=20double-storing=20strings=20=E2=80=A2=20fixed=20JavaS?= =?UTF-8?q?cript=20alert=20and=20confirm=20window=20in=20HTML=20output=20w?= =?UTF-8?q?indow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.m | 8 ++-- Source/SPBundleEditorController.m | 85 ++++++++++++++++++----------------- Source/SPBundleHTMLOutputController.m | 25 +++++++---- Source/SPConstants.h | 26 ++++++++++- Source/SPConstants.m | 50 +++++++++++++++------ Source/SPCopyTable.m | 2 +- Source/SPDatabaseDocument.m | 26 +++++------ Source/SPStringAdditions.m | 22 ++++----- Source/SPTextViewAdditions.m | 2 +- 9 files changed, 152 insertions(+), 94 deletions(-) diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a002f5cf..cf36d161 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -770,7 +770,7 @@ NSMutableDictionary *env = [NSMutableDictionary dictionary]; [env setObject:[infoPath stringByDeletingLastPathComponent] forKey:SPBundleShellVariableBundlePath]; [env setObject:bundleInputFilePath forKey:SPBundleShellVariableInputFilePath]; - [env setObject:SPBundleScopeGeneral forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeGeneral forKey:SPBundleShellVariableBundleScope]; NSString *input = @""; NSError *inputFileError = nil; @@ -910,7 +910,7 @@ if(!currentQueryRange.length) currentQueryRange = currentSelectionRange; - [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableBundleScope]; if(selfIsQueryEditor && [[firstResponder delegate] currentQueryRange].length) [env setObject:[[firstResponder string] substringWithRange:[[firstResponder delegate] currentQueryRange]] forKey:SPBundleShellVariableCurrentQuery]; @@ -940,10 +940,10 @@ [env setObject:[sel componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedRowIndices]; } - [env setObject:SPBundleScopeDataTable forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeDataTable forKey:SPBundleShellVariableBundleScope]; } else { - [env setObject:SPBundleScopeGeneral forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeGeneral forKey:SPBundleShellVariableBundleScope]; } return env; } diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 034200b1..dffcb20c 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -304,48 +304,49 @@ [commandBundleTreeController setSortDescriptors:[NSArray arrayWithObjects:sortDescriptor, nil]]; shellVariableSuggestions = [[NSArray arrayWithObjects: - @"SP_ALL_DATABASES", - @"SP_ALL_FUNCTIONS", - @"SP_ALL_PROCEDURES", - @"SP_ALL_TABLES", - @"SP_ALL_VIEWS", - @"SP_APP_RESOURCES_DIRECTORY", - @"SP_BUNDLE_EXIT_INSERT_AS_SNIPPET", - @"SP_BUNDLE_EXIT_INSERT_AS_TEXT", - @"SP_BUNDLE_EXIT_NONE", - @"SP_BUNDLE_EXIT_REPLACE_CONTENT", - @"SP_BUNDLE_EXIT_REPLACE_SELECTION", - @"SP_BUNDLE_EXIT_SHOW_AS_HTML", - @"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP", - @"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP", - @"SP_BUNDLE_INPUT", - @"SP_BUNDLE_INPUT_TABLE_METADATA", - @"SP_BUNDLE_PATH", - @"SP_BUNDLE_SCOPE", - @"SP_CURRENT_EDITED_COLUMN_NAME", - @"SP_CURRENT_EDITED_TABLE", - @"SP_CURRENT_HOST", - @"SP_CURRENT_LINE", - @"SP_CURRENT_PORT", - @"SP_CURRENT_QUERY", - @"SP_CURRENT_USER", - @"SP_CURRENT_WORD", - @"SP_DATA_TABLE_SOURCE", - @"SP_DATABASE_ENCODING", - @"SP_ICON_FILE", - @"SP_PROCESS_ID", - @"SP_QUERY_FILE", - @"SP_QUERY_RESULT_FILE", - @"SP_QUERY_RESULT_META_FILE", - @"SP_QUERY_RESULT_STATUS_FILE", - @"SP_RDBMS_TYPE", - @"SP_RDBMS_VERSION", - @"SP_SELECTED_DATABASE", - @"SP_SELECTED_ROW_INDICES", - @"SP_SELECTED_TABLE", - @"SP_SELECTED_TABLES", - @"SP_SELECTED_TEXT", - @"SP_USED_QUERY_FOR_TABLE", + SPBundleShellVariableAllDatabases, + SPBundleShellVariableAllFunctions, + SPBundleShellVariableAllProcedures, + SPBundleShellVariableAllTables, + SPBundleShellVariableAllViews, + SPBundleShellVariableAppResourcesDirectory, + SPBundleShellVariableBlobFileDirectory, + SPBundleShellVariableExitInsertAsSnippet, + SPBundleShellVariableExitInsertAsText, + SPBundleShellVariableExitNone, + SPBundleShellVariableExitReplaceContent, + SPBundleShellVariableExitReplaceSelection, + SPBundleShellVariableExitInsertAsHTML, + SPBundleShellVariableExitInsertAsHTMLTooltip, + SPBundleShellVariableExitInsertAsTextTooltip, + 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, + SPBundleShellVariableUsedQueryForTable, nil ] retain]; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index 1e002ab8..a632a51a 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -304,19 +304,28 @@ - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { - SPBeginAlertSheet(NSLocalizedString(@"JavaScript Alert", @"javascript alert"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil, - [message description]); + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")]; + [alert setInformativeText:(message)?:@""]; + [alert setMessageText:@"JavaScript"]; + [alert runModal]; + [alert release]; } - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { - NSLog(@"confirm"); - return NO; -} + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")]; + [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"cancel button")]; + [alert setInformativeText:(message)?:@""]; + [alert setMessageText:@"JavaScript"]; -- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame -{ - return @"be patient"; + NSUInteger returnCode = [alert runModal]; + + [alert release]; + + if(returnCode == NSAlertFirstButtonReturn) return YES; + return NO; } - (void)webView:(WebView *)sender windowScriptObjectAvailable: (WebScriptObject *)windowScriptObject diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 804a067f..7d85d2b7 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -501,7 +501,7 @@ extern NSString *SPBundleShellVariableQueryResultFile; extern NSString *SPBundleShellVariableQueryResultStatusFile; extern NSString *SPBundleShellVariableQueryResultMetaFile; extern NSString *SPBundleShellVariableInputTableMetaData; -extern NSString *SPBundleShellVariableScope; +extern NSString *SPBundleShellVariableBundleScope; extern NSString *SPBundleShellVariableUsedQueryForTable; extern NSString *SPBundleShellVariableCurrentEditedColumnName; extern NSString *SPBundleShellVariableSelectedTable; @@ -512,6 +512,30 @@ extern NSString *SPBundleShellVariableSelectedText; extern NSString *SPBundleShellVariableCurrentWord; extern NSString *SPBundleShellVariableCurrentLine; extern NSString *SPBundleShellVariableSelectedRowIndices; +extern NSString *SPBundleShellVariableAllDatabases; +extern NSString *SPBundleShellVariableSelectedTables; +extern NSString *SPBundleShellVariableSelectedDatabase; +extern NSString *SPBundleShellVariableRDBMSVersion; +extern NSString *SPBundleShellVariableRDBMSType; +extern NSString *SPBundleShellVariableProcessID; +extern NSString *SPBundleShellVariableIconFile; +extern NSString *SPBundleShellVariableAppResourcesDirectory; +extern NSString *SPBundleShellVariableExitNone; +extern NSString *SPBundleShellVariableExitReplaceSelection; +extern NSString *SPBundleShellVariableExitReplaceContent; +extern NSString *SPBundleShellVariableExitInsertAsText; +extern NSString *SPBundleShellVariableExitInsertAsSnippet; +extern NSString *SPBundleShellVariableExitInsertAsHTML; +extern NSString *SPBundleShellVariableExitInsertAsTextTooltip; +extern NSString *SPBundleShellVariableExitInsertAsHTMLTooltip; +extern NSString *SPBundleShellVariableCurrentHost; +extern NSString *SPBundleShellVariableCurrentUser; +extern NSString *SPBundleShellVariableCurrentPort; +extern NSString *SPBundleShellVariableDatabaseEncoding; +extern NSString *SPBundleShellVariableAllProcedures; +extern NSString *SPBundleShellVariableAllFunctions; +extern NSString *SPBundleShellVariableAllViews; +extern NSString *SPBundleShellVariableAllTables; extern const NSInteger SPBundleRedirectActionNone; extern const NSInteger SPBundleRedirectActionReplaceSection; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index e6ce8771..d118b6b6 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -305,26 +305,50 @@ NSString *SPBundleTaskScriptCommandFilePath = @"/tmp/SP_BUNDLE_S NSString *SPBundleTaskCopyBlobFileDirectory = @"/tmp/SP_BUNDLE_COPY_BLOB_FILES"; NSString *SPBundleTaskTableMetaDataFilePath = @"/tmp/SP_BUNDLE_TABLE_META_DATA"; +NSString *SPBundleShellVariableAllDatabases = @"SP_ALL_DATABASES"; +NSString *SPBundleShellVariableAllFunctions = @"SP_ALL_FUNCTIONS"; +NSString *SPBundleShellVariableAllProcedures = @"SP_ALL_PROCEDURES"; +NSString *SPBundleShellVariableAllTables = @"SP_ALL_TABLES"; +NSString *SPBundleShellVariableAllViews = @"SP_ALL_VIEWS"; +NSString *SPBundleShellVariableAppResourcesDirectory = @"SP_APP_RESOURCES_DIRECTORY"; +NSString *SPBundleShellVariableBlobFileDirectory = @"SP_BUNDLE_BLOB_FILES_DIRECTORY"; +NSString *SPBundleShellVariableBundlePath = @"SP_BUNDLE_PATH"; +NSString *SPBundleShellVariableBundleScope = @"SP_BUNDLE_SCOPE"; +NSString *SPBundleShellVariableCurrentEditedColumnName = @"SP_CURRENT_EDITED_COLUMN_NAME"; +NSString *SPBundleShellVariableCurrentEditedTable = @"SP_CURRENT_EDITED_TABLE"; +NSString *SPBundleShellVariableCurrentHost = @"SP_CURRENT_HOST"; +NSString *SPBundleShellVariableCurrentLine = @"SP_CURRENT_LINE"; +NSString *SPBundleShellVariableCurrentPort = @"SP_CURRENT_PORT"; +NSString *SPBundleShellVariableCurrentQuery = @"SP_CURRENT_QUERY"; +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 *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 *SPBundleShellVariableExitNone = @"SP_BUNDLE_EXIT_NONE"; +NSString *SPBundleShellVariableExitReplaceContent = @"SP_BUNDLE_EXIT_REPLACE_CONTENT"; +NSString *SPBundleShellVariableExitReplaceSelection = @"SP_BUNDLE_EXIT_REPLACE_SELECTION"; +NSString *SPBundleShellVariableIconFile = @"SP_ICON_FILE"; NSString *SPBundleShellVariableInputFilePath = @"SP_BUNDLE_INPUT"; +NSString *SPBundleShellVariableInputTableMetaData = @"SP_BUNDLE_INPUT_TABLE_METADATA"; NSString *SPBundleShellVariableOutputFilePath = @"SP_BUNDLE_OUTPUT"; -NSString *SPBundleShellVariableBundlePath = @"SP_BUNDLE_PATH"; -NSString *SPBundleShellVariableBlobFileDirectory = @"SP_BUNDLE_BLOB_FILES_DIRECTORY"; +NSString *SPBundleShellVariableProcessID = @"SP_PROCESS_ID"; NSString *SPBundleShellVariableQueryFile = @"SP_QUERY_FILE"; NSString *SPBundleShellVariableQueryResultFile = @"SP_QUERY_RESULT_FILE"; -NSString *SPBundleShellVariableQueryResultStatusFile = @"SP_QUERY_RESULT_STATUS_FILE"; NSString *SPBundleShellVariableQueryResultMetaFile = @"SP_QUERY_RESULT_META_FILE"; -NSString *SPBundleShellVariableInputTableMetaData = @"SP_BUNDLE_INPUT_TABLE_METADATA"; -NSString *SPBundleShellVariableScope = @"SP_BUNDLE_SCOPE"; -NSString *SPBundleShellVariableUsedQueryForTable = @"SP_USED_QUERY_FOR_TABLE"; -NSString *SPBundleShellVariableCurrentEditedColumnName = @"SP_CURRENT_EDITED_COLUMN_NAME"; +NSString *SPBundleShellVariableQueryResultStatusFile = @"SP_QUERY_RESULT_STATUS_FILE"; +NSString *SPBundleShellVariableRDBMSType = @"SP_RDBMS_TYPE"; +NSString *SPBundleShellVariableRDBMSVersion = @"SP_RDBMS_VERSION"; +NSString *SPBundleShellVariableSelectedDatabase = @"SP_SELECTED_DATABASE"; +NSString *SPBundleShellVariableSelectedRowIndices = @"SP_SELECTED_ROW_INDICES"; NSString *SPBundleShellVariableSelectedTable = @"SP_SELECTED_TABLE"; -NSString *SPBundleShellVariableCurrentEditedTable = @"SP_CURRENT_EDITED_TABLE"; -NSString *SPBundleShellVariableDataTableSource = @"SP_DATA_TABLE_SOURCE"; -NSString *SPBundleShellVariableCurrentQuery = @"SP_CURRENT_QUERY"; +NSString *SPBundleShellVariableSelectedTables = @"SP_SELECTED_TABLES"; NSString *SPBundleShellVariableSelectedText = @"SP_SELECTED_TEXT"; -NSString *SPBundleShellVariableCurrentWord = @"SP_CURRENT_WORD"; -NSString *SPBundleShellVariableCurrentLine = @"SP_CURRENT_LINE"; -NSString *SPBundleShellVariableSelectedRowIndices = @"SP_SELECTED_ROW_INDICES"; +NSString *SPBundleShellVariableUsedQueryForTable = @"SP_USED_QUERY_FOR_TABLE"; const NSInteger SPBundleRedirectActionNone = 200; const NSInteger SPBundleRedirectActionReplaceSection = 201; diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 1d833b76..7a132348 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -1153,7 +1153,7 @@ NSInteger kBlobAsImageFile = 4; [env setObject:[[self delegate] usedQuery] forKey:SPBundleShellVariableUsedQueryForTable]; [env setObject:bundleInputTableMetaDataFilePath forKey:SPBundleShellVariableInputTableMetaData]; - [env setObject:SPBundleScopeDataTable forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeDataTable forKey:SPBundleShellVariableBundleScope]; if([self numberOfSelectedRows]) { NSMutableArray *sel = [NSMutableArray array]; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 731ff3c6..144f0710 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4820,47 +4820,47 @@ if (tablesListInstance) { if([tablesListInstance selectedDatabase]) - [env setObject:[tablesListInstance selectedDatabase] forKey:@"SP_SELECTED_DATABASE"]; + [env setObject:[tablesListInstance selectedDatabase] forKey:SPBundleShellVariableSelectedDatabase]; if ([tablesListInstance tableName]) [env setObject:[tablesListInstance tableName] forKey:SPBundleShellVariableSelectedTable]; if ([tablesListInstance selectedTableItems]) - [env setObject:[[tablesListInstance selectedTableItems] componentsJoinedByString:@"\t"] forKey:@"SP_SELECTED_TABLES"]; + [env setObject:[[tablesListInstance selectedTableItems] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedTables]; if ([tablesListInstance allDatabaseNames]) - [env setObject:[[tablesListInstance allDatabaseNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_DATABASES"]; + [env setObject:[[tablesListInstance allDatabaseNames] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableAllDatabases]; if ([tablesListInstance allTableNames]) - [env setObject:[[tablesListInstance allTableNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_TABLES"]; + [env setObject:[[tablesListInstance allTableNames] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableAllTables]; if ([tablesListInstance allViewNames]) - [env setObject:[[tablesListInstance allViewNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_VIEWS"]; + [env setObject:[[tablesListInstance allViewNames] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableAllViews]; if ([tablesListInstance allFunctionNames]) - [env setObject:[[tablesListInstance allFunctionNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_FUNCTIONS"]; + [env setObject:[[tablesListInstance allFunctionNames] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableAllFunctions]; if ([tablesListInstance allProcedureNames]) - [env setObject:[[tablesListInstance allProcedureNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_PROCEDURES"]; + [env setObject:[[tablesListInstance allProcedureNames] componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableAllProcedures]; if ([self user]) - [env setObject:[self user] forKey:@"SP_CURRENT_USER"]; + [env setObject:[self user] forKey:SPBundleShellVariableCurrentUser]; if ([self host]) - [env setObject:[self host] forKey:@"SP_CURRENT_HOST"]; + [env setObject:[self host] forKey:SPBundleShellVariableCurrentHost]; if ([self port]) - [env setObject:[self port] forKey:@"SP_CURRENT_PORT"]; + [env setObject:[self port] forKey:SPBundleShellVariableCurrentPort]; - [env setObject:([self databaseEncoding])?:@"" forKey:@"SP_DATABASE_ENCODING"]; + [env setObject:([self databaseEncoding])?:@"" forKey:SPBundleShellVariableDatabaseEncoding]; } if(1) - [env setObject:@"mysql" forKey:@"SP_RDBMS_TYPE"]; + [env setObject:@"mysql" forKey:SPBundleShellVariableRDBMSType]; if([self mySQLVersion]) - [env setObject:[self mySQLVersion] forKey:@"SP_RDBMS_VERSION"]; + [env setObject:[self mySQLVersion] forKey:SPBundleShellVariableRDBMSVersion]; return (NSDictionary*)env; } diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index a3098750..b523907c 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -519,16 +519,16 @@ NSMutableDictionary *theEnv = [NSMutableDictionary dictionary]; [theEnv setDictionary:shellEnvironment]; - [theEnv setObject:[[NSBundle mainBundle] pathForResource:@"appicon" ofType:@"icns"] forKey:@"SP_ICON_FILE"]; - [theEnv setObject:[NSString stringWithFormat:@"%@/Contents/Resources", [[NSBundle mainBundle] bundlePath]] forKey:@"SP_APP_RESOURCES_DIRECTORY"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionNone] forKey:@"SP_BUNDLE_EXIT_NONE"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionReplaceSection] forKey:@"SP_BUNDLE_EXIT_REPLACE_SELECTION"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionReplaceContent] forKey:@"SP_BUNDLE_EXIT_REPLACE_CONTENT"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsText] forKey:@"SP_BUNDLE_EXIT_INSERT_AS_TEXT"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionInsertAsSnippet] forKey:@"SP_BUNDLE_EXIT_INSERT_AS_SNIPPET"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTML] forKey:@"SP_BUNDLE_EXIT_SHOW_AS_HTML"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsTextTooltip] forKey:@"SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP"]; - [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionShowAsHTMLTooltip] forKey:@"SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP"]; + [theEnv setObject:[[NSBundle mainBundle] pathForResource:@"appicon" ofType:@"icns"] forKey:SPBundleShellVariableIconFile]; + [theEnv setObject:[NSString stringWithFormat:@"%@/Contents/Resources", [[NSBundle mainBundle] bundlePath]] forKey:SPBundleShellVariableAppResourcesDirectory]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionNone] forKey:SPBundleShellVariableExitNone]; + [theEnv setObject:[NSNumber numberWithInteger:SPBundleRedirectActionReplaceSection] forKey:SPBundleShellVariableExitReplaceSelection]; + [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]; // 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. @@ -558,7 +558,7 @@ [doc setProcessID:uuid]; - [theEnv setObject:uuid forKey:@"SP_PROCESS_ID"]; + [theEnv setObject:uuid forKey:SPBundleShellVariableProcessID]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryInputPathHeader, uuid] forKey:SPBundleShellVariableQueryFile]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultPathHeader, uuid] forKey:SPBundleShellVariableQueryResultFile]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultStatusPathHeader, uuid] forKey:SPBundleShellVariableQueryResultStatusFile]; diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index a37895b8..11defa20 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -576,7 +576,7 @@ NSMutableDictionary *env = [NSMutableDictionary dictionary]; [env setObject:[infoPath stringByDeletingLastPathComponent] forKey:SPBundleShellVariableBundlePath]; [env setObject:bundleInputFilePath forKey:SPBundleShellVariableInputFilePath]; - [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope]; + [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableBundleScope]; id tableSource = [self delegate]; if([[[tableSource class] description] isEqualToString:@"SPFieldEditorController"]) { -- cgit v1.2.3