diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.h | 1 | ||||
-rw-r--r-- | macosx/Controller.mm | 45 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/classes.nib | 1 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/info.nib | 5 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/keyedobjects.nib | bin | 99716 -> 100429 bytes |
5 files changed, 44 insertions, 8 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index 4d997df7c..6debbf39c 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -212,6 +212,7 @@ - (void) savePreset; - (IBAction)AddFactoryPresets:(id)sender; +- (IBAction)DeleteFactoryPresets:(id)sender; - (IBAction)AddUserPreset:(id)sender; - (void)AddPreset; - (IBAction)InsertPreset:(id)sender; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index c6232f308..e4314c4e8 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1580,14 +1580,45 @@ the user is using "Custom" settings by determining the sender*/ { [NSApp stopModal]; } - + /* We use this method to recreate new, updated factory + presets */ - (IBAction)AddFactoryPresets:(id)sender { - /* Here we create each shipped preset */ + /* First, we delete any existing built in presets */ + [self DeleteFactoryPresets: sender]; + /* Then, we re-create new built in presets programmatically */ [UserPresets addObject:[self CreateIpodPreset]]; [UserPresets addObject:[self CreateAppleTVPreset]]; [self AddPreset]; } +- (IBAction)DeleteFactoryPresets:(id)sender +{ + //int status; + NSEnumerator *enumerator = [UserPresets objectEnumerator]; + id tempObject; + + //NSNumber *index; + NSMutableArray *tempArray; + + + tempArray = [NSMutableArray array]; + /* we look here to see if the preset is we move on to the next one */ + while ( tempObject = [enumerator nextObject] ) + { + /* if the preset is "Factory" then we put it in the array of + presets to delete */ + if ([[tempObject objectForKey:@"Type"] intValue] == 0) + { + [tempArray addObject:tempObject]; + } + } + + [UserPresets removeObjectsInArray:tempArray]; + [tableView reloadData]; + [self savePreset]; + +} + - (IBAction)AddUserPreset:(id)sender { /* Here we create a custom user preset */ @@ -2022,12 +2053,14 @@ id theRecord, theValue; theRecord = [UserPresets objectAtIndex:rowIndex]; [theRecord setObject:anObject forKey:[aTableColumn identifier]]; - + /* We Sort the Presets By Factory or Custom */ + NSSortDescriptor * presetTypeDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"Type" + ascending:YES] autorelease]; /* We Sort the Presets Alphabetically by name */ - NSSortDescriptor * lastNameDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"PresetName" + NSSortDescriptor * presetNameDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"PresetName" ascending:YES selector:@selector(caseInsensitiveCompare:)] autorelease]; - NSArray *sortDescriptors=[NSArray arrayWithObject:lastNameDescriptor]; - NSArray *sortedArray=[UserPresets sortedArrayUsingDescriptors:sortDescriptors]; + NSArray *sortDescriptors=[NSArray arrayWithObjects:presetTypeDescriptor,presetNameDescriptor,nil]; + NSArray *sortedArray=[UserPresets sortedArrayUsingDescriptors:sortDescriptors]; [UserPresets setArray:sortedArray]; /* We Reload the New Table data for presets */ [tableView reloadData]; diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index 99d4450ad..cc90ca301 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -13,6 +13,7 @@ CloseAddPresetPanel = id; CodecsPopUpChanged = id; CustomSettingUsed = id; + DeleteFactoryPresets = id; DeletePreset = id; EnableQueue = id; EncoderPopUpChanged = id; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index d9bcb81bf..124733839 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -3,13 +3,13 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>160 277 630 601 0 0 1440 878 </string> + <string>21 277 630 601 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>1843</key> <string>610 276 220 592 0 0 1440 878 </string> <key>29</key> - <string>102 834 300 44 0 0 1440 878 </string> + <string>11 834 365 44 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> @@ -23,6 +23,7 @@ <integer>1438</integer> <integer>21</integer> <integer>1867</integer> + <integer>1162</integer> </array> <key>IBSystem Version</key> <string>8P2137</string> diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differindex 2fbc34397..635a131a7 100644 --- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib +++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib |