[vlc-commits] Qt: add the playlist view mode selection to the right click menu

Jean-Baptiste Kempf git at videolan.org
Thu Aug 16 15:29:42 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 16 15:28:36 2012 +0200| [ca83393c3d885c185c778871c6c20573716b7a49] | committer: Jean-Baptiste Kempf

Qt: add the playlist view mode selection to the right click menu

Close #6838

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

 .../gui/qt4/components/playlist/standardpanel.cpp    |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 9109431..a676924 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -255,6 +255,24 @@ bool StandardPLPanel::popup( const QModelIndex & index, const QPoint &point, con
 
     CONNECT( &menu, triggered( QAction * ), model, actionSlot( QAction * ) );
 
+    QMenu *viewMenu = new QMenu( qtr( "Playlist View Mode" ) );
+
+    /* View selection menu */
+    QSignalMapper *viewSelectionMapper = new QSignalMapper( this );
+    CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) );
+
+# define MAX_VIEW StandardPLPanel::VIEW_COUNT
+    for( int i = 0; i < MAX_VIEW; i++ )
+    {
+        QAction *action = viewMenu->addAction( viewNames[i] );
+        action->setCheckable( true );
+        viewSelectionMapper->setMapping( action, i );
+        CONNECT( action, triggered(), viewSelectionMapper, map() );
+        if( currentViewIndex() == i )
+            action->setChecked( true );
+    }
+    menu.addMenu( viewMenu );
+
     /* Display and forward the result */
     if( !menu.isEmpty() )
     {



More information about the vlc-commits mailing list