From f520603c7f0eefd5961b83d52d1fe3f9bf6eee21 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Tue, 9 Apr 2013 12:21:38 +0000 Subject: MacGui: when switching from the x264 system to the advanced panel, populate the advanced panel's options string with the unparsed x264 system options. Also, don't reset the x264 system widgets, so that the x264 system settings are not lost when switching back. When loading a preset whic uses the advanced panel, do reset the x264 system widgets, however. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5388 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.m | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'macosx/Controller.m') diff --git a/macosx/Controller.m b/macosx/Controller.m index 51c4be181..10665fb31 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -5428,15 +5428,16 @@ the user is using "Custom" settings by determining the sender*/ { // using advanced panel, enable if applicable [fAdvancedOptions enableUI:enable]; - // TODO: set the advanced options string based on the previously - // selected x264 system setting - // reset x264 system widgets - [fX264PresetsSlider setIntegerValue: fX264MediumPresetIndex]; - [fX264TunePopUp selectItemAtIndex:0]; - [fX264FastDecodeCheck setState:NSOffState]; - [fDisplayX264PresetsAdditonalOptionsTextField setStringValue:@""]; - [fX264ProfilePopUp selectItemAtIndex:0]; - [fX264LevelPopUp selectItemAtIndex:0]; + // set the advanced options string based on the previously selected + // x264 system setting + if (fX264PresetsUnparsedUTF8String != NULL) + { + [fAdvancedOptions setOptions:[NSString stringWithUTF8String:fX264PresetsUnparsedUTF8String]]; + } + else + { + [fAdvancedOptions setOptions:@""]; + } } // update and/or populate the widgets @@ -6354,13 +6355,18 @@ return YES; if ([chosenPreset objectForKey:@"x264Option"]) { /* we set the advanced opt string here if applicable */ - [fAdvancedOptions setOptions: - [chosenPreset objectForKey:@"x264Option"]]; + [fAdvancedOptions setOptions: [chosenPreset objectForKey:@"x264Option"]]; } else { [fAdvancedOptions setOptions:@""]; } + /* preset does not use the x264 system, reset the widgets */ + [self setX264Preset: nil]; + [self setX264Tune: nil]; + [self setX264OptionExtra: nil]; + [self setH264Profile: nil]; + [self setH264Level: nil]; /* we enable the advanced panel and update the widgets */ [fx264UseAdvancedOptionsCheck setState: NSOnState]; [self updateX264Widgets:nil]; -- cgit v1.2.3