aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-17 15:20:01 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-17 15:20:01 +0000
commit072a730f22e3c06fed48acf31ac5708259c93a32 (patch)
treea26034abdc488fe00eb4b7d6d506574c2e48f79e /Source/SPDatabaseDocument.m
parent521c78fc8e87734c8bdf7a30024ba51c3ec1a306 (diff)
downloadsequelpro-072a730f22e3c06fed48acf31ac5708259c93a32.tar.gz
sequelpro-072a730f22e3c06fed48acf31ac5708259c93a32.tar.bz2
sequelpro-072a730f22e3c06fed48acf31ac5708259c93a32.zip
• minor improvements, commenting, cleaning for URL scheme commands
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 0c2b7de7..8557eeba 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -4556,6 +4556,9 @@ YY_BUFFER_STATE yy_scan_string (const char *);
#pragma mark -
#pragma mark Scheme scripting methods
+/**
+ * Return an HTML formatted string representing the passed SQL string syntax highlighted
+ */
- (NSString*)doSQLSyntaxHighlightForString:(NSString*)sqlText cssLike:(BOOL)cssLike
{
@@ -4633,16 +4636,28 @@ YY_BUFFER_STATE yy_scan_string (const char *);
}
+/**
+ * Called by handleSchemeCommand: to break a while loop
+ */
- (void)setTimeout
{
_workingTimeout = YES;
}
+/**
+ * Process passed URL scheme command and wait (timeouted) for the document if it's busy or not yet connected
+ */
- (void)handleSchemeCommand:(NSDictionary*)commandDict
{
+ if(!commandDict) return;
+
NSArray *params = [commandDict objectForKey:@"parameter"];
- if(![params count]) return;
+ if(![params count]) {
+ NSLog(@"No URL scheme command passed");
+ NSBeep();
+ return;
+ }
NSString *command = [params objectAtIndex:0];
NSString *docProcessID = [self processID];