Chameleon Applications

Chameleon Applications Commit Details

Date:2010-01-22 23:41:26 (14 years 2 months ago)
Author:Rekursor
Commit:46
Parents: 45
Message:Implemented refresh lock state from the PreferencesController protocol for all panels, so now it disable enable all necessary content according to authorization.
Changes:
M/trunk/ChameleonPrefPane/Sources/BootSetupController.h
M/trunk/ChameleonPrefPane/Sources/AdvancedSetupController.h
M/trunk/ChameleonPrefPane/Sources/BootSetupController.mm
M/trunk/ChameleonPrefPane/Sources/AdvancedSetupController.mm
M/trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm
M/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
M/trunk/ChameleonPrefPane/Sources/PeripheralsController.h
M/trunk/ChameleonPrefPane/Sources/BootFlagsController.h
M/trunk/ChameleonPrefPane/Sources/PeripheralsController.mm
M/trunk/ChameleonPrefPane/Sources/BootFlagsController.mm

File differences

trunk/ChameleonPrefPane/Sources/AdvancedSetupController.h
99
1010
1111
12
1213
13
14
15
1416
1517
1618
......
4345
4446
4547
46
47
48
48
4949
5050
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface AdvancedSetupController : PreferencesControllerBase {
@interface AdvancedSetupController : PreferencesControllerBase <PreferenceController>
{
IBOutlet NSButton*mKernel;
IBOutlet NSTextField*mKernelText;
IBOutlet NSButton*mDeviceRd;
IBOutlet NSTextField*mWakeImageText;
}
-(IBAction) onCheckButtonChange: (id) sender;
-(IBAction) onTextFiedChange: (id) sender;
-(void) loadOptionsFromPreferencesFile;
+ (AdvancedSetupController *)instance;
@end
trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm
55
66
77
8
9
10
11
812
913
1014
......
5357
5458
5559
56
57
58
59
60
6061
6162
6263
......
105106
106107
107108
109
110
111
112
113
114
108115
109116
110117
//
#import "ChameleonPrefPane.h"
#import "BootSetupController.h"
#import "BootFlagsController.h"
#import "PeripheralsController.h"
#import "AdvancedSetupController.h"
#include <process.h>
#include <property_list.h>
@implementation ChameleonPrefPane
+ (ChameleonPrefPane *)instance
{
return(gInstance);
}
+ (ChameleonPrefPane *)instance { return(gInstance);}
//--------------------------------------------------------------------------
- (id) init
[mStatusText setEnabled:[self isUnlocked]];
[mFreezeParts setEnabled:[self isUnlocked]];
[mInjectFrozenParts setEnabled:[self isUnlocked]];
// Refresh other panels
[[BootSetupController instance] refreshLockStates];
[[BootFlagsController instance] refreshLockStates];
[[PeripheralsController instance] refreshLockStates];
[[AdvancedSetupController instance] refreshLockStates];
}
trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
88
99
1010
11
12
13
14
15
16
17
18
19
20
21
1122
12
23
24
1325
1426
1527
#import <Cocoa/Cocoa.h>
#import <ChameleonPrefPane.h>
@protocol PreferenceController
@required
// must be implemented in all derived classes
- (void) refreshLockStates;
-(IBAction) onCheckButtonChange: (id) sender;
-(IBAction) onTextFiedChange: (id) sender;
-(void) loadOptionsFromPreferencesFile;
@end
// Define common expected behavior for all derived controllers
@interface PreferencesControllerBase : NSObject {
@interface PreferencesControllerBase : NSObject
{
}
trunk/ChameleonPrefPane/Sources/PeripheralsController.mm
77
88
99
10
1011
1112
1213
14
15
16
17
18
19
20
1321
1422
1523
1624
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1741
1842
1943
......
2953
3054
3155
56
57
3258
#import "PeripheralsController.h"
static PeripheralsController *gInstance = NULL;
@implementation PeripheralsController
- (id) init
{
self = [super init];
gInstance = self;
}
// TODO implement a smart & reusable option modification, usable by all controllers
// these pair of methods in each controller should all rely on a single external class instance (singleton)
// that would implement in an opaque way the options streaming between the panels and the pref. file
- (void) refreshLockStates
{
[mLegacyLogo setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mBootBanner setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mVBIOS setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mVideoROM setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mVideoROMText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mGraphicsMode setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mGraphicsModeText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mGraphicsEnabler setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mUSBBusFix setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mEHCIacquire setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mUHCIreset setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mEthernetBuiltIn setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
}
-(IBAction) onCheckButtonChange: (id) sender
{
}
+ (PeripheralsController *)instance { return(gInstance);}
@end
trunk/ChameleonPrefPane/Sources/BootFlagsController.mm
77
88
99
10
1011
1112
1213
14
15
16
17
18
19
1320
1421
1522
1623
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
1742
1843
1944
......
2954
3055
3156
57
58
3259
#import "BootFlagsController.h"
static BootFlagsController *gInstance = NULL;
@implementation BootFlagsController
- (id) init
{
self = [super init];
return (gInstance = self);
}
// TODO implement a smart & reusable option modification, usable by all controllers
// these pair of methods in each controller should all rely on a single external class instance (singleton)
// that would implement in an opaque way the options streaming between the panels and the pref. file
- (void) refreshLockStates
{
[mVerbose setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSafeBoot setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mIgnoreBootConfig setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mTimeOut setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mTimeOutText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSingleUser setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mQuietBoot setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mInstantMenu setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mWait setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSafeBoot setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mIgnoreBootConfig setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mRescan setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mRescanPrompt setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mRescanSingleDrive setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
}
-(IBAction) onCheckButtonChange: (id) sender
{
}
+ (BootFlagsController *)instance { return(gInstance);}
@end
trunk/ChameleonPrefPane/Sources/BootSetupController.mm
88
99
1010
11
12
1113
1214
15
16
17
18
19
1320
1421
1522
1623
24
25
26
27
28
29
30
31
32
1733
1834
1935
......
3046
3147
3248
49
50
3351
#import "BootSetupController.h"
static BootSetupController *gInstance = NULL;
@implementation BootSetupController
- (id) init
{
self = [super init];
return (gInstance = self);
}
// TODO implement a smart & reusable option modification, usable by all controllers
// these pair of methods in each controller should all rely on a single external class instance (singleton)
// that would implement in an opaque way the options streaming between the panels and the pref. file
- (void) refreshLockStates
{
[mDefaultPartition setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDefaultPartitionText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mHidePartition setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mHidePartitionText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mRenamePartition setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mRenamePartitionText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
}
-(IBAction) onCheckButtonChange: (id) sender
{
}
+ (BootSetupController *)instance { return(gInstance);}
@end
trunk/ChameleonPrefPane/Sources/AdvancedSetupController.mm
77
88
99
10
1011
1112
1213
14
15
16
17
18
19
1320
1421
1522
1623
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
1753
1854
1955
......
2864
2965
3066
67
3168
3269
#import "AdvancedSetupController.h"
static AdvancedSetupController *gInstance = NULL;
@implementation AdvancedSetupController
- (id) init
{
self = [super init];
return (gInstance = self);
}
// TODO implement a smart & reusable option modification, usable by all controllers
// these pair of methods in each controller should all rely on a single external class instance (singleton)
// that would implement in an opaque way the options streaming between the panels and the pref. file
- (void) refreshLockStates
{
[mKernel setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mKernelText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDeviceRd setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDeviceRdText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mArch setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mArchText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mCPU setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mCPUText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mBusRatio setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mBusRatioText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDebug setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDebugText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mIO setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mIOText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDisableKextsBlacklisting setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDSDTFile setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDSDTFileText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mDSDTDrop setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSMBIOSFile setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSMBIOSFileText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mSMBIOSDefaults setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mWake setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mForceWake setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mWakeImage setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
[mWakeImageText setEnabled:[[ChameleonPrefPane instance] isUnlocked]];
}
-(IBAction) onCheckButtonChange: (id) sender
{
{
}
+ (AdvancedSetupController *)instance { return(gInstance);}
@end
trunk/ChameleonPrefPane/Sources/PeripheralsController.h
1010
1111
1212
13
13
14
1415
1516
1617
......
2930
3031
3132
33
3234
33
34
35
36
3735
// TabView subpane controller definition
@interface PeripheralsController : PreferencesControllerBase {
@interface PeripheralsController : PreferencesControllerBase <PreferenceController>
{
IBOutlet NSButton*mLegacyLogo;
IBOutlet NSButton*mBootBanner;
IBOutlet NSButton*mEthernetBuiltIn;
}
+ (PeripheralsController *)instance;
-(IBAction) onCheckButtonChange: (id) sender;
-(IBAction) onTextFiedChange: (id) sender;
-(void) loadOptionsFromPreferencesFile;
@end
trunk/ChameleonPrefPane/Sources/BootFlagsController.h
88
99
1010
11
1112
12
13
14
1315
1416
1517
......
2830
2931
3032
31
32
33
33
3434
3535
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface BootFlagsController : PreferencesControllerBase {
@interface BootFlagsController : PreferencesControllerBase <PreferenceController>
{
IBOutlet NSButton*mVerbose;
IBOutlet NSButton*mSafeBoot;
IBOutlet NSButton*mRescanSingleDrive;
}
-(IBAction) onCheckButtonChange: (id) sender;
-(IBAction) onTextFiedChange: (id) sender;
-(void) loadOptionsFromPreferencesFile;
+ (BootFlagsController *)instance;
@end
trunk/ChameleonPrefPane/Sources/BootSetupController.h
88
99
1010
11
1112
12
13
14
1315
1416
1517
......
2426
2527
2628
27
28
29
3029
30
31
3132
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface BootSetupController : PreferencesControllerBase {
@interface BootSetupController : PreferencesControllerBase <PreferenceController>
{
// TODO move swap hds and freeze buttons to this class
}
-(IBAction) onCheckButtonChange: (id) sender;
-(IBAction) onTextFiedChange: (id) sender;
-(void) loadOptionsFromPreferencesFile;
+ (BootSetupController *)instance;
@end

Archive Download the corresponding diff file

Revision: 46