Index: trunk/ChameleonPrefPane/Sources/property_list.cpp =================================================================== --- trunk/ChameleonPrefPane/Sources/property_list.cpp (revision 18) +++ trunk/ChameleonPrefPane/Sources/property_list.cpp (revision 19) @@ -7,6 +7,7 @@ #include "property_list.h" #include +#include /****************************************************************************/ /** @@ -240,6 +241,8 @@ bool ret = false; if (!path || !*path) return false; + struct stat st; + if(stat(path,&st) != 0) return false; // file does not exist; // give write temporary write rights to the file if (!chmodFile(path,"0777", auth, flags)) return false; Index: trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.h =================================================================== --- trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.h (revision 18) +++ trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.h (revision 19) @@ -35,6 +35,7 @@ NSImage* mUnknownImage; NSImage* mCDROMImage; NSMutableDictionary* mOptionsDict; + NSMutableDictionary* mPartitionsList; NSString* mOptionsPlistPath; int mPreferenceFileVersion; } Index: trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm =================================================================== --- trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm (revision 18) +++ trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm (revision 19) @@ -36,6 +36,7 @@ static const NSString* const keySwapHD01 = @"swapHD01"; static const NSString* const keySwapHD02 = @"swapHD02"; static const NSString* const keyUseFrozenParts = @"useFrozenParts"; +static const NSString* const keyPartitionsList = @"partitionsList"; //-------------------------------------------------------------------------- // Static file variables //-------------------------------------------------------------------------- @@ -119,13 +120,13 @@ [mSwapHD01 setIntValue: [[oldGlobalPreferences objectForKey: keySwapHD01] intValue]]; [mSwapHD02 setIntValue: [[oldGlobalPreferences objectForKey: keySwapHD02] intValue]]; [mFreezeParts setIntValue: [[oldGlobalPreferences objectForKey: keyUseFrozenParts] intValue] ]; + mPartitionsList = [oldGlobalPreferences objectForKey: keyUseFrozenParts]; } else { // Create a preference plist file with Defaults values [mSwapHD01 setIntValue: 0]; [mSwapHD02 setIntValue: 0]; [mFreezeParts setIntValue: 0]; - // Initialize defaults oldGlobalPreferences = [[NSMutableDictionary alloc] init]; [oldGlobalPreferences setObject: [[NSNumber alloc] initWithInt: CurrentPreferencesFileVersion] @@ -133,6 +134,7 @@ [oldGlobalPreferences setObject: [[NSNumber alloc] initWithBool: false] forKey: keySwapHD01]; [oldGlobalPreferences setObject: [[NSNumber alloc] initWithBool: false] forKey: keySwapHD02]; [oldGlobalPreferences setObject:[[NSNumber alloc] initWithBool: false] forKey: keyUseFrozenParts]; + [oldGlobalPreferences setObject: [[NSMutableDictionary alloc] initWithCapacity:64] forKey: keyPartitionsList]; // Save the preferences file [ self savePreferences:oldGlobalPreferences ]; @@ -141,6 +143,7 @@ mOptionsDict = [[NSMutableDictionary alloc] init]; [mOptionsDict addEntriesFromDictionary:oldGlobalPreferences]; [mOptionsDict retain]; + if (mPartitionsList!=nil) [mPartitionsList retain]; [oldGlobalPreferences release]; } @@ -340,6 +343,12 @@ - (IBAction)onInjectPartsToFreeze: (id)sender { // TODO generate the parts list in preferences proplist + NSInteger n = NSRunAlertPanel(@"Inject Partitions to Freeze Configuration", + @"Are you sure you want to overwrite your Freeze settings with current partition list ?", + @"OK", @"Cancel",nil); + if (n==1) + { + } } //-------------------------------------------------------------------------- // following DieBuch recommendation : using applescript and system events (thanks!): @@ -365,7 +374,6 @@ { system("/usr/bin/osascript -e 'tell app \"System Events\" to shut down'"); } - } - (IBAction)onSleep: (id)sender @@ -397,7 +405,8 @@ //-------------------------------------------------------------------------- - (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView { - return partExtractor ? partExtractor->partList().size() : 0; + int size = partExtractor ? partExtractor->partList().size() : 0; + return size; } //-------------------------------------------------------------------------- Index: trunk/ChameleonPrefPane/English.lproj/Chameleon.xib =================================================================== --- trunk/ChameleonPrefPane/English.lproj/Chameleon.xib (revision 18) +++ trunk/ChameleonPrefPane/English.lproj/Chameleon.xib (revision 19) @@ -12,7 +12,7 @@ YES - + YES @@ -72,7 +72,7 @@ 1 - + 256 YES @@ -724,6 +724,7 @@ {{10, 33}, {663, 263}} + Select Boot Partition @@ -732,7 +733,7 @@ 2 - + 256 YES @@ -876,21 +877,20 @@ {{10, 33}, {663, 263}} - Settings - + 0 YES YES YES - +