aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index b2876af4..4b5b997c 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -60,6 +60,7 @@
{
// Register application defaults
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PreferenceDefaults" ofType:@"plist"]]];
+
}
/**
@@ -67,6 +68,10 @@
*/
- (void)awakeFromNib
{
+
+ // Register url scheme handle
+ [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
+
// Set up the prefs controller
prefsController = [[SPPreferenceController alloc] init];
@@ -499,6 +504,18 @@
}
#pragma mark -
+#pragma mark URL scheme handler
+
+/**
+ * “sequelpro://” url dispatcher
+ */
+- (void)handleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
+{
+ NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
+ NSLog(@"url = %@", url);
+}
+
+#pragma mark -
#pragma mark Window management
/**