[vlc-commits] macosx: iterate on media source UI

Felix Paul Kühne git at videolan.org
Sun Jun 30 13:26:39 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Jun 30 09:59:30 2019 +0200| [1daec27bd354c944b6f34aee1e5ad295f42057d5] | committer: Felix Paul Kühne

macosx: iterate on media source UI

Add button and path control UI elements, minor refactoring

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

 .../package/macosx/VLC.xcodeproj/project.pbxproj   | 12 +--
 modules/gui/macosx/Makefile.am                     |  4 +-
 modules/gui/macosx/UI/VLCLibraryWindow.xib         | 92 +++++++++++++++-------
 modules/gui/macosx/library/VLCLibraryWindow.h      |  4 +-
 modules/gui/macosx/library/VLCLibraryWindow.m      | 32 ++++----
 ...DataSource.h => VLCMediaSourceBaseDataSource.h} | 11 +--
 ...DataSource.m => VLCMediaSourceBaseDataSource.m} |  8 +-
 po/POTFILES.in                                     |  4 +-
 8 files changed, 102 insertions(+), 65 deletions(-)

diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index e2aef9ee67..36168f2fcc 100644
--- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
@@ -172,7 +172,7 @@
 		7DFBDCBB226CED6300B700A5 /* VLCMediaSourceProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCBA226CED6300B700A5 /* VLCMediaSourceProvider.m */; };
 		7DFBDCBE226CED7200B700A5 /* VLCMediaSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */; };
 		7DFBDCC1226DC16200B700A5 /* VLCInputItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCC0226DC16200B700A5 /* VLCInputItem.m */; };
-		7DFBDCC4226E445500B700A5 /* VLCMediaSourceDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCC3226E445500B700A5 /* VLCMediaSourceDataSource.m */; };
+		7DFBDCC4226E445500B700A5 /* VLCMediaSourceBaseDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCC3226E445500B700A5 /* VLCMediaSourceBaseDataSource.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -590,8 +590,8 @@
 		7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMediaSource.m; sourceTree = "<group>"; };
 		7DFBDCBF226DC16200B700A5 /* VLCInputItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCInputItem.h; sourceTree = "<group>"; };
 		7DFBDCC0226DC16200B700A5 /* VLCInputItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCInputItem.m; sourceTree = "<group>"; };
-		7DFBDCC2226E445500B700A5 /* VLCMediaSourceDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMediaSourceDataSource.h; sourceTree = "<group>"; };
-		7DFBDCC3226E445500B700A5 /* VLCMediaSourceDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMediaSourceDataSource.m; sourceTree = "<group>"; };
+		7DFBDCC2226E445500B700A5 /* VLCMediaSourceBaseDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMediaSourceBaseDataSource.h; sourceTree = "<group>"; };
+		7DFBDCC3226E445500B700A5 /* VLCMediaSourceBaseDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMediaSourceBaseDataSource.m; sourceTree = "<group>"; };
 		8E49720006417F6800370C9F /* VLCInformationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCInformationWindowController.h; sourceTree = "<group>"; };
 		8E49720106417F6800370C9F /* VLCInformationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCInformationWindowController.m; sourceTree = "<group>"; };
 		8E55FB7F0459B0FD00FB3317 /* VLCOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCOutput.h; sourceTree = "<group>"; };
@@ -1416,8 +1416,8 @@
 				7DFBDCBA226CED6300B700A5 /* VLCMediaSourceProvider.m */,
 				7DFBDCBC226CED7200B700A5 /* VLCMediaSource.h */,
 				7DFBDCBD226CED7200B700A5 /* VLCMediaSource.m */,
-				7DFBDCC2226E445500B700A5 /* VLCMediaSourceDataSource.h */,
-				7DFBDCC3226E445500B700A5 /* VLCMediaSourceDataSource.m */,
+				7DFBDCC2226E445500B700A5 /* VLCMediaSourceBaseDataSource.h */,
+				7DFBDCC3226E445500B700A5 /* VLCMediaSourceBaseDataSource.m */,
 				7DF14FBA2270CB1C0008ABE4 /* VLCMediaSourceCollectionViewItem.h */,
 				7DF14FBB2270CB1C0008ABE4 /* VLCMediaSourceCollectionViewItem.m */,
 			);
@@ -1759,7 +1759,7 @@
 				1C3113D71E508C6900D4DD76 /* VLCPopupPanelController.m in Sources */,
 				7D445D8B22032B9200263D34 /* VLCPlaylistTableView.m in Sources */,
 				1C3113D91E508C6900D4DD76 /* VLCSimplePrefsController.m in Sources */,
-				7DFBDCC4226E445500B700A5 /* VLCMediaSourceDataSource.m in Sources */,
+				7DFBDCC4226E445500B700A5 /* VLCMediaSourceBaseDataSource.m in Sources */,
 				6B2EFC601F2819F700F3C0EA /* VLCVolumeSlider.m in Sources */,
 				7DE2F0472282D5D10040DD0A /* VLCLibraryTableCellView.m in Sources */,
 				7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */,
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 13931cbf69..928d918f0c 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -89,10 +89,10 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/main/macosx.m \
 	gui/macosx/media-source/VLCMediaSource.h \
 	gui/macosx/media-source/VLCMediaSource.m \
+	gui/macosx/media-source/VLCMediaSourceBaseDataSource.h \
+	gui/macosx/media-source/VLCMediaSourceBaseDataSource.m \
 	gui/macosx/media-source/VLCMediaSourceCollectionViewItem.h \
 	gui/macosx/media-source/VLCMediaSourceCollectionViewItem.m \
-	gui/macosx/media-source/VLCMediaSourceDataSource.h \
-	gui/macosx/media-source/VLCMediaSourceDataSource.m \
 	gui/macosx/media-source/VLCMediaSourceProvider.h \
 	gui/macosx/media-source/VLCMediaSourceProvider.m \
 	gui/macosx/menus/VLCMainMenu.h \
diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index cc505f6055..4038c3508c 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -23,7 +23,7 @@
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W1M-0o-qYG">
-                        <rect key="frame" x="212" y="333" width="56" height="23"/>
+                        <rect key="frame" x="211.5" y="333" width="57" height="23"/>
                         <segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedRounded" trackingMode="selectOne" id="Twg-gp-8ng">
                             <font key="font" metaFont="system"/>
                             <segments>
@@ -523,7 +523,8 @@
                 <outlet property="libraryTargetView" destination="iSp-bV-w6B" id="a94-ux-wUc"/>
                 <outlet property="mainSplitView" destination="u8g-jy-S4e" id="lI5-wR-kef"/>
                 <outlet property="mediaSourceCollectionView" destination="r7v-GI-W1U" id="3JJ-GU-o5o"/>
-                <outlet property="mediaSourceScrollView" destination="cFG-c9-cI9" id="gRO-Y7-kdb"/>
+                <outlet property="mediaSourcePathControl" destination="Rjk-Q6-FYy" id="G63-NM-Ekn"/>
+                <outlet property="mediaSourceView" destination="eHd-Q9-F8D" id="gfU-Jp-eFr"/>
                 <outlet property="openMediaButton" destination="SWh-4E-Qtf" id="sIZ-xo-GLA"/>
                 <outlet property="playlistCounterTextField" destination="mbV-My-cm7" id="ZYU-Jq-Z8R"/>
                 <outlet property="playlistDragDropView" destination="VFI-oW-dMZ" id="gVc-mu-f8T"/>
@@ -637,32 +638,6 @@
             </customSpacing>
             <point key="canvasLocation" x="585" y="10"/>
         </stackView>
-        <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="cFG-c9-cI9">
-            <rect key="frame" x="0.0" y="0.0" width="242" height="291"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-            <clipView key="contentView" id="tI4-x3-55j">
-                <rect key="frame" x="0.0" y="0.0" width="242" height="291"/>
-                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                <subviews>
-                    <collectionView id="r7v-GI-W1U">
-                        <rect key="frame" x="0.0" y="0.0" width="242" height="291"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
-                        <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="v0C-1b-7Ss">
-                            <size key="itemSize" width="210" height="150"/>
-                        </collectionViewFlowLayout>
-                        <color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
-                    </collectionView>
-                </subviews>
-            </clipView>
-            <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="WUt-1y-tQd">
-                <rect key="frame" x="-100" y="-100" width="240" height="16"/>
-                <autoresizingMask key="autoresizingMask"/>
-            </scroller>
-            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="247-FY-ZXk">
-                <rect key="frame" x="226" y="0.0" width="16" height="291"/>
-                <autoresizingMask key="autoresizingMask"/>
-            </scroller>
-        </scrollView>
         <splitView dividerStyle="thin" vertical="YES" id="llh-BF-BEJ">
             <rect key="frame" x="0.0" y="0.0" width="508" height="327"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
@@ -893,8 +868,69 @@
             </constraints>
             <point key="canvasLocation" x="247" y="771"/>
         </customView>
+        <customView id="eHd-Q9-F8D">
+            <rect key="frame" x="0.0" y="0.0" width="528" height="307"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cFG-c9-cI9">
+                    <rect key="frame" x="0.0" y="0.0" width="528" height="267"/>
+                    <clipView key="contentView" id="tI4-x3-55j">
+                        <rect key="frame" x="0.0" y="0.0" width="528" height="267"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <collectionView id="r7v-GI-W1U">
+                                <rect key="frame" x="0.0" y="0.0" width="528" height="267"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="v0C-1b-7Ss">
+                                    <size key="itemSize" width="210" height="150"/>
+                                </collectionViewFlowLayout>
+                                <color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </collectionView>
+                        </subviews>
+                    </clipView>
+                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="WUt-1y-tQd">
+                        <rect key="frame" x="-100" y="-100" width="240" height="16"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="247-FY-ZXk">
+                        <rect key="frame" x="441" y="0.0" width="16" height="267"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                </scrollView>
+                <pathControl verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rjk-Q6-FYy">
+                    <rect key="frame" x="46" y="277" width="472" height="20"/>
+                    <pathCell key="cell" controlSize="small" selectable="YES" editable="YES" alignment="left" id="kIb-Jz-eus">
+                        <font key="font" metaFont="smallSystem"/>
+                        <url key="url" string="file://localhost/Applications/"/>
+                    </pathCell>
+                </pathControl>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jfA-Vr-sQc">
+                    <rect key="frame" x="5" y="272" width="36" height="27"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="26" id="bRL-Fs-cKa"/>
+                    </constraints>
+                    <buttonCell key="cell" type="push" bezelStyle="rounded" image="NSHomeTemplate" imagePosition="only" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OHf-j4-3In">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="smallSystem"/>
+                    </buttonCell>
+                </button>
+            </subviews>
+            <constraints>
+                <constraint firstItem="Rjk-Q6-FYy" firstAttribute="leading" secondItem="jfA-Vr-sQc" secondAttribute="trailing" constant="10" id="1OY-9N-uuV"/>
+                <constraint firstAttribute="bottom" secondItem="cFG-c9-cI9" secondAttribute="bottom" id="DjO-Ru-7sa"/>
+                <constraint firstItem="cFG-c9-cI9" firstAttribute="top" secondItem="Rjk-Q6-FYy" secondAttribute="bottom" constant="10" id="Lji-yk-wiI"/>
+                <constraint firstItem="Rjk-Q6-FYy" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" constant="10" id="Sf6-jz-ool"/>
+                <constraint firstItem="jfA-Vr-sQc" firstAttribute="centerY" secondItem="Rjk-Q6-FYy" secondAttribute="centerY" id="aFD-99-R3a"/>
+                <constraint firstAttribute="trailing" secondItem="Rjk-Q6-FYy" secondAttribute="trailing" constant="10" id="c3j-mQ-afF"/>
+                <constraint firstItem="jfA-Vr-sQc" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" constant="10" id="saP-eI-VDF"/>
+                <constraint firstAttribute="trailing" secondItem="cFG-c9-cI9" secondAttribute="trailing" id="vkQ-o0-jz4"/>
+                <constraint firstItem="cFG-c9-cI9" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" id="vq6-rW-p6Q"/>
+            </constraints>
+            <point key="canvasLocation" x="144" y="161.5"/>
+        </customView>
     </objects>
     <resources>
+        <image name="NSHomeTemplate" width="14" height="14"/>
         <image name="NSIconViewTemplate" width="14" height="10"/>
         <image name="NSLeftFacingTriangleTemplate" width="9" height="12"/>
         <image name="NSListViewTemplate" width="14" height="10"/>
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h b/modules/gui/macosx/library/VLCLibraryWindow.h
index e74163cc68..64938d24e0 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.h
+++ b/modules/gui/macosx/library/VLCLibraryWindow.h
@@ -46,7 +46,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, weak) IBOutlet NSTableView *audioCategorySelectionTableView;
 @property (readwrite, weak) IBOutlet NSTableView *audioCollectionSelectionTableView;
 @property (readwrite, weak) IBOutlet NSTableView *audioGroupSelectionTableView;
- at property (readwrite, weak) IBOutlet NSScrollView *mediaSourceScrollView;
+ at property (readwrite, weak) IBOutlet NSView *mediaSourceView;
+ at property (readwrite, weak) IBOutlet NSButton *mediaSourceHomeButton;
+ at property (readwrite, weak) IBOutlet NSPathControl *mediaSourcePathControl;
 @property (readwrite, weak) IBOutlet NSView *libraryTargetView;
 @property (readwrite, weak) IBOutlet NSTableView *playlistTableView;
 @property (readwrite, weak) IBOutlet NSTextField *upNextLabel;
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m
index c5d6bbe17b..8efa886956 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -42,7 +42,7 @@
 #import "library/VLCLibrarySortingMenuController.h"
 
 #import "media-source/VLCMediaSourceCollectionViewItem.h"
-#import "media-source/VLCMediaSourceDataSource.h"
+#import "media-source/VLCMediaSourceBaseDataSource.h"
 
 #import "views/VLCDragDropView.h"
 #import "views/VLCRoundedCornerTextField.h"
@@ -72,7 +72,7 @@ const CGFloat VLCLibraryWindowDefaultPlaylistWidth = 340.;
     VLCLibraryAudioDataSource *_libraryAudioDataSource;
     VLCLibraryGroupDataSource *_libraryAudioGroupDataSource;
     VLCLibrarySortingMenuController *_librarySortingMenuController;
-    VLCMediaSourceDataSource *_mediaSourceDataSource;
+    VLCMediaSourceBaseDataSource *_mediaSourceDataSource;
     VLCLibraryAlternativeAudioViewController *_alternativeAudioViewController;
     VLCPlaylistSortingMenuController *_playlistSortingMenuController;
 
@@ -236,8 +236,10 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     _audioGroupSelectionTableView.delegate = _libraryAudioGroupDataSource;
     _audioGroupSelectionTableView.rowHeight = 450.;
 
-    _mediaSourceDataSource = [[VLCMediaSourceDataSource alloc] init];
+    _mediaSourceDataSource = [[VLCMediaSourceBaseDataSource alloc] init];
     _mediaSourceDataSource.collectionView = _mediaSourceCollectionView;
+    _mediaSourceDataSource.homeButton = _mediaSourceHomeButton;
+    _mediaSourceDataSource.pathControl = _mediaSourcePathControl;
     _mediaSourceCollectionView.dataSource = _mediaSourceDataSource;
     _mediaSourceCollectionView.delegate = _mediaSourceDataSource;
     [_mediaSourceCollectionView registerClass:[VLCMediaSourceCollectionViewItem class] forItemWithIdentifier:VLCMediaSourceCellIdentifier];
@@ -361,8 +363,8 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
 {
     switch (_segmentedTitleControl.selectedSegment) {
         case 0:
-            if (_mediaSourceScrollView.superview != nil) {
-                [_mediaSourceScrollView removeFromSuperview];
+            if (_mediaSourceView.superview != nil) {
+                [_mediaSourceView removeFromSuperview];
             }
             if (_audioLibrarySplitView.superview != nil) {
                 [_audioLibrarySplitView removeFromSuperview];
@@ -382,8 +384,8 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
             break;
 
         case 1:
-            if (_mediaSourceScrollView.superview != nil) {
-                [_mediaSourceScrollView removeFromSuperview];
+            if (_mediaSourceView.superview != nil) {
+                [_mediaSourceView removeFromSuperview];
             }
             if (_videoLibraryStackView.superview != nil) {
                 [_videoLibraryStackView removeFromSuperview];
@@ -403,8 +405,8 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
             break;
 
         case 2:
-            if (_mediaSourceScrollView.superview != nil) {
-                [_mediaSourceScrollView removeFromSuperview];
+            if (_mediaSourceView.superview != nil) {
+                [_mediaSourceView removeFromSuperview];
             }
             if (_videoLibraryStackView.superview != nil) {
                 [_videoLibraryStackView removeFromSuperview];
@@ -432,12 +434,12 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
             if (_alternativeAudioView.superview != nil) {
                 [_alternativeAudioView removeFromSuperview];
             }
-            if (_mediaSourceScrollView.superview == nil) {
-                _mediaSourceScrollView.translatesAutoresizingMaskIntoConstraints = NO;
-                [_libraryTargetView addSubview:_mediaSourceScrollView];
-                NSDictionary *dict = NSDictionaryOfVariableBindings(_mediaSourceScrollView);
-                [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_mediaSourceScrollView(>=572.)]|" options:0 metrics:0 views:dict]];
-                [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_mediaSourceScrollView(>=444.)]|" options:0 metrics:0 views:dict]];
+            if (_mediaSourceView.superview == nil) {
+                _mediaSourceView.translatesAutoresizingMaskIntoConstraints = NO;
+                [_libraryTargetView addSubview:_mediaSourceView];
+                NSDictionary *dict = NSDictionaryOfVariableBindings(_mediaSourceView);
+                [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_mediaSourceView(>=572.)]|" options:0 metrics:0 views:dict]];
+                [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_mediaSourceView(>=444.)]|" options:0 metrics:0 views:dict]];
             }
             [_mediaSourceDataSource loadMediaSources];
             [_mediaSourceCollectionView reloadData];
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.h
similarity index 82%
rename from modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
rename to modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.h
index 8c6b6143cf..8af7aeeaf4 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
+++ b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.h
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * VLCMediaSourceDataSource.h: MacOS X interface module
+ * VLCMediaSourceBaseDataSource.h: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2019 VLC authors and VideoLAN
  *
@@ -22,16 +22,13 @@
 
 #import <Cocoa/Cocoa.h>
 
-typedef NS_ENUM(NSInteger, VLCMediaSourceMode) {
-    VLCMediaSourceModeLAN,
-    VLCMediaSourceModeInternet,
-};
-
 NS_ASSUME_NONNULL_BEGIN
 
- at interface VLCMediaSourceDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate>
+ at interface VLCMediaSourceBaseDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate>
 
 @property (readwrite) NSCollectionView *collectionView;
+ at property (readwrite) NSButton *homeButton;
+ at property (readwrite) NSPathControl *pathControl;
 
 - (void)loadMediaSources;
 
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
similarity index 96%
rename from modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
rename to modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
index c55bbbf8a4..c431bf1dac 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
+++ b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * VLCMediaSourceDataSource.m: MacOS X interface module
+ * VLCMediaSourceBaseDataSource.m: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2019 VLC authors and VideoLAN
  *
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#import "VLCMediaSourceDataSource.h"
+#import "VLCMediaSourceBaseDataSource.h"
 
 #import "media-source/VLCMediaSourceProvider.h"
 #import "media-source/VLCMediaSource.h"
@@ -30,13 +30,13 @@
 #import "library/VLCInputItem.h"
 #import "extensions/NSString+Helpers.h"
 
- at interface VLCMediaSourceDataSource ()
+ at interface VLCMediaSourceBaseDataSource ()
 {
     NSArray *_mediaSources;
 }
 @end
 
- at implementation VLCMediaSourceDataSource
+ at implementation VLCMediaSourceBaseDataSource
 
 - (instancetype)init
 {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9a3e4b312f..6ac7465544 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -494,10 +494,10 @@ modules/gui/macosx/main/VLCMain.m
 modules/gui/macosx/main/macosx.m
 modules/gui/macosx/media-source/VLCMediaSource.h
 modules/gui/macosx/media-source/VLCMediaSource.m
+modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.h
+modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
 modules/gui/macosx/media-source/VLCMediaSourceCollectionViewItem.h
 modules/gui/macosx/media-source/VLCMediaSourceCollectionViewItem.m
-modules/gui/macosx/media-source/VLCMediaSourceDataSource.h
-modules/gui/macosx/media-source/VLCMediaSourceDataSource.m
 modules/gui/macosx/media-source/VLCMediaSourceProvider.h
 modules/gui/macosx/media-source/VLCMediaSourceProvider.m
 modules/gui/macosx/menus/VLCMainMenu.h



More information about the vlc-commits mailing list