diff options
author | stuconnolly <stuart02@gmail.com> | 2010-12-11 21:52:44 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-12-11 21:52:44 +0000 |
commit | 1ddca4732c3aa46698b8fad25ce1294db3cd32fb (patch) | |
tree | 177ce5977ef37ea98ceae04bbce2f9ba73a0da4d /Source/SPTextViewAdditions.m | |
parent | 66f0041a06b8710cd3ed3b5ff2c8cbb54004efba (diff) | |
parent | cb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8 (diff) | |
download | sequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.tar.gz sequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.tar.bz2 sequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.zip |
Bring outlineview branch up to date with trunk (r2989:3005).
Diffstat (limited to 'Source/SPTextViewAdditions.m')
-rw-r--r-- | Source/SPTextViewAdditions.m | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 6ca111b5..5dd7d06c 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -578,6 +578,38 @@ [env setObject:bundleInputFilePath forKey:SPBundleShellVariableInputFilePath]; [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableScope]; + id tableSource = [self delegate]; + 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]; + 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"]; |