Chameleon Applications

Chameleon Applications Commit Details

Date:2010-01-22 21:38:55 (14 years 2 months ago)
Author:Rekursor
Commit:43
Parents: 42
Message:Incorporated Buche boot file detection filtering. added first logic increment for wiring the new tabs, sdtill in progress...
Changes:
A/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
A/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.mm
M/trunk/ChameleonPrefPane/ChameleonPrefPane.xcodeproj/project.pbxproj
M/trunk/ChameleonPrefPane/Sources/BootSetupController.h
M/trunk/ChameleonPrefPane/Sources/process.cpp
M/trunk/ChameleonPrefPane/Sources/AdvancedSetupController.h
M/trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.h
M/trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm
M/trunk/ChameleonPrefPane/Sources/process.h
M/trunk/ChameleonPrefPane/Sources/PeripheralsController.h
M/trunk/ChameleonPrefPane/Sources/BootFlagsController.h

File differences

trunk/ChameleonPrefPane/Sources/AdvancedSetupController.h
66
77
88
9
910
1011
1112
12
13
1314
1415
1516
//
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface AdvancedSetupController : NSObject {
@interface AdvancedSetupController : PreferencesControllerBase {
IBOutlet NSButton*mKernel;
IBOutlet NSTextField*mKernelText;
IBOutlet NSButton*mDeviceRd;
trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm
4747
4848
4949
50
51
5052
5153
5254
5355
56
57
58
59
60
5461
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
5585
5686
5787
......
196226
197227
198228
199
200
201
202
203229
204
205
206
207
208
209
210
211
212
213
214
215
216230
217231
218232
static PartitionExtractor * partExtractor=NULL;
static PropertyList * prop = NULL;
static int currentRowSel = -1;
static ChameleonPrefPane *gInstance = NULL;
//--------------------------------------------------------------------------
@implementation ChameleonPrefPane
+ (ChameleonPrefPane *)instance
{
return(gInstance);
}
//--------------------------------------------------------------------------
- (id) init
{
self = [super init];
gInstance = self;
// set the image to display the current file being played
mMacOSXImage = [self getImageResource: @"MacOSX" ofType: @"png"];
mWindowsImage = [self getImageResource: @"Windows" ofType: @"png"];
mLinuxImage = [self getImageResource: @"Linux" ofType: @"png"];
mCDROMImage = [self getImageResource: @"CDROM" ofType: @"png"];
mUnknownImage = [self getImageResource: @"Chameleon" ofType: @"tiff"];
// Retrieve the com.chameleon.prefPane.plist config
return self;
}
- (NSMutableDictionary*) getPreferencesFile
{
return mOptionsDict;
}
//--------------------------------------------------------------------------
/**
* SFAuthorization delegates
*/
[oldGlobalPreferences release];
}
//--------------------------------------------------------------------------
- (id) init
{
self = [super init];
// set the image to display the current file being played
mMacOSXImage = [self getImageResource: @"MacOSX" ofType: @"png"];
mWindowsImage = [self getImageResource: @"Windows" ofType: @"png"];
mLinuxImage = [self getImageResource: @"Linux" ofType: @"png"];
mCDROMImage = [self getImageResource: @"CDROM" ofType: @"png"];
mUnknownImage = [self getImageResource: @"Chameleon" ofType: @"tiff"];
// Retrieve the com.chameleon.prefPane.plist config
return self;
}
//--------------------------------------------------------------------------
/** When called here, all outlets references are initialized */
- (void)awakeFromNib
trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//
// PreferencesControllerBase.h
// ChameleonPrefPane
//
// Created by Rekursor on 1/22/10.
//
#import <Cocoa/Cocoa.h>
#import <ChameleonPrefPane.h>
// Define common expected behavior for all derived controllers
@interface PreferencesControllerBase : NSObject {
}
-(NSMutableDictionary*) getPreferencesDictionary;
@end
trunk/ChameleonPrefPane/Sources/process.cpp
77
88
99
10
11
1012
13
1114
1215
1316
......
148151
149152
150153
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
154167
155168
156169
#include "process.h"
#include <string.h>
#include <sys/stat.h>
#include <string_util.h>
//----------------------------------------------------------------
// portable open process:
FILE * ShellProcess::open(const char *cmd, const char *mode) {
partInfo.fsType()!="Apple_Free"
)
{
if (partInfo.label().size()==0) partInfo.label("Untitled");
if(_hiddenParts.length()==0 || _hiddenParts.find(partInfo.toHdStr()) == std::string::npos)
_partList.push_back(partInfo);
std::string DiskLabel(label);
DiskLabel.erase( DiskLabel.find_last_not_of(" ") + 1);
std::string UnixPath = "/Volumes/" + DiskLabel + "/usr/bin/man";
std::string WinPath = "/Volumes/" + DiskLabel + "/Windows/system.ini";
if (fileExists(UnixPath) || fileExists(WinPath))
{ //check if one of them exists
if (partInfo.label().size()==0) partInfo.label("Untitled");
if(_hiddenParts.length()==0 ||
_hiddenParts.find(partInfo.toHdStr()) == std::string::npos)
_partList.push_back(partInfo);
}
}
}
}
trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.h
99
1010
1111
12
1213
1314
14
15
1516
1617
1718
......
4041
4142
4243
44
45
46
47
48
49
50
51
52
53
54
4355
4456
4557
4658
47
59
4860
49
5061
5162
5263
53
54
55
56
57
58
59
6064
6165
6266
#import <SecurityFoundation/SFAuthorization.h>
#import <SecurityInterface/SFAuthorizationView.h>
@interface ChameleonPrefPane : NSPreferencePane
{
@public
@private
// Objects corresponding to the interface mapping:
IBOutlet NSTableView *mPartitionsTable;
IBOutlet NSTableColumn *mPartitionImgColumn;
intmPreferenceFileVersion;
}
+ (ChameleonPrefPane*) instance; // return the current instance
- (IBAction)onRestart: (id)sender;
- (IBAction)onShutdown: (id)sender;
- (IBAction)onSleep: (id)sender;
- (IBAction)onSwapHD: (id)sender;
- (IBAction)onUseFrozenParts: (id)sender;
- (IBAction)onInjectPartsToFreeze: (id)sender;
- (NSMutableDictionary*) getPreferencesFile;
- (void)awakeFromNib;
- (void)initBootConfig;
- (id) getImageResource: (NSString *) str ofType: (NSString*) sType;
- (void) loadPreferences;
-(bool) savePreferences: (NSDictionary*) dict;
- (bool) savePreferences: (NSDictionary*) dict;
//- (void) mainViewDidLoad;
- (void)tableViewSelectionDidChange:(NSNotification *)notification;
- (void) selectDefaultPartition;
- (IBAction)onRestart: (id)sender;
- (IBAction)onShutdown: (id)sender;
- (IBAction)onSleep: (id)sender;
- (IBAction)onSwapHD: (id)sender;
- (IBAction)onUseFrozenParts: (id)sender;
- (IBAction)onInjectPartsToFreeze: (id)sender;
- (bool)isUnlocked;
- (void) refreshLockStates;
- (void) doSwapHD: (int) val save: (bool) doSave src: (int)isrc dst: (int) idst;
trunk/ChameleonPrefPane/Sources/process.h
1616
1717
1818
19
20
21
22
23
24
25
26
27
28
29
30
31
32
1933
2034
2135
const int MAX_HD = 10;
//----------------------------------------------------------------
/**
* Check whether file exists:
*/
inline bool fileExists(const char * str)
{
struct stat stFileInfo;
if((stat(str,&stFileInfo)) == 0) return true;
else return false;
}
inline bool fileExists(std::string str) {return fileExists(str.c_str());}
//----------------------------------------------------------------
class ShellProcess
{
public:
trunk/ChameleonPrefPane/Sources/PeripheralsController.h
66
77
88
9
910
1011
1112
12
13
1314
1415
1516
//
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface PeripheralsController : NSObject {
@interface PeripheralsController : PreferencesControllerBase {
IBOutlet NSButton*mLegacyLogo;
IBOutlet NSButton*mBootBanner;
trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
// PreferencesControllerBase.mm
// ChameleonPrefPane
//
// Created by Rekursor on 1/22/10.
//
#import "PreferencesControllerBase.h"
@implementation PreferencesControllerBase
-(NSMutableDictionary*) getPreferencesDictionary
{
if ([ChameleonPrefPane instance]==nil) return nil;
return [[ChameleonPrefPane instance] getPreferencesFile];
}
@end
trunk/ChameleonPrefPane/Sources/BootFlagsController.h
66
77
88
9
910
10
1111
12
12
1313
1414
1515
//
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface BootFlagsController : NSObject {
@interface BootFlagsController : PreferencesControllerBase {
IBOutlet NSButton*mVerbose;
IBOutlet NSButton*mSafeBoot;
trunk/ChameleonPrefPane/Sources/BootSetupController.h
66
77
88
9
910
10
1111
12
12
1313
1414
1515
//
#import <Cocoa/Cocoa.h>
#import <PreferencesControllerBase.h>
// TabView subpane controller definition
@interface BootSetupController : NSObject {
@interface BootSetupController : PreferencesControllerBase {
// TODO move swap hds and freeze buttons to this class
trunk/ChameleonPrefPane/ChameleonPrefPane.xcodeproj/project.pbxproj
2121
2222
2323
24
25
2426
2527
2628
......
5961
6062
6163
64
65
6266
6367
6468
......
146150
147151
148152
153
154
149155
150156
151157
......
220226
221227
222228
229
223230
224231
225232
......
310317
311318
312319
320
313321
314322
315323
01993115110A0EB9003B056E /* AdvancedSetupController.h in Headers */ = {isa = PBXBuildFile; fileRef = 01993113110A0EB9003B056E /* AdvancedSetupController.h */; };
01993116110A0EB9003B056E /* AdvancedSetupController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01993114110A0EB9003B056E /* AdvancedSetupController.mm */; };
01993199110A2C61003B056E /* string_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 01993198110A2C61003B056E /* string_util.h */; };
019931DD110A37FA003B056E /* PreferencesControllerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 019931DB110A37FA003B056E /* PreferencesControllerBase.h */; };
019931DE110A37FA003B056E /* PreferencesControllerBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 019931DC110A37FA003B056E /* PreferencesControllerBase.mm */; };
01A40F75110550F4002A74CD /* CHANGES in Resources */ = {isa = PBXBuildFile; fileRef = 01A40F74110550F4002A74CD /* CHANGES */; };
01B0E8141108B85A00ACF21B /* ChameleonPrefPane.h in Headers */ = {isa = PBXBuildFile; fileRef = 01B0E80E1108B85A00ACF21B /* ChameleonPrefPane.h */; };
01B0E8151108B85A00ACF21B /* ChameleonPrefPane.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01B0E80F1108B85A00ACF21B /* ChameleonPrefPane.mm */; };
01993113110A0EB9003B056E /* AdvancedSetupController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AdvancedSetupController.h; path = Sources/AdvancedSetupController.h; sourceTree = "<group>"; };
01993114110A0EB9003B056E /* AdvancedSetupController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AdvancedSetupController.mm; path = Sources/AdvancedSetupController.mm; sourceTree = "<group>"; };
01993198110A2C61003B056E /* string_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_util.h; path = Sources/string_util.h; sourceTree = SOURCE_ROOT; };
019931DB110A37FA003B056E /* PreferencesControllerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreferencesControllerBase.h; path = Sources/PreferencesControllerBase.h; sourceTree = "<group>"; };
019931DC110A37FA003B056E /* PreferencesControllerBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PreferencesControllerBase.mm; path = Sources/PreferencesControllerBase.mm; sourceTree = "<group>"; };
01A40F74110550F4002A74CD /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES; sourceTree = "<group>"; };
01B0E80E1108B85A00ACF21B /* ChameleonPrefPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChameleonPrefPane.h; path = Sources/ChameleonPrefPane.h; sourceTree = "<group>"; };
01B0E80F1108B85A00ACF21B /* ChameleonPrefPane.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ChameleonPrefPane.mm; path = Sources/ChameleonPrefPane.mm; sourceTree = "<group>"; };
01993198110A2C61003B056E /* string_util.h */,
01B0E80E1108B85A00ACF21B /* ChameleonPrefPane.h */,
01B0E80F1108B85A00ACF21B /* ChameleonPrefPane.mm */,
019931DB110A37FA003B056E /* PreferencesControllerBase.h */,
019931DC110A37FA003B056E /* PreferencesControllerBase.mm */,
019930DF110A0CB4003B056E /* BootSetupController.h */,
019930E0110A0CB4003B056E /* BootSetupController.mm */,
019930E6110A0D80003B056E /* BootFlagsController.h */,
019930FE110A0E6F003B056E /* PeripheralsController.h in Headers */,
01993115110A0EB9003B056E /* AdvancedSetupController.h in Headers */,
01993199110A2C61003B056E /* string_util.h in Headers */,
019931DD110A37FA003B056E /* PreferencesControllerBase.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
019930E9110A0D80003B056E /* BootFlagsController.mm in Sources */,
019930FF110A0E6F003B056E /* PeripheralsController.mm in Sources */,
01993116110A0EB9003B056E /* AdvancedSetupController.mm in Sources */,
019931DE110A37FA003B056E /* PreferencesControllerBase.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

Archive Download the corresponding diff file

Revision: 43