-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPApplicationDelegate.m
More file actions
41 lines (32 loc) · 949 Bytes
/
RPApplicationDelegate.m
File metadata and controls
41 lines (32 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// RPApplicationDelegate.m
// Rampler
//
// Copyright 2010-2012 Fotonauts. All rights reserved.
//
#import "RPApplicationDelegate.h"
#import "RPURLLoaderController.h"
#import "RPWebViewController.h"
@implementation RPApplicationDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self openWebView:self];
}
- (IBAction)openWebView:(id)sender
{
if (!webViewController) {
webViewController = [[RPWebViewController alloc] init];
}
[webViewController open];
}
- (void)handleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSURL *url;
NSURL *httpURL;
RPURLLoaderController *urlLoader;
url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
httpURL = [[NSURL alloc] initWithScheme:@"http" host:[url host] path:[url path]];
urlLoader = [[RPURLLoaderController alloc] init];
[urlLoader start];
}
@end