-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathPreferencesController.m
39 lines (29 loc) · 957 Bytes
/
PreferencesController.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
#import "PreferencesController.h"
#import "MainController.h"
@implementation PreferencesController
- (void)windowWillClose:(NSNotification *)notification
{
// to be sure remove the focus from the filename field in order to trigger it binding the new value
[[_csvFilenameField window] makeFirstResponder:[_csvFilenameField window]];
}
- (id)initWithCoder:(NSCoder *)decoder
{
return [self init];
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
}
- (IBAction) pickOutputFileClicked:(id) sender {
NSSavePanel *sp;
int savePanelResult;
sp = [NSSavePanel savePanel];
[sp setTitle:@"Autosave CSV"];
[sp setNameFieldLabel:@"Filename:"];
[sp setPrompt:@"Save"];
[sp setRequiredFileType:@"csv"];
savePanelResult = [sp runModalForDirectory:nil file:@"Time Tracker Data.csv"];
if (savePanelResult == NSOKButton) {
[_mainController setAutosaveCsvFilename:[sp filename]];
}
}
@end