[vlc-devel] [PATCH 03/18] macosx: add apply video profile at startup checkbox

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Tue Jul 4 10:01:02 CEST 2017


---
 modules/gui/macosx/UI/VideoEffects.xib               | 14 +++++++++++++-
 modules/gui/macosx/VLCVideoEffectsWindowController.h |  2 ++
 modules/gui/macosx/VLCVideoEffectsWindowController.m |  7 +++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/UI/VideoEffects.xib b/modules/gui/macosx/UI/VideoEffects.xib
index 1cf02e15f1..639a78b307 100644
--- a/modules/gui/macosx/UI/VideoEffects.xib
+++ b/modules/gui/macosx/UI/VideoEffects.xib
@@ -35,6 +35,7 @@
                 <outlet property="adjustSaturationLabel" destination="22" id="5Aa-ns-JxL"/>
                 <outlet property="adjustSaturationSlider" destination="28" id="rqd-2B-4Iq"/>
                 <outlet property="anaglyphCheckbox" destination="708" id="Ko7-7F-UFt"/>
+                <outlet property="applyProfileCheckbox" destination="ABI-av-fGB" id="I7F-KX-vAa"/>
                 <outlet property="bandingCheckbox" destination="60" id="tjM-u7-Fdm"/>
                 <outlet property="bandingLabel" destination="62" id="cfP-PI-7a7"/>
                 <outlet property="bandingSlider" destination="63" id="MjZ-RS-yOC"/>
@@ -122,7 +123,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES" HUD="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="236" width="642" height="274"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
             <view key="contentView" id="2">
                 <rect key="frame" x="0.0" y="0.0" width="642" height="274"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -1791,6 +1792,17 @@
                             <constraint firstAttribute="height" constant="1" id="La9-tY-5he"/>
                         </constraints>
                     </box>
+                    <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ABI-av-fGB">
+                        <rect key="frame" x="466" y="9" width="158" height="18"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                        <buttonCell key="cell" type="check" title="Apply profile at launch" bezelStyle="regularSquare" imagePosition="left" inset="2" id="8uO-gi-iv5">
+                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                            <font key="font" metaFont="system"/>
+                        </buttonCell>
+                        <connections>
+                            <action selector="applyProfileCheckboxChanged:" target="-1" id="9PJ-xF-qBh"/>
+                        </connections>
+                    </button>
                 </subviews>
                 <constraints>
                     <constraint firstAttribute="bottom" secondItem="3" secondAttribute="bottom" constant="35" id="0Mc-wz-dcA"/>
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.h b/modules/gui/macosx/VLCVideoEffectsWindowController.h
index 114e2d23a2..84f68f2b0c 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.h
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.h
@@ -31,6 +31,7 @@
 /* generic */
 @property (readwrite, weak) IBOutlet NSTabView *tabView;
 @property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup;
+ at property (readwrite, weak) IBOutlet NSButton *applyProfileCheckbox;
 
 /* basic */
 @property (readwrite, weak) IBOutlet NSButton *adjustCheckbox;
@@ -172,6 +173,7 @@
 
 - (void)toggleWindow:(id)sender;
 - (IBAction)profileSelectorAction:(id)sender;
+- (IBAction)applyProfileCheckboxChanged:(id)sender;
 
 /* basic */
 - (IBAction)enableAdjust:(id)sender;
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index b2a274c722..ded3e0c26a 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -77,6 +77,8 @@
     [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")];
     [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")];
 
+    [_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"VideoEffectApplyProfileOnStartup"]];
+
     [self resetProfileSelector];
 
     [_adjustCheckbox setTitle:_NS("Image Adjust")];
@@ -800,6 +802,11 @@
     }];
 }
 
+- (IBAction)applyProfileCheckboxChanged:(id)sender
+{
+    [[NSUserDefaults standardUserDefaults] setBool:[sender state] forKey:@"VideoEffectApplyProfileOnStartup"];
+}
+
 #pragma mark -
 #pragma mark basic
 - (IBAction)enableAdjust:(id)sender
-- 
2.13.1



More information about the vlc-devel mailing list