[vlc-devel] [PATCH 04/15] qt/PlaylistMediaContextMenu: Add 'Remove Selected' action

Benjamin Arnaud benjamin.arnaud at videolabs.io
Thu Mar 11 09:16:48 UTC 2021


---
 modules/gui/qt/menus/qml_menu_wrapper.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/gui/qt/menus/qml_menu_wrapper.cpp b/modules/gui/qt/menus/qml_menu_wrapper.cpp
index 03eba1477d..1e7b1eaa3b 100644
--- a/modules/gui/qt/menus/qml_menu_wrapper.cpp
+++ b/modules/gui/qt/menus/qml_menu_wrapper.cpp
@@ -516,6 +516,16 @@ void PlaylistMediaContextMenu::popup(const QModelIndexList & selected, QPoint po
 #endif
     }
 
+    m_menu->addSeparator();
+
+    action = m_menu->addAction(qtr("Remove Selected"));
+
+    action->setIcon(QIcon(":/buttons/playlist/playlist_remove.svg"));
+
+    connect(action, &QAction::triggered, [this, selected]() {
+        m_model->remove(selected);
+    });
+
     m_menu->popup(pos);
 }
 
-- 
2.25.1



More information about the vlc-devel mailing list