diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPCustomQuery.m | 7 | ||||
-rw-r--r-- | Source/SPFieldEditorController.h | 4 | ||||
-rw-r--r-- | Source/SPFieldEditorController.m | 2 | ||||
-rw-r--r-- | Source/SPTableContent.m | 6 | ||||
-rw-r--r-- | Source/SPTextViewAdditions.m | 11 |
5 files changed, 27 insertions, 3 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index c313edaf..e8420b7c 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2342,6 +2342,13 @@ if([columnDefinition objectForKey:@"null"]) allowNULL = (![[columnDefinition objectForKey:@"null"] integerValue]); + [fieldEditor setEditedFieldInfo:[NSDictionary dictionaryWithObjectsAndKeys: + [columnDefinition objectForKey:@"org_name"], @"colName", + [columnDefinition objectForKey:@"org_table"], @"tableName", + [self usedQuery], @"usedQuery", + @"query", @"tableSource", + nil]]; + [fieldEditor setTextMaxLength:fieldLength]; [fieldEditor setFieldType:(fieldType==nil) ? @"" : fieldType]; [fieldEditor setFieldEncoding:(fieldEncoding==nil) ? @"" : fieldEncoding]; diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h index 625e9869..568ba629 100644 --- a/Source/SPFieldEditorController.h +++ b/Source/SPFieldEditorController.h @@ -163,8 +163,12 @@ BOOL _isGeometry; NSUndoManager *esUndoManager; + NSDictionary *editedFieldInfo; + } +@property(readwrite, retain) NSDictionary *editedFieldInfo; + - (IBAction)closeEditSheet:(id)sender; - (IBAction)openEditSheet:(id)sender; - (IBAction)saveEditSheet:(id)sender; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 17595947..2e761f80 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -34,6 +34,8 @@ @implementation SPFieldEditorController +@synthesize editedFieldInfo; + /** * Initialise an instance of SPFieldEditorController using the XIB “FieldEditorSheet.xib”. Init the available Quciklook format by reading * EditorQuickLookTypes.plist and if given user-defined format store in the Preferences for key (SPQuickLookTypes). diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 4f466470..1e9bdf5f 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -4036,7 +4036,11 @@ if(fieldEditor) [fieldEditor release], fieldEditor = nil; fieldEditor = [[SPFieldEditorController alloc] init]; - + [fieldEditor setEditedFieldInfo:[NSDictionary dictionaryWithObjectsAndKeys: + [[aTableColumn headerCell] stringValue], @"colName", + [self usedQuery], @"usedQuery", + @"content", @"tableSource", + nil]]; [fieldEditor setTextMaxLength:fieldLength]; [fieldEditor setFieldType:(fieldType==nil) ? @"" : fieldType]; [fieldEditor setFieldEncoding:(fieldEncoding==nil) ? @"" : fieldEncoding]; diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index c85b5c51..5dd7d06c 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -578,9 +578,16 @@ [env setObject:bundleInputFilePath forKey:SPBundleShellVariableInputFilePath]; [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope]; - id tableSource = [self delegate]; - if([[[tableSource class] description] isEqualToString:@"SPCopyTable"]) { + if([[[tableSource class] description] isEqualToString:@"SPFieldEditorController"]) { + NSDictionary *editedFieldInfo = [tableSource editedFieldInfo]; + [env setObject:[editedFieldInfo objectForKey:@"colName"] forKey:SPBundleShellVariableCurrentEditedColumnName]; + if([editedFieldInfo objectForKey:@"tableName"]) + [env setObject:[editedFieldInfo objectForKey:@"tableName"] forKey:SPBundleShellVariableCurrentEditedTable]; + [env setObject:[editedFieldInfo objectForKey:@"usedQuery"] forKey:SPBundleShellVariableUsedQueryForTable]; + [env setObject:[editedFieldInfo objectForKey:@"tableSource"] forKey:SPBundleShellVariableDataTableSource]; + } + else if([[[tableSource class] description] isEqualToString:@"SPCopyTable"]) { NSInteger editedCol = [tableSource editedColumn]; if(editedCol > -1) { NSString *colName = [[[[tableSource tableColumns] objectAtIndex:editedCol] headerCell] stringValue]; |