Skip to content

Commit 4004761

Browse files
committed
add preferences panel . add resume at reboot check box.
1 parent 7e5b006 commit 4004761

13 files changed

Lines changed: 748 additions & 71 deletions

Preferences/AppPreferences.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AppPreferences.h
3+
// PrefsTest
4+
//
5+
// Created by Dave Jewell on 13/12/2007.
6+
// Copyright 2007 Dave Jewell. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "NSPreferences.h"
11+
12+
@interface AppPreferences : NSPreferences
13+
{
14+
15+
}
16+
17+
@end

Preferences/AppPreferences.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// AppPreferences.m
3+
// PrefsTest
4+
//
5+
// Created by Dave Jewell on 13/12/2007.
6+
// Copyright 2007 Dave Jewell. All rights reserved.
7+
//
8+
9+
#import "AppPreferences.h"
10+
#import "GeneralPreferences.h"
11+
//#import "HotKeyPreferences.h"
12+
13+
@implementation AppPreferences
14+
15+
- (id) init
16+
{
17+
_nsBeginNSPSupport(); // MUST come before [super init]
18+
self = [super init];
19+
20+
[self addPreferenceNamed: @"General" owner: [GeneralPreferences sharedInstance]];
21+
//[self addPreferenceNamed: @"HotKeys" owner: [HotKeyPreferences sharedInstance]];
22+
return self;
23+
}
24+
25+
- (BOOL) usesButtons
26+
{
27+
return NO;
28+
}
29+
30+
@end

Preferences/GeneralPreferences.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// GeneralPreferences.h
3+
// PrefsTest
4+
//
5+
// Created by Dave Jewell on 13/12/2007.
6+
// Copyright 2007 Dave Jewell. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import "NSPreferences.h"
11+
12+
@interface GeneralPreferences : NSPreferencesModule
13+
{
14+
15+
}
16+
17+
@end

Preferences/GeneralPreferences.m

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// GeneralPreferences.m
3+
// PrefsTest
4+
//
5+
// Created by Dave Jewell on 13/12/2007.
6+
// Copyright 2007 Dave Jewell. All rights reserved.
7+
//
8+
9+
#import "GeneralPreferences.h"
10+
#import "UPlayer.h"
11+
12+
@interface GeneralPreferences ()
13+
@property (weak) IBOutlet NSButton *resumeAtRebootCheckBox;
14+
15+
@end
16+
17+
@implementation GeneralPreferences
18+
19+
-(void)awakeFromNib
20+
{
21+
self.resumeAtRebootCheckBox.state = player().document.resumeAtReboot ? NSOnState : NSOffState;
22+
}
23+
24+
- (BOOL) isResizable
25+
{
26+
return NO;
27+
}
28+
29+
- (IBAction)actionResumeAtReboot:(id)sender {
30+
player().document.resumeAtReboot = (self.resumeAtRebootCheckBox.state == NSOnState ? 1 : 0);
31+
}
32+
33+
@end

0 commit comments

Comments
 (0)