Index: trunk/ChameleonPrefPane/Sources/PartitionInfoManager.mm =================================================================== --- trunk/ChameleonPrefPane/Sources/PartitionInfoManager.mm (revision 353) +++ trunk/ChameleonPrefPane/Sources/PartitionInfoManager.mm (revision 354) @@ -220,5 +220,42 @@ } ++(NSString*) getRenameStringFrom:(NSString*) currentStr andPartition: (PartitionInfoElement*) partInfo +{ + if (partInfo != nil && currentStr!=nil) + { + NSMutableString* ms = [[NSMutableString alloc ] initWithCapacity: 512]; + + NSArray* sPairs = + [currentStr componentsSeparatedByCharactersInSet: + [NSCharacterSet characterSetWithCharactersInString: @";"] ]; + + if ([sPairs count] > 0 ) + { + + for (NSString* s in sPairs) + { + if ( s==nil || [s length] == 0) continue; + if ( [ s rangeOfString:[partInfo hdString]].location == NSNotFound ) + { + if ([ms length] > 0) [ ms appendString:@";" ]; + [ms appendString: [NSString stringWithFormat:@"%@",s ]]; + } + } + + } + // now filter the case where name eauls alias -> no rename anymore + if ( ![[partInfo vName] isEqual: [partInfo vAliasName]]) + { + if ([ms length] > 0) [ ms appendString:@";" ]; + [ms appendString: [NSString stringWithFormat:@"%@ \"%@\"" , + [partInfo hdString], [partInfo vAliasName] ]]; + } + return ms; + } + + return nil; +} + @end Index: trunk/ChameleonPrefPane/Sources/PartitionInfoManager.h =================================================================== --- trunk/ChameleonPrefPane/Sources/PartitionInfoManager.h (revision 353) +++ trunk/ChameleonPrefPane/Sources/PartitionInfoManager.h (revision 354) @@ -32,4 +32,7 @@ +(void)resetSwapping; +(void)swapHD:(NSUInteger) src with:(NSUInteger) dst; ++(NSString*) getRenameStringFrom:(NSString*) currentStr andPartition: (PartitionInfoElement*) partInfo; + + @end Index: trunk/ChameleonPrefPane/Sources/TableViewsController.mm =================================================================== --- trunk/ChameleonPrefPane/Sources/TableViewsController.mm (revision 353) +++ trunk/ChameleonPrefPane/Sources/TableViewsController.mm (revision 354) @@ -206,10 +206,29 @@ { if (object == nil) return; PartitionInfoElement* partInfo = [PartsInfoMgr objectAtIndex:row]; + if (tableColumn == mHideOrViewColumn) { [partInfo setHidden: ([object intValue] ? false : true) ]; } + else if (tableColumn == mPartitionNameColumn) + { + [partInfo setVAliasName: (object==nil || [object length] == 0) ? [partInfo vName] : object]; + const char * sCur = BootProp::instance().getStringForKey(kRenamePartition); + NSString * currentStr = [NSString stringWithUTF8String: sCur ? sCur : ""] ; + NSString* renStr = [PartsInfoMgr getRenameStringFrom:(NSString*) currentStr + andPartition: (PartitionInfoElement*) partInfo]; + if (renStr!=nil && + BootProp::instance().setStringForKey(kRenamePartition, [renStr UTF8String]) + ) + { + AuthorizationRef auth= [TableViewsController authorization]; + BootProp::instance().save(auth); + [ PreferencesControllerBase loadOptionsFromBootFile]; + } + + } + [partInfo release]; NSLog(@"object at column %@ row %d Set %@", [[tableColumn headerCell] stringValue], row, object); Index: trunk/ChameleonPrefPane/Sources/BootSetupController.mm =================================================================== --- trunk/ChameleonPrefPane/Sources/BootSetupController.mm (revision 353) +++ trunk/ChameleonPrefPane/Sources/BootSetupController.mm (revision 354) @@ -362,7 +362,8 @@ if (result) { [self msgBoxInfo: - [NSString stringWithFormat:@"Boot cd creator script successfully executed. BootCD.iso created in %@.", destination]]; + [NSString stringWithFormat:@"Boot cd creator script successfully executed. BootCD.iso created in %@.", + destination]]; } else [self msgBoxError:@"ERROR: Couldn't execute boot cd creator script successfully!"]; Index: trunk/ChameleonPrefPane/test_util/test_util.mm =================================================================== --- trunk/ChameleonPrefPane/test_util/test_util.mm (revision 353) +++ trunk/ChameleonPrefPane/test_util/test_util.mm (revision 354) @@ -53,11 +53,13 @@ NSLog(@"List of existing bsd disk partitions:\n %@", arr); for (PartitionInfoElement* part in [PartsInfoMgr parts]) NSLog(@"PartionBootable = %i\n%@", (int) [part isBootable], part); +/* [PartsInfoMgr hideParts: @"\"Macintosh HD\" hd(0,3)"]; [PartsInfoMgr hideParts: @"disk0s2 hd(0,2) "]; [PartsInfoMgr hideParts: @"BOOTCAMP \"Macintosh HD\""]; [PartsInfoMgr hideParts: @"3E9C6A92-3737-4C0F-9003-20B2482D61FB"]; - [PartsInfoMgr renameParts: @"hd(0,2) \"John Doe\""]; +*/ + [PartsInfoMgr renameParts: @"hd(0,2) \"Test\""]; [PartsInfoMgr renameParts: @"hd(0,3) Fantastic"]; [PartsInfoMgr renameParts: @"hd(0,4) \"A BC\"; hd(0,2) DEF"];