]> git.sesse.net Git - vlc/commitdiff
Qt: add UI for play-and-exit activation. Just a menu for now.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Feb 2009 23:56:20 +0000 (00:56 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Feb 2009 23:57:04 +0000 (00:57 +0100)
Close partly #2237

modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/menus.cpp

index 9564438f38fac9ed4247a7173653fe77667a1966..cdefa320dd95a70858d5f8350d82e2f15b3711a0 100644 (file)
@@ -983,6 +983,11 @@ void MainInputManager::togglePlayPause()
         getIM()->togglePlayPause();
 }
 
+void MainInputManager::activatePlayQuit( bool b_exit )
+{
+    var_SetBool( THEPL, "play-and-exit", b_exit );
+}
+
 /* Static callbacks for MIM */
 static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
                         vlc_value_t oldval, vlc_value_t newval, void *param )
index 69732e037f0c4538cbac2c336666248b9355c767..e6729f229fdad74b5769947c013e1dd89570821a 100644 (file)
@@ -237,6 +237,7 @@ public slots:
     void stop();
     void next();
     void prev();
+    void activatePlayQuit( bool );
 
 signals:
     void inputChanged( input_thread_t * );
index efd5cc4db785d0ae1838507eb4ef04e7cceafc4e..8ffa15112d8fc0395ff08e17a71d77370097e1f4 100644 (file)
@@ -432,6 +432,14 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
     if( mi->getControlsVisibilityStatus() & CONTROLS_ADVANCED )
         action->setChecked( true );
 
+    if( with_intf )
+    // 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 ) );
+    }
+
 #if 0 /* For Visualisations. Not yet working */
     adv = menu->addAction( qtr( "Visualizations selector" ),
             mi, SLOT( visual() ) );