From 4b3169b04dbc66e41af3ae8c38cf7b986215b610 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Thu, 6 Mar 2008 13:57:37 +0000 Subject: MacGui: move the presets sorting into a new method "-sortPresets" so it can be done independently of adding a preset in preparation for drag and drop preset arranging capability. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1329 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.h | 1 + macosx/Controller.mm | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/macosx/Controller.h b/macosx/Controller.h index 4994e8149..22ce107ae 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -309,6 +309,7 @@ - (IBAction)setDefaultPreset:(id)sender; - (IBAction)selectDefaultPreset:(id)sender; - (void) savePreset; +- (void)sortPresets; - (IBAction)addFactoryPresets:(id)sender; - (IBAction)deleteFactoryPresets:(id)sender; - (IBAction)addUserPreset:(id)sender; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index a64afe76d..719acad1b 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -3737,6 +3737,16 @@ if (item == nil) - (void)addPreset { + [self sortPresets]; + /* We Reload the New Table data for presets */ + [fPresetsOutlineView reloadData]; + /* We save all of the preset data here */ + [self savePreset]; +} + +- (void)sortPresets +{ + /* We Sort the Presets By Factory or Custom */ NSSortDescriptor * presetTypeDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"Type" @@ -3748,11 +3758,7 @@ if (item == nil) NSArray *sortedArray=[UserPresets sortedArrayUsingDescriptors:sortDescriptors]; [UserPresets setArray:sortedArray]; - - /* We Reload the New Table data for presets */ - [fPresetsOutlineView reloadData]; - /* We save all of the preset data here */ - [self savePreset]; + } - (IBAction)insertPreset:(id)sender -- cgit v1.2.3