aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-11 12:43:46 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-11 12:43:46 +0000
commitf5a548c05eb23afd80d3c7f105233542b0cfe8aa (patch)
treea822cf20087f43a9942769c1ded82735a592ceed /Source/SPTextView.m
parentf633a067d2120cca67fd1b2782688424cadde9d4 (diff)
downloadsequelpro-f5a548c05eb23afd80d3c7f105233542b0cfe8aa.tar.gz
sequelpro-f5a548c05eb23afd80d3c7f105233542b0cfe8aa.tar.bz2
sequelpro-f5a548c05eb23afd80d3c7f105233542b0cfe8aa.zip
• added to Bundle shell command these variables:
SP_ALL_DATABASES, SP_ALL_TABLES, SP_ALL_VIEWS, SP_ALL_FUNCTIONS, SP_ALL_PROCEDURES, SP_RDBMS_VERSION, SP_RDBMS_TYPE [hard-coded yet ;)] • some minor improvements to editor Bundle support • fixed issue while running a bash command that the SP GUI doesn't block • added first sequelpro url scheme functionality - sequelpro://$SP_PROCESS_ID/passToDoc/SelectTable/a_name - sequelpro://$SP_PROCESS_ID/passToDoc/SelectDatabase/a_db_name - sequelpro://$SP_PROCESS_ID/passToDoc/SelectDatabase/a_db_name/a_table_name
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m68
1 files changed, 45 insertions, 23 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 8a065c5c..34c87822 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -3580,6 +3580,27 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if (tablesListInstance && [tablesListInstance selectedDatabase])
[env setObject:[tablesListInstance selectedDatabase] forKey:@"SP_SELECTED_DATABASE"];
+ if (tablesListInstance && [tablesListInstance allDatabaseNames])
+ [env setObject:[[tablesListInstance allDatabaseNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_DATABASES"];
+
+ if (tablesListInstance && [tablesListInstance allTableNames])
+ [env setObject:[[tablesListInstance allTableNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_TABLES"];
+
+ if (tablesListInstance && [tablesListInstance allViewNames])
+ [env setObject:[[tablesListInstance allViewNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_VIEWS"];
+
+ if (tablesListInstance && [tablesListInstance allFunctionNames])
+ [env setObject:[[tablesListInstance allFunctionNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_FUNCTIONS"];
+
+ if (tablesListInstance && [tablesListInstance allProcedureNames])
+ [env setObject:[[tablesListInstance allProcedureNames] componentsJoinedBySpacesAndQuoted] forKey:@"SP_ALL_PROCEDURES"];
+
+ if(tableDocumentInstance && [tableDocumentInstance mySQLVersion])
+ [env setObject:[tableDocumentInstance mySQLVersion] forKey:@"SP_RDBMS_VERSION"];
+
+ if(1)
+ [env setObject:@"mysql" forKey:@"SP_RDBMS_TYPE"];
+
if (tablesListInstance && [tablesListInstance tableName])
[env setObject:[tablesListInstance tableName] forKey:@"SP_SELECTED_TABLE"];
@@ -3594,36 +3615,37 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSString *output = [cmd runBashCommandWithEnvironment:env atCurrentDirectoryPath:nil error:&err];
- if(err == nil && [cmdData objectForKey:@"output"] && [[cmdData objectForKey:@"output"] length] && ![[cmdData objectForKey:@"output"] isEqualToString:@"nop"]) {
- NSString *action = [[cmdData objectForKey:@"output"] lowercaseString];
+ if(err == nil && [cmdData objectForKey:@"output"]) {
+ if([[cmdData objectForKey:@"output"] length] && ![[cmdData objectForKey:@"output"] isEqualToString:@"nop"]) {
+ NSString *action = [[cmdData objectForKey:@"output"] lowercaseString];
- if([action isEqualToString:@"insertastext"]) {
- [self insertText:output];
- }
+ if([action isEqualToString:@"insertastext"]) {
+ [self insertText:output];
+ }
- else if([action isEqualToString:@"insertassnippet"]) {
- [self insertAsSnippet:output atRange:replaceRange];
- }
+ else if([action isEqualToString:@"insertassnippet"]) {
+ [self insertAsSnippet:output atRange:replaceRange];
+ }
- else if([action isEqualToString:@"replacecontent"]) {
- if([[self string] length])
- [self setSelectedRange:NSMakeRange(0,[[self string] length])];
- [self insertText:output];
- }
+ else if([action isEqualToString:@"replacecontent"]) {
+ if([[self string] length])
+ [self setSelectedRange:NSMakeRange(0,[[self string] length])];
+ [self insertText:output];
+ }
- else if([action isEqualToString:@"replaceselection"]) {
- [self shouldChangeTextInRange:replaceRange replacementString:output];
- [self replaceCharactersInRange:replaceRange withString:output];
- }
+ else if([action isEqualToString:@"replaceselection"]) {
+ [self shouldChangeTextInRange:replaceRange replacementString:output];
+ [self replaceCharactersInRange:replaceRange withString:output];
+ }
- else if([action isEqualToString:@"showastexttooltip"]) {
- [SPTooltip showWithObject:output];
- }
+ else if([action isEqualToString:@"showastexttooltip"]) {
+ [SPTooltip showWithObject:output];
+ }
- else if([action isEqualToString:@"showashtmltooltip"]) {
- [SPTooltip showWithObject:output ofType:@"html"];
+ else if([action isEqualToString:@"showashtmltooltip"]) {
+ [SPTooltip showWithObject:output ofType:@"html"];
+ }
}
-
} else {
NSString *errorMessage = [err localizedDescription];
SPBeginAlertSheet(NSLocalizedString(@"BASH Error", @"bash error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil,