[vlc-commits] macosx: Improve playlist context menu item validation

David Fuhrmann git at videolan.org
Fri May 31 11:01:26 CEST 2019


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Fri May 31 10:57:22 2019 +0200| [15b46b12e0cd91a1911d33972308e3788a92f12b] | committer: David Fuhrmann

macosx: Improve playlist context menu item validation

Only enable stuff if it works.

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

 modules/gui/macosx/playlist/VLCPlaylistMenuController.m | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
index b145780d47..5b4852c34d 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
@@ -114,10 +114,16 @@
 {
     if (menuItem == self.addFilesToPlaylistMenuItem) {
         return YES;
-    }
 
-    if (_playlistController.playlistModel.numberOfPlaylistItems > 0) {
-        return YES;
+    } else if (menuItem == self.clearPlaylistMenuItem) {
+        return (self.playlistTableView.numberOfRows > 0);
+
+    } else if (menuItem == self.removeMenuItem ||
+               menuItem == self.playMenuItem) {
+        return (self.playlistTableView.numberOfSelectedRows > 0);
+
+    } else if (menuItem == self.revealInFinderMenuItem) {
+        return (self.playlistTableView.numberOfSelectedRows == 1);
     }
 
     return NO;



More information about the vlc-commits mailing list