[vlc-commits] macosx: Adapt playlist context menu validation, hide info menu entry

David Fuhrmann git at videolan.org
Sat Jun 17 13:58:19 CEST 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Jun 17 12:17:07 2017 +0200| [9e1d2957b446ed5799b1f1aaa81bfcce1a767e8a] | committer: David Fuhrmann

macosx: Adapt playlist context menu validation, hide info menu entry

Use correct validation routine to validate state of menu items.
Fix validation for select all menu item.
Hide info menu item as info panel per item is currently not
supported.

refs #17726

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

 modules/gui/macosx/VLCPlaylist.m | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 80a7297112..2b83f53702 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -444,9 +444,13 @@
     } else if ([item action] == @selector(deleteItem:)) {
         return [_outlineView numberOfSelectedRows] > 0 && _model.editAllowed;
     } else if ([item action] == @selector(selectAll:)) {
-        return [_outlineView numberOfRows] >= 0;
+        return [_outlineView numberOfRows] > 0;
     } else if ([item action] == @selector(playItem:)) {
         return [_outlineView numberOfSelectedRows] > 0;
+    } else if ([item action] == @selector(recursiveExpandNode:)) {
+        return [_outlineView numberOfSelectedRows] > 0;
+    } else if ([item action] == @selector(showInfoPanel:)) {
+        return [_outlineView numberOfSelectedRows] > 0;
     }
 
     return YES;
@@ -681,24 +685,13 @@
     if (!b_playlistmenu_nib_loaded)
         b_playlistmenu_nib_loaded = [NSBundle loadNibNamed:@"PlaylistMenu" owner:self];
 
-    NSPoint pt;
-    bool b_rows;
-    bool b_item_sel;
-
-    pt = [_outlineView convertPoint: [o_event locationInWindow] fromView: nil];
+    NSPoint pt = [_outlineView convertPoint: [o_event locationInWindow] fromView: nil];
     int row = [_outlineView rowAtPoint:pt];
     if (row != -1 && ![[_outlineView selectedRowIndexes] containsIndex: row])
         [_outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
 
-    b_item_sel = (row != -1 && [_outlineView selectedRow] != -1);
-    b_rows = [_outlineView numberOfRows] != 0;
-
-    playlist_t *p_playlist = pl_Get(getIntf());
-    bool b_del_allowed = [[self model] editAllowed];
-
-    // TODO move other items to menu validation protocol
-    [_infoPlaylistMenuItem setEnabled: b_item_sel];
-    [_recursiveExpandPlaylistMenuItem setEnabled: b_item_sel];
+    // TODO Reenable once per-item info panel is supported again
+    _infoPlaylistMenuItem.hidden = YES;
 
     return _playlistMenu;
 }



More information about the vlc-commits mailing list