[vlc-commits] macosx: implement double-click on playlist for playback

Felix Paul Kühne git at videolan.org
Thu Jan 31 17:58:40 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Thu Jan 31 17:23:18 2019 +0100| [a525ad7e3fa18dda27e60665d862ee769dc3069d] | committer: Felix Paul Kühne

macosx: implement double-click on playlist for playback

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

 modules/gui/macosx/UI/VLCLibraryWindow.xib | 1 +
 modules/gui/macosx/VLCLibraryWindow.h      | 2 ++
 modules/gui/macosx/VLCLibraryWindow.m      | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index 899a2a2491..dabe0892db 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -133,6 +133,7 @@
                                                         </tableColumn>
                                                     </tableColumns>
                                                     <connections>
+                                                        <action trigger="doubleAction" selector="playlistDoubleClickAction:" target="QvC-M9-y7g" id="aCf-fY-ndG"/>
                                                         <action selector="selectNextTab:" target="QvC-M9-y7g" id="oNk-CO-d5B"/>
                                                     </connections>
                                                 </tableView>
diff --git a/modules/gui/macosx/VLCLibraryWindow.h b/modules/gui/macosx/VLCLibraryWindow.h
index 8fe7e638fa..31c4c05e4d 100644
--- a/modules/gui/macosx/VLCLibraryWindow.h
+++ b/modules/gui/macosx/VLCLibraryWindow.h
@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, weak) IBOutlet NSCollectionView *libraryCollectionView;
 @property (readwrite, weak) IBOutlet NSTableView *playlistTableView;
 
+- (IBAction)playlistDoubleClickAction:(id)sender;
+
 @end
 
 @interface VLCLibraryDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate>
diff --git a/modules/gui/macosx/VLCLibraryWindow.m b/modules/gui/macosx/VLCLibraryWindow.m
index b4e72a5af9..009823f15a 100644
--- a/modules/gui/macosx/VLCLibraryWindow.m
+++ b/modules/gui/macosx/VLCLibraryWindow.m
@@ -75,6 +75,15 @@ static NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier";
 {
 }
 
+- (void)playlistDoubleClickAction:(id)sender
+{
+    NSInteger selectedRow = self.playlistTableView.selectedRow;
+    if (selectedRow == -1)
+        return;
+
+    [[[VLCMain sharedInstance] playlistController] playItemAtIndex:selectedRow];
+}
+
 @end
 
 @implementation VLCLibraryDataSource



More information about the vlc-commits mailing list