vlc | branch: master | Jean-Baptiste Kempf <[email protected]> | 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() ) { _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
