Commit d79c2ea8 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
(cherry picked from commit 5e85bff1)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 862bdbde
...@@ -1148,6 +1148,10 @@ void MainInputManager::activatePlayQuit( bool b_exit ) ...@@ -1148,6 +1148,10 @@ void MainInputManager::activatePlayQuit( bool b_exit )
var_SetBool( THEPL, "play-and-exit", b_exit ); var_SetBool( THEPL, "play-and-exit", b_exit );
} }
bool MainInputManager::getPlayExitState()
{
return var_GetBool( THEPL, "play-and-exit" );
}
/**************************** /****************************
* Static callbacks for MIM * * Static callbacks for MIM *
......
...@@ -265,6 +265,7 @@ public: ...@@ -265,6 +265,7 @@ public:
vout_thread_t* getVout(); vout_thread_t* getVout();
aout_instance_t *getAout(); aout_instance_t *getAout();
bool getPlayExitState();
private: private:
MainInputManager( intf_thread_t * ); MainInputManager( intf_thread_t * );
virtual ~MainInputManager(); virtual ~MainInputManager();
......
...@@ -484,13 +484,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface ...@@ -484,13 +484,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface
action->setChecked( mi->isPlDocked() ); action->setChecked( mi->isPlDocked() );
CONNECT( action, triggered( bool ), mi, dockPlaylist( bool ) ); CONNECT( action, triggered( bool ), mi, dockPlaylist( bool ) );
if( !current ) action = menu->addAction( qtr( "Quit after Playback" ) );
// I don't want to manage consistency between menus, so no popup-menu action->setCheckable( true );
{ action->setChecked( THEMIM->getPlayExitState() );
action = menu->addAction( qtr( "Quit after Playback" ) ); CONNECT( action, triggered( bool ), THEMIM, activatePlayQuit( bool ) );
action->setCheckable( true );
CONNECT( action, triggered( bool ), THEMIM, activatePlayQuit( bool ) );
}
#if 0 /* For Visualisations. Not yet working */ #if 0 /* For Visualisations. Not yet working */
adv = menu->addAction( qtr( "Visualizations selector" ), 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