forked from mvexel/MilkMaid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MultiAddWindowController.m
39 lines (32 loc) · 1.07 KB
/
MultiAddWindowController.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
//
// MultiAddWindowController.m
// MilkMaid
//
// Created by Gregamel on 2/16/10.
// Copyright 2010 JGA. All rights reserved.
//
#import "MultiAddWindowController.h"
@implementation MultiAddWindowController
@synthesize tasks;
@synthesize globalAttributes;
-(void)addClicked:(id)sender {
NSTextView *textView = [scrollTextView documentView];
NSString *tasksString = [[textView textStorage] string];
tasksString = [tasksString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
tasks = [tasksString componentsSeparatedByString:@"\n"];
globalAttributes = [globalTextField stringValue];
[tasks retain];
[globalAttributes retain];
[textView setString:@""];
[globalTextField setStringValue:@""];
[self.window makeFirstResponder:scrollTextView];
[NSApp endSheet:[self window] returnCode:1];
}
-(void)cancelClicked:(id)sender {
NSTextView *textView = [scrollTextView documentView];
[textView setString:@""];
[globalTextField setStringValue:@""];
[self.window makeFirstResponder:scrollTextView];
[NSApp endSheet:[self window] returnCode:0];
}
@end