[vlc-commits] Qt: Adding a Fast Playlist access in the right-click menus

Jean-Baptiste Kempf git at videolan.org
Sun Oct 9 23:35:36 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Oct  7 18:58:09 2011 +0200| [50a2677b2d7c7f675fbffa6597655c10886ae09c] | committer: Jean-Baptiste Kempf

Qt: Adding a Fast Playlist access in the right-click menus

As asked by Laurent
Close #4722

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

 modules/gui/qt4/menus.cpp |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 3c2b403..197bb88 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -36,17 +36,19 @@
 
 #include <vlc_common.h>
 #include <vlc_intf_strings.h>
-#include <vlc_vout.h>              /* vout_thread_t */
-#include <vlc_aout.h>
+#include <vlc_vout.h>                             /* vout_thread_t */
+#include <vlc_aout.h>                             /* audio_output_t */
 
 #include "menus.hpp"
 
-#include "main_interface.hpp"      /* View modifications */
-#include "dialogs_provider.hpp"    /* Dialogs display */
-#include "input_manager.hpp"       /* Input Management */
-#include "recents.hpp"             /* Recent Items */
-#include "actions_manager.hpp"     /* Actions Management: play+volume */
-#include "extensions_manager.hpp"  /* Extensions menu*/
+#include "main_interface.hpp"                     /* View modifications */
+#include "dialogs_provider.hpp"                   /* Dialogs display */
+#include "input_manager.hpp"                      /* Input Management */
+#include "recents.hpp"                            /* Recent Items */
+#include "actions_manager.hpp"                    /* Actions Management: play+volume */
+#include "extensions_manager.hpp"                 /* Extensions menu */
+#include "util/qmenuview.hpp"                     /* Simple Playlist menu */
+#include "components/playlist/playlist_model.hpp" /* PLModel getter */
 
 #include <QMenu>
 #include <QMenuBar>
@@ -1062,6 +1064,15 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
         menu->addMenu( submenu );
     }
 
+    /* */
+    QMenuView *plMenu = new QMenuView( menu );
+    plMenu->setTitle( qtr("Playlist") );
+    PLModel *model = PLModel::getPLModel( p_intf );
+    plMenu->setModel( model );
+    CONNECT( plMenu, activated(const QModelIndex&),
+             model, activateItem(const QModelIndex&));
+    menu->addMenu( plMenu );
+
     /* Static entries for ending, like open */
     PopupMenuStaticEntries( menu );
 



More information about the vlc-commits mailing list