-
Notifications
You must be signed in to change notification settings - Fork 0
/
jigsawAppDelegate.m
61 lines (47 loc) · 1.78 KB
/
jigsawAppDelegate.m
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// jigsawAppDelegate.m
// jigsaw
//
// Created by Will Goring on 06/12/2009.
//
#import "jigsawAppDelegate.h"
#import "BytesToReadableSizeTransformer.h"
#import "BytesToReadableSpeedTransformer.h"
#import "SecondsToReadableDurationTransformer.h"
#import "TorrentNameDecorationTransformer.h"
@implementation jigsawAppDelegate
@synthesize window;
+ (void)initialize
{
BytesToReadableSizeTransformer* sizeTransformer;
sizeTransformer = [[BytesToReadableSizeTransformer alloc] init];
[NSValueTransformer setValueTransformer:sizeTransformer forName:@"BytesToReadableSizeTransformer"];
BytesToReadableSpeedTransformer* speedTransformer;
speedTransformer = [[BytesToReadableSpeedTransformer alloc] init];
[NSValueTransformer setValueTransformer:speedTransformer forName:@"BytesToReadableSpeedTransformer"];
SecondsToReadableDurationTransformer* durationTransformer;
durationTransformer = [[SecondsToReadableDurationTransformer alloc] init];
[NSValueTransformer setValueTransformer:durationTransformer forName:@"SecondsToReadableDurationTransformer"];
TorrentNameDecorationTransformer* nameTransformer;
nameTransformer = [[TorrentNameDecorationTransformer alloc] init];
[NSValueTransformer setValueTransformer:nameTransformer forName:@"TorrentNameDecorationTransformer"];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[window setDelegate:self];
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
[window makeKeyAndOrderFront:self];
[mainController displayed];
return NO;
}
- (void)windowWillClose:(NSNotification*)notification
{
[mainController hidden];
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
[mainController addLocalTorrentFile:filename];
return YES;
}
@end