[vlc-commits] macOS: Minor VLCHelpWindowController codestyle changes

Marvin Scholz git at videolan.org
Fri Jun 2 17:19:38 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Jun  2 17:08:13 2017 +0200| [8ced37cb1880ed62d88054cbac5c7bb4ac797e3b] | committer: Marvin Scholz

macOS: Minor VLCHelpWindowController codestyle changes

This refactors Hungarian notation to easier to read and understand
variable names and removes some comments that stated obvious things.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8ced37cb1880ed62d88054cbac5c7bb4ac797e3b
---

 modules/gui/macosx/UI/Help.xib               | 23 ++++++++++++-----------
 modules/gui/macosx/VLCHelpWindowController.h | 10 +++++-----
 modules/gui/macosx/VLCHelpWindowController.m | 19 +++++++++----------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/modules/gui/macosx/UI/Help.xib b/modules/gui/macosx/UI/Help.xib
index a9c1870d27..170f7c977d 100644
--- a/modules/gui/macosx/UI/Help.xib
+++ b/modules/gui/macosx/UI/Help.xib
@@ -1,17 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
+        <deployment version="1070" identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
-        <plugIn identifier="com.apple.WebKitIBPlugin" version="10117"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
+        <plugIn identifier="com.apple.WebKitIBPlugin" version="12120"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="VLCHelpWindowController">
             <connections>
-                <outlet property="o_help_bwd_btn" destination="2257" id="2336"/>
-                <outlet property="o_help_fwd_btn" destination="2258" id="2335"/>
-                <outlet property="o_help_home_btn" destination="2256" id="2337"/>
-                <outlet property="o_help_web_view" destination="2241" id="2341"/>
+                <outlet property="backButton" destination="2257" id="c2X-ol-C9I"/>
+                <outlet property="forwardButton" destination="2258" id="iEY-oD-cv3"/>
+                <outlet property="helpWebView" destination="2241" id="cMX-Wb-U2g"/>
+                <outlet property="homeButton" destination="2256" id="sWB-6l-roa"/>
                 <outlet property="window" destination="2239" id="2342"/>
             </connections>
         </customObject>
@@ -21,7 +22,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="336" y="164" width="480" height="400"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
             <value key="minSize" type="size" width="213" height="107"/>
             <view key="contentView" id="2240">
                 <rect key="frame" x="0.0" y="0.0" width="480" height="400"/>
@@ -47,7 +48,7 @@
                         </connections>
                     </button>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2257">
-                        <rect key="frame" x="55" y="8" width="32" height="25"/>
+                        <rect key="frame" x="55" y="8" width="30" height="25"/>
                         <buttonCell key="cell" type="roundTextured" title="←" bezelStyle="texturedRounded" alignment="center" borderStyle="border" inset="2" id="2276">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                             <font key="font" metaFont="systemBold" size="18"/>
@@ -57,7 +58,7 @@
                         </connections>
                     </button>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2258">
-                        <rect key="frame" x="95" y="8" width="32" height="25"/>
+                        <rect key="frame" x="93" y="8" width="30" height="25"/>
                         <buttonCell key="cell" type="roundTextured" title="→" bezelStyle="texturedRounded" alignment="center" borderStyle="border" inset="2" id="2277">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                             <font key="font" metaFont="systemBold" size="18"/>
diff --git a/modules/gui/macosx/VLCHelpWindowController.h b/modules/gui/macosx/VLCHelpWindowController.h
index 02d4d6d45b..965a3ba22a 100644
--- a/modules/gui/macosx/VLCHelpWindowController.h
+++ b/modules/gui/macosx/VLCHelpWindowController.h
@@ -22,14 +22,14 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import <WebKit/WebKit.h> //we need to be here, because we're using a WebView object below
+#import <WebKit/WebKit.h>
 
 @interface VLCHelpWindowController : NSWindowController
 {
-    IBOutlet WebView *o_help_web_view; //we may _not_ use id here because of method name collisions
-    IBOutlet id o_help_bwd_btn;
-    IBOutlet id o_help_fwd_btn;
-    IBOutlet id o_help_home_btn;
+    IBOutlet WebView *helpWebView;
+    IBOutlet id backButton;
+    IBOutlet id forwardButton;
+    IBOutlet id homeButton;
 }
 
 - (IBAction)helpGoHome:(id)sender;
diff --git a/modules/gui/macosx/VLCHelpWindowController.m b/modules/gui/macosx/VLCHelpWindowController.m
index bf78140f22..3bf9fdb989 100644
--- a/modules/gui/macosx/VLCHelpWindowController.m
+++ b/modules/gui/macosx/VLCHelpWindowController.m
@@ -36,7 +36,6 @@
 {
     self = [super initWithWindowNibName:@"Help"];
     if (self) {
-
         [self setWindowFrameAutosaveName:@"help"];
     }
 
@@ -45,10 +44,10 @@
 
 - (void)windowDidLoad
 {
-    [[self window] setTitle: _NS("VLC media player Help")];
-    [o_help_fwd_btn setToolTip: _NS("Next")];
-    [o_help_bwd_btn setToolTip: _NS("Previous")];
-    [o_help_home_btn setToolTip: _NS("Index")];
+    [[self window] setTitle:_NS("VLC media player Help")];
+    [forwardButton setToolTip:_NS("Next")];
+    [backButton setToolTip:_NS("Previous")];
+    [homeButton setToolTip:_NS("Index")];
 }
 
 - (void)showHelp
@@ -59,15 +58,15 @@
 
 - (IBAction)helpGoHome:(id)sender
 {
-    [[o_help_web_view mainFrame] loadHTMLString: _NS(I_LONGHELP)
-                                        baseURL: [NSURL URLWithString:@"http://videolan.org"]];
+    [[helpWebView mainFrame] loadHTMLString:_NS(I_LONGHELP)
+                                    baseURL:[NSURL URLWithString:@"http://videolan.org"]];
 }
 
 - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
 {
-    /* delegate to update button states (we're the frameLoadDelegate for our help's webview)« */
-    [o_help_fwd_btn setEnabled: [o_help_web_view canGoForward]];
-    [o_help_bwd_btn setEnabled: [o_help_web_view canGoBack]];
+    /* Update back/forward button states whenever a new page is loaded */
+    [forwardButton setEnabled:[helpWebView canGoForward]];
+    [backButton setEnabled:[helpWebView canGoBack]];
 }
 
 @end



More information about the vlc-commits mailing list