]> granicus.if.org Git - handbrake/commitdiff
MacGui: when switching from the x264 system to the advanced panel, populate the advan...
authorRodeo <tdskywalker@gmail.com>
Tue, 9 Apr 2013 12:21:38 +0000 (12:21 +0000)
committerRodeo <tdskywalker@gmail.com>
Tue, 9 Apr 2013 12:21:38 +0000 (12:21 +0000)
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

index 51c4be181b185ac4e4d9885803ceb1bf720194c6..10665fb317e57741207e583fddb95beda0d0b720 100644 (file)
@@ -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];