-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewTaskDialogController.m
More file actions
38 lines (31 loc) · 916 Bytes
/
NewTaskDialogController.m
File metadata and controls
38 lines (31 loc) · 916 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
#import "NewTaskDialogController.h"
#import "TaskObject.h"
@implementation NewTaskDialogController
/*
+ (id)sharedInstance {
self = [ super sharedInstance ];
[ submitButton setTitle: NSLocalizedString( @"New", @"New task dialog submit button text" ) ];
return self;
}
*/
- (id)initWithTask: (TaskObject *)aTask {
[ super init ];
[ self setTask: aTask ];
[ submitButton setTitle: NSLocalizedString( @"New", @"New task dialog submit button text" ) ];
return self;
}
// delegates
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)context {
TaskObject *newtask;
switch ( returnCode ) {
case NSCancelButton :
break;
case NSOKButton :
newtask = [ TaskObject taskWithTask: [ self task ]];
[[ NSNotificationCenter defaultCenter ] postNotificationName: TaskCreatedNotification
object: newtask ];
break;
}
[sheet orderOut:nil];
}
@end