]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix quality slider granularity prefs when the app is localized.
authorDamiano Galassi <damiog@gmail.com>
Wed, 6 Mar 2019 08:37:35 +0000 (09:37 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 6 Mar 2019 08:37:35 +0000 (09:37 +0100)
macosx/Base.lproj/Preferences.xib
macosx/HBPreferencesController.m
macosx/HBVideoController.m

index ee5f95348d3b8c32f2bd003f413e3e1aac5e03ab..e33aa270b4bf5005ba00f7c1c4d1ea8e8808359f 100644 (file)
                         </popUpButton>
                         <popUpButton toolTip="Determines the granularity of the x264 Constant Quality control. Smaller values allow for finer quality increments." horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="387">
                             <rect key="frame" x="294" y="227" width="60" height="22"/>
-                            <popUpButtonCell key="cell" type="push" title="0.25" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="391" id="388">
+                            <popUpButtonCell key="cell" type="push" title="0.25" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="4" imageScaling="proportionallyDown" inset="2" selectedItem="391" id="388">
                                 <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                                 <font key="font" metaFont="smallSystem"/>
                                 <menu key="menu" title="OtherViews" id="389">
                                     <items>
-                                        <menuItem title="1.0" id="394"/>
-                                        <menuItem title="0.50" id="393"/>
-                                        <menuItem title="0.25" state="on" id="391">
+                                        <menuItem title="1.0" tag="1" id="394"/>
+                                        <menuItem title="0.50" tag="2" id="393"/>
+                                        <menuItem title="0.25" state="on" tag="4" id="391">
                                             <modifierMask key="keyEquivalentModifierMask"/>
                                         </menuItem>
-                                        <menuItem title="0.20" id="390">
+                                        <menuItem title="0.20" tag="5" id="390">
                                             <modifierMask key="keyEquivalentModifierMask"/>
                                         </menuItem>
                                     </items>
                             </popUpButtonCell>
                             <connections>
                                 <accessibilityConnection property="title" destination="395" id="NVF-jL-QpH"/>
-                                <binding destination="61" name="selectedValue" keyPath="values.x264CqSliderFractional" id="397"/>
+                                <binding destination="61" name="selectedTag" keyPath="values.HBx264CqSliderFractional" id="XKV-6r-lP5"/>
                             </connections>
                         </popUpButton>
                         <button toolTip="Use libdvdnav to read DVDs. Only disable this for problematic DVDs where libdvdread works better (rare)." verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="398">
index 4ad5967389640fa41ed49f1f107adcc97dc288c0..840e2248b3468e1ca200bd30230aa7a71e8ed080 100644 (file)
@@ -69,7 +69,7 @@
         @"EncodeLogLocation":               @"NO",
         @"MinTitleScanSeconds":             @"10",
         @"PreviewsNumber":                  @"10",
-        @"x264CqSliderFractional":          @"0.50",
+        @"HBx264CqSliderFractional":        @2,
         @"HBShowAdvancedTab":               @NO,
         @"HBAutoNamingFormat":              @[@"{Source}", @" ", @"{Title}"],
         @"HBQueuePauseIfLowSpace":          @YES,
index e5bc66ad5ad6402b33768d7cde609fcc143e996b..95619247dadc6fb0a98e7e25cb80f7ec3b23a418 100644 (file)
@@ -49,7 +49,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
 
         // Observe the x264 slider granularity, to update the slider when the pref is changed.
         [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
-                                                                  forKeyPath:@"values.x264CqSliderFractional"
+                                                                  forKeyPath:@"values.HBx264CqSliderFractional"
                                                                      options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial
                                                                      context:HBVideoControllerContext];
 
@@ -124,7 +124,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
                 fDisplayX264PresetsUnparseTextField.stringValue = @"";
             }
         }
-        else if ([keyPath isEqualToString:@"values.x264CqSliderFractional"])
+        else if ([keyPath isEqualToString:@"values.HBx264CqSliderFractional"])
         {
             [self setupQualitySlider];
         }
@@ -151,8 +151,8 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
     {
          // Encoders that allow fractional CQ values often have a low granularity
          // which makes the slider hard to use, so use a value from preferences.
-        granularity = [[NSUserDefaults standardUserDefaults]
-                       floatForKey:@"x264CqSliderFractional"];
+        granularity = 1.0f / [[NSUserDefaults standardUserDefaults]
+                       integerForKey:@"HBx264CqSliderFractional"];
     }
     fVidQualitySlider.minValue = minValue;
     fVidQualitySlider.maxValue = maxValue;