Chameleon Applications

Chameleon Applications Commit Details

Date:2011-12-11 00:14:08 (5 years 10 months ago)
Author:Rekursor
Commit:458
Parents: 457
Message:Fixed volumes with no name handling
Changes:
M/trunk/ChameleonPrefPane/Sources/smbios/smbios.h
M/trunk/ChameleonPrefPane/bin/OSX106/Chameleon.zip
M/trunk/ChameleonPrefPane/Sources/PartitionInfoElement.h
M/trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
M/trunk/ChameleonPrefPane/Sources/PartitionInfoElement.mm
M/trunk/ChameleonPrefPane/bin/version
M/trunk/ChameleonPrefPane/test_util/test_util.mm

File differences

trunk/ChameleonPrefPane/Sources/smbios/smbios.h
119119
120120
121121
122
123
124
122125
123126
124127
SMBString releaseDate; // BIOS release date
SMBByte romSize; // (n); 64K * (n+1) bytes
SMBQWord characteristics; // supported BIOS functions
SMBWord charExtBytes; // supported BIOS functions
SMBByte smbiosMajorVer; // supported BIOS functions
SMBByte smbiosMinorVer; // supported BIOS functions
} __attribute__((packed)) SMBBIOSInformation;
//
trunk/ChameleonPrefPane/Sources/PartitionInfoElement.h
99
1010
1111
12
12
1313
1414
1515
......
2525
2626
2727
28
2829
2930
3031
@interface PartitionInfoElement : NSObject {
NSString* bsdName;
NSString*vUUID, *vName, *vKind, *mediaPath, *devProtocol;
NSString*vUUID, *vName, *vPath, *vKind, *mediaPath, *devProtocol;
booldevInternal, mediaRemovable;
NSDictionary*descDict;
@property (retain) NSString* vUUID;
@property (retain) NSString* vKind;
@property (retain) NSString* vName;
@property (retain) NSString* vPath;
@property (retain) NSString* mediaPath;
@property (retain) NSString* devProtocol;
trunk/ChameleonPrefPane/Sources/PreferencesControllerBase.h
3636
3737
3838
39
39
4040
4141
4242
4343
44
44
4545
4646
47
47
4848
4949
50
50
5151
5252
5353
54
54
5555
5656
57
57
5858
5959
60
61
60
61
6262
6363
64
64
6565
6666
6767
68
68
6969
70
70
7171
7272
7373
// ENHANCE ME: remove this globals and integrate them in ChameleonPrefPane or at least
// add function accessor entry points
// Define common expected behavior for all derived controllers
/// Define common expected behavior for all derived controllers
@interface PreferencesControllerBase : NSObject
{
}
// Register the Group panel for further automatic iteration matters
/// Register the Group panel for further automatic iteration matters
+ (void) registerPreferencesGroup:(id) myGroup;
// Iterate and execute action for each register group
/// Iterate and execute action for each register group
+ (void) doForEachGroup: (GroupAction) action withOption:(id) option;
// Set refresh state {enabled | disabled} depending on the authorizations state
/// Set refresh state {enabled | disabled} depending on the authorizations state
+ (void) refreshBodLockState: (const BootOptionDesc*) bod;
+ (void) refreshLockState: (id) item;
// Unitary Method for Load One option of any type
/// Unitary Method for Load One option of any type
+ (void) loadOptionsFromBootFile;
// Method for loading all registred options components in the interface
/// Method for loading all registred options components in the interface
+ (void) loadOptionFromBootFile:(id) optionID;
// Get the resource in the pref pane, needed because the bundle get resource api wont work
// as it would return the SystemPreferences application resource
/// Get the resource in the pref pane, needed because the bundle get resource api wont work
/// as it would return the SystemPreferences application resource
- (id) getResourcePath: (NSString *) str ofType: (NSString*) sType;
// Execute a task and wait for the process to terminate
/// Execute a task and wait for the process to terminate
- (bool) executeTaskAndWaitForTermination: (NSString*)taskPath;
- (bool) executeTaskAndWaitForTermination: (NSString*)taskPath withArgs:(NSArray*) args;
// Open a file selection modal dialog
/// Open a file selection modal dialog
- (NSString*) selectFileWithFileTypes:(NSString*) dir withName: (NSString*) name withTypes:(NSArray*) fileTypes;
// Open a file selection modal dialog with a plist predefined type
/// Open a file selection modal dialog with a plist predefined type
- (NSString*) selectAnyFile;
- (NSString*) selectPlistFile:(NSString*)name;
-(NSString*) selectDirectory:(NSString*) dirName;
trunk/ChameleonPrefPane/Sources/PartitionInfoElement.mm
1414
1515
1616
17
17
1818
1919
2020
......
154154
155155
156156
157
158
159
157160
158161
159162
......
209212
210213
211214
215
216
217
218
219
220
221
222
212223
213224
214
215
216
217
218
219
225
226
227
228
229
230
220231
221232
222233
......
254265
255266
256267
257
268
258269
259270
260271
261272
262
273
263274
264275
265276
@implementation PartitionInfoElement
@synthesize descDict, bsdName, vUUID, vKind, vName, mediaPath, mediaRemovable, devInternal, devProtocol;
@synthesize descDict, bsdName, vUUID, vKind, vName, vPath, mediaPath, mediaRemovable, devInternal, devProtocol;
@synthesize vAliasName, hidden;
/// Create a list of all bsd partitions
self.vUUID = [self stringValueWithKey: @"DAVolumeUUID"];
self.vName = [self stringValueWithKey: @"DAVolumeName"];
self.vPath = [self stringValueWithKey: @"DAVolumePath"];
if (self.vName == nil || [vName length]==0)
self.vName = [self.vPath lastPathComponent ];
self.vAliasName = self.vName; // by default renamed = original part name
self.vKind = [self stringValueWithKey: @"DAVolumeKind"];
self.mediaPath = [self stringValueWithKey: @"DAMediaPath"];
bool bootable = false;
NSFileManager* mgr = [NSFileManager defaultManager];
NSString *fmt = @"/Volumes/%@%s";
NSRange r = [vPath rangeOfString:@"file://localhost/Volumes/"];
NSString * vol = [NSString stringWithFormat: @"%@/",vName];
//
if (r.location != NSNotFound) {
vol = [[vPath substringFromIndex:r.location+r.length] stringByReplacingOccurrencesOfString:@"%20" withString:@" "];
}
// that Windows is the name of WIN32 bootable disk dir ...
if(
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/System/Library/Extensions" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/ntldr" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/bootmgr" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/boot/bcd" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/pagefile.sys" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vName, "/hiberfil.sys" ]]
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "System/Library/Extensions" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "ntldr" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "bootmgr" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "boot/bcd" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "pagefile.sys" ]] ||
[mgr fileExistsAtPath: [NSString stringWithFormat: fmt, vol, "hiberfil.sys" ]]
)
bootable=true;
else if ([vName rangeOfString:@"ext"].location != NSNotFound) // linux ?
@"(\n"
" bsdName %@\n deviceProtocol %@\n deviceInternal %i\n"
" volumeName %@\n volumeKind %@\n volumeUUID %@\n"
" mediaPath %@\n mediaRemovable %i\n"
" volumePath %@\n mediaPath %@\n mediaRemovable %i\n"
")";
NSString* value = [NSString stringWithFormat: format,
self.bsdName, self.devProtocol, self.devInternal,
self.vName, self.vKind, self.vUUID,
self.mediaPath, self.mediaRemovable ];
self.vPath, self.mediaPath, self.mediaRemovable ];
return value;
}
trunk/ChameleonPrefPane/bin/version
1
1
Revision: 456
Revision: 457
trunk/ChameleonPrefPane/test_util/test_util.mm
2121
2222
2323
24
24
2525
2626
2727
28
2829
2930
3031
if ([di isValid] && [di.vUUID length] >0)
{
#if 0
#if 1
NSLog(@"bsdName %@", [di bsdName] );
NSLog(@"deviceProtocol %@", [ di devProtocol] );
NSLog(@"volumeName %@", [di vName]);
NSLog(@"volumePath %@", [di vPath]);
NSLog(@"volumeKind %@", [di vKind]);
NSLog(@"deviceInternal %i", (int) [ di devInternal] );
NSLog(@"volumeUUID %@", [di vUUID]);

Archive Download the corresponding diff file

Revision: 458