diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-11-11 12:43:46 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-11-11 12:43:46 +0000 |
commit | f5a548c05eb23afd80d3c7f105233542b0cfe8aa (patch) | |
tree | a822cf20087f43a9942769c1ded82735a592ceed /Source/SPDatabaseDocument.m | |
parent | f633a067d2120cca67fd1b2782688424cadde9d4 (diff) | |
download | sequelpro-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/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index c8f7bc7d..c5f574d9 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4382,6 +4382,49 @@ } #pragma mark - +#pragma mark Scheme scripting methods + +- (void)handleSchemeCommand:(NSDictionary*)commandDict +{ + + NSArray *params = [commandDict objectForKey:@"parameter"]; + if(![params count]) return; + + NSString *command = [params objectAtIndex:0]; + NSString *docProcessID = [self processID]; + if(!docProcessID) docProcessID = @""; + + // Authenticate command + if(![docProcessID isEqualToString:[commandDict objectForKey:@"id"]]) return; + + if([command isEqualToString:@"SelectTable"]) { + if([params count] == 2) { + NSString *tableName = [params objectAtIndex:1]; + if([tableName length]) { + [tablesListInstance selectItemWithName:tableName]; + return; + } + } + } + else if([command isEqualToString:@"SelectDatabase"]) { + if (_isWorkingLevel) return; + if([params count] > 1) { + NSString *dbName = [params objectAtIndex:1]; + NSString *tableName = nil; + if([dbName length]) { + if([params count] == 3) { + tableName = [params objectAtIndex:2]; + } + [self selectDatabase:dbName item:tableName]; + return; + } + } + } + + NSLog(@"received: %@", commandDict); +} + +#pragma mark - #pragma mark Text field delegate methods /** |