From 5c1ba114dd3c868c4f9f3a5be5395387acc72692 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Thu, 6 Mar 2008 14:56:32 +0000 Subject: MacGui: Fix issue where renaming a preset does not reflect the new name immediately in the preset drawer - call [fPresetsOutlineView reloadData]; - use "-sortPresets" method instead of sorting it in its own method git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1330 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'macosx/Controller.mm') diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 719acad1b..5ff4fe7d4 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -3298,7 +3298,7 @@ if (item == nil) } /* We use this to edit the name field in the outline view */ -- (void)outlineView:(NSOutlineView *)fPresetsOutlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item +- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { if ([[tableColumn identifier] isEqualToString:@"PresetName"]) { @@ -3306,17 +3306,10 @@ if (item == nil) theRecord = item; [theRecord setObject:object forKey:@"PresetName"]; - /* 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 * presetNameDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"PresetName" - ascending:YES selector:@selector(caseInsensitiveCompare:)] autorelease]; - NSArray *sortDescriptors=[NSArray arrayWithObjects:presetTypeDescriptor,presetNameDescriptor,nil]; - NSArray *sortedArray=[UserPresets sortedArrayUsingDescriptors:sortDescriptors]; - [UserPresets setArray:sortedArray]; - /* We Reload the New Table data for presets */ - //[fPresetsOutlineView reloadData]; + + [self sortPresets]; + + [fPresetsOutlineView reloadData]; /* We save all of the preset data here */ [self savePreset]; } -- cgit v1.2.3