Commit 5e85bff1 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: correctly implement play-and-exit in menu

This calls a var_GetBool each time a menu is redrawn. This may be not
optimal. Maybe a callback on "play-and-exit" would be better?
Do we care about the performance on that part (menu display)?
Close #3842
parent 7a2f855c
......@@ -1146,6 +1146,10 @@ void MainInputManager::activatePlayQuit( bool b_exit )
var_SetBool( THEPL, "play-and-exit", b_exit );
}
bool MainInputManager::getPlayExitState()
{
return var_GetBool( THEPL, "play-and-exit" );
}
/****************************
* Static callbacks for MIM *
......
......@@ -265,6 +265,7 @@ public:
vout_thread_t* getVout();
aout_instance_t *getAout();
bool getPlayExitState();
private:
MainInputManager( intf_thread_t * );
virtual ~MainInputManager();
......
......@@ -487,13 +487,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface
action->setChecked( mi->isPlDocked() );
CONNECT( action, triggered( bool ), mi, dockPlaylist( bool ) );
if( !current )
// I don't want to manage consistency between menus, so no popup-menu
{
action = menu->addAction( qtr( "Quit after Playback" ) );
action->setCheckable( true );
CONNECT( action, triggered( bool ), THEMIM, activatePlayQuit( bool ) );
}
action = menu->addAction( qtr( "Quit after Playback" ) );
action->setCheckable( true );
action->setChecked( THEMIM->getPlayExitState() );
CONNECT( action, triggered( bool ), THEMIM, activatePlayQuit( bool ) );
#if 0 /* For Visualisations. Not yet working */
adv = menu->addAction( qtr( "Visualizations selector" ),
......
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