[vlc-commits] commit: Qt: correctly implement play-and-exit in menu (Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Mon Nov 15 22:47:41 CET 2010
vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Nov 15 22:20:09 2010 +0100| [d79c2ea8b55513acdc93b765002c12f98f6277d3] | committer: 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 5e85bff1849e4391b6598bfbcc5a6c65cd1e151d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=d79c2ea8b55513acdc93b765002c12f98f6277d3
---
modules/gui/qt4/input_manager.cpp | 4 ++++
modules/gui/qt4/input_manager.hpp | 1 +
modules/gui/qt4/menus.cpp | 11 ++++-------
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 669a9db..7961729 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -1148,6 +1148,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 *
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 3654984..65a32e1 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -265,6 +265,7 @@ public:
vout_thread_t* getVout();
aout_instance_t *getAout();
+ bool getPlayExitState();
private:
MainInputManager( intf_thread_t * );
virtual ~MainInputManager();
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 2302559..e95a5ef 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -484,13 +484,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" ),
More information about the vlc-commits
mailing list