Commit ca83393c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

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

Close #6838
parent 7f0b0268
......@@ -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() )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment