[vlc-commits] qt/PlaylistMediaContextMenu: Add 'Remove Selected' action

Benjamin Arnaud git at videolan.org
Mon Mar 15 10:34:50 UTC 2021


vlc | branch: master | Benjamin Arnaud <benjamin.arnaud at videolabs.io> | Thu Mar 11 10:16:48 2021 +0100| [f474d6e0e6ae6a1ec93f736e46fd0e5627f5b2b4] | committer: Pierre Lamot

qt/PlaylistMediaContextMenu: Add 'Remove Selected' action

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

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

 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);
 }
 



More information about the vlc-commits mailing list