[vlc-commits] macosx: Fix localization for tab labels in media information panel

David Fuhrmann git at videolan.org
Sun Apr 15 20:51:31 CEST 2018


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Apr 15 20:27:26 2018 +0200| [c0000f08eb278c9f182e013795d4b2be33142ff9] | committer: David Fuhrmann

macosx: Fix localization for tab labels in media information panel

This also fixes hiding of stats tab in case the respective config
option is unset. Previous code raised error logs here.

(cherry picked from commit 5138169acc645428475ed087f526baf4c981149e)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

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

 modules/gui/macosx/UI/MediaInfo.xib  |  4 ++--
 modules/gui/macosx/VLCPlaylistInfo.h |  2 +-
 modules/gui/macosx/VLCPlaylistInfo.m | 11 +++++------
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/UI/MediaInfo.xib b/modules/gui/macosx/UI/MediaInfo.xib
index 4f68b3d507..50a339a2b1 100644
--- a/modules/gui/macosx/UI/MediaInfo.xib
+++ b/modules/gui/macosx/UI/MediaInfo.xib
@@ -52,9 +52,9 @@
                 <outlet property="readBytesLabel" destination="531" id="700"/>
                 <outlet property="readBytesTextField" destination="535" id="701"/>
                 <outlet property="saveMetaDataButton" destination="412" id="671"/>
+                <outlet property="segmentedView" destination="GFW-aJ-Pub" id="K4I-it-NzM"/>
                 <outlet property="seqNumLabel" destination="442" id="672"/>
                 <outlet property="seqNumTextField" destination="441" id="673"/>
-                <outlet property="tabView" destination="418" id="674"/>
                 <outlet property="titleLabel" destination="429" id="675"/>
                 <outlet property="titleTextField" destination="427" id="676"/>
                 <outlet property="uriLabel" destination="510" id="677"/>
@@ -460,7 +460,7 @@
                                             <rect key="frame" x="17" y="0.0" width="510" height="428"/>
                                             <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="jDW-Lc-WE4">
                                                 <rect key="frame" x="0.0" y="0.0" width="510" height="428"/>
-                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                <autoresizingMask key="autoresizingMask"/>
                                                 <subviews>
                                                     <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" indentationPerLevel="16" autoresizesOutlineColumn="YES" outlineTableColumn="521" id="519" customClass="VLCHUDOutlineView">
                                                         <rect key="frame" x="0.0" y="0.0" width="510" height="19"/>
diff --git a/modules/gui/macosx/VLCPlaylistInfo.h b/modules/gui/macosx/VLCPlaylistInfo.h
index 63f7e7792c..7b63fe378d 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.h
+++ b/modules/gui/macosx/VLCPlaylistInfo.h
@@ -32,7 +32,7 @@
 @property (readonly) input_item_t *item;
 
 @property (readwrite, weak) IBOutlet NSOutlineView *outlineView;
- at property (readwrite, weak) IBOutlet NSTabView *tabView;
+ at property (readwrite, weak) IBOutlet NSSegmentedControl *segmentedView;
 
 @property (readwrite, weak) IBOutlet NSTextField *uriLabel;
 @property (readwrite, weak) IBOutlet NSTextField *titleLabel;
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index 541b276301..e46b0f13bd 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -64,10 +64,9 @@
     [_authorLabel setStringValue: _NS("Artist")];
     [_saveMetaDataButton setStringValue: _NS("Save Metadata")];
 
-    [[_tabView tabViewItemAtIndex: 0] setLabel: _NS("General")];
-    [[_tabView tabViewItemAtIndex: 1] setLabel: _NS("Codec Details")];
-    [[_tabView tabViewItemAtIndex: 2] setLabel: _NS("Statistics")];
-    [_tabView selectTabViewItemAtIndex: 0];
+    [_segmentedView setLabel:_NS("General") forSegment:0];
+    [_segmentedView setLabel:_NS("Codec Details") forSegment:1];
+    [_segmentedView setLabel:_NS("Statistics") forSegment:2];
 
     /* constants defined in vlc_meta.h */
     [_genreLabel setStringValue: _NS(VLC_META_GENRE)];
@@ -102,8 +101,8 @@
 
     b_stats = var_InheritBool(getIntf(), "stats");
     if (!b_stats) {
-        if ([_tabView numberOfTabViewItems] > 2)
-            [_tabView removeTabViewItem: [_tabView tabViewItemAtIndex: 2]];
+        if ([_segmentedView segmentCount] >= 3)
+            [_segmentedView setSegmentCount: 2];
     }
     else
         [self initMediaPanelStats];



More information about the vlc-commits mailing list