aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextViewAdditions.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-09 20:54:16 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-09 20:54:16 +0000
commit3187b984cc76491bf1aabacdf8b2deb5046eaf0a (patch)
tree1c8c6a4a17faf280d16531b52767a094a0ed48f3 /Source/SPTextViewAdditions.m
parent34eac092acd118620c2653731e283ca8aa7fc383 (diff)
downloadsequelpro-3187b984cc76491bf1aabacdf8b2deb5046eaf0a.tar.gz
sequelpro-3187b984cc76491bf1aabacdf8b2deb5046eaf0a.tar.bz2
sequelpro-3187b984cc76491bf1aabacdf8b2deb5046eaf0a.zip
• Bundle Commands
- added shell vars SP_CURRENT_EDITED_COLUMN_NAME, SP_CURRENT_EDITED_TABLE for Input Field scoped commands if invoked from a table cell field editor - added shell var SP_TABLE_DATA_SOURCE (content or query) - fixed table row change trigger for custom query tableView
Diffstat (limited to 'Source/SPTextViewAdditions.m')
-rw-r--r--Source/SPTextViewAdditions.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m
index 6ca111b5..c85b5c51 100644
--- a/Source/SPTextViewAdditions.m
+++ b/Source/SPTextViewAdditions.m
@@ -578,6 +578,31 @@
[env setObject:bundleInputFilePath forKey:SPBundleShellVariableInputFilePath];
[env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope];
+
+ id tableSource = [self delegate];
+ if([[[tableSource class] description] isEqualToString:@"SPCopyTable"]) {
+ NSInteger editedCol = [tableSource editedColumn];
+ if(editedCol > -1) {
+ NSString *colName = [[[[tableSource tableColumns] objectAtIndex:editedCol] headerCell] stringValue];
+ if([[[[tableSource dataSource] class] description] hasSuffix:@"Content"]) {
+ [env setObject:[colName description] forKey:SPBundleShellVariableCurrentEditedColumnName];
+ [env setObject:@"content" forKey:SPBundleShellVariableDataTableSource];
+ } else {
+ NSArray *defs = [[tableSource delegate] dataColumnDefinitions];
+ for(NSDictionary* col in defs) {
+ if([[col objectForKey:@"name"] isEqualToString:colName]) {
+ [env setObject:[col objectForKey:@"org_name"] forKey:SPBundleShellVariableCurrentEditedColumnName];
+ [env setObject:[col objectForKey:@"org_table"] forKey:SPBundleShellVariableCurrentEditedTable];
+ break;
+ }
+ }
+ [env setObject:@"query" forKey:SPBundleShellVariableDataTableSource];
+ }
+ if([[tableSource delegate] respondsToSelector:@selector(usedQuery)] && [[tableSource delegate] usedQuery])
+ [env setObject:[[tableSource delegate] usedQuery] forKey:SPBundleShellVariableUsedQueryForTable];
+ }
+ }
+
if(selfIsQueryEditor && [[self delegate] currentQueryRange].length)
[env setObject:[[self string] substringWithRange:[[self delegate] currentQueryRange]] forKey:@"SP_CURRENT_QUERY"];