]> git.sesse.net Git - vlc/commitdiff
Qt: remove the static QAction* for the menus consistency in the Fullscreen Mode.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Feb 2009 19:58:12 +0000 (20:58 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 27 Feb 2009 19:58:12 +0000 (20:58 +0100)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.hpp

index 0af76201d2f66904f12210d5fef92cb44fe156f6..fede72027edfaf9137fe86ec6e794ad4db4f222d 100644 (file)
@@ -1183,12 +1183,12 @@ void MainInterface::toggleFullScreen( void )
     {
         showNormal();
         emit askUpdate(); // Needed if video was launched after the F11
-        QVLCMenu::fullscreenViewAction->setChecked( false );
+        emit fullscreenInterfaceToggled( false );
     }
     else
     {
         showFullScreen();
-        QVLCMenu::fullscreenViewAction->setChecked( true );
+        emit fullscreenInterfaceToggled( true );
     }
 
 }
index b2c088e5208934be3b10af518fdebc00572d1860..4034eb5de5b724c00b096e7e7e94b0c6960592c4 100644 (file)
@@ -186,6 +186,7 @@ signals:
     void askBgWidgetToToggle();
     void askUpdate();
     void minimalViewToggled( bool );
+    void fullscreenInterfaceToggled( bool );
 };
 
 #endif
index 65226dd054dfc422a16460a1c38dd5f46d1e840a..efd5cc4db785d0ae1838507eb4ef04e7cceafc4e 100644 (file)
@@ -73,10 +73,6 @@ enum
 
 static QActionGroup *currentGroup;
 
-/* HACK for minimalView to go around a Qt bug/feature
- * that doesn't update the QAction checked state when QMenu is hidden */
-QAction *QVLCMenu::fullscreenViewAction = NULL;
-
 QMenu *QVLCMenu::recentsMenu = NULL;
 
 /****************************************************************************
@@ -416,7 +412,7 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
     action->setShortcut( qtr( "Ctrl+H" ) );
     action->setCheckable( true );
     action->setChecked( !with_intf &&
-            (mi->getControlsVisibilityStatus() && CONTROLS_HIDDEN ) );
+            (mi->getControlsVisibilityStatus() & CONTROLS_HIDDEN ) );
 
     CONNECT( action, triggered( bool ), mi, toggleMinimalView( bool ) );
     CONNECT( mi, minimalViewToggled( bool ), action, setChecked( bool ) );
@@ -424,8 +420,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
     /* FullScreen View */
     action = menu->addAction( qtr( "&Fullscreen Interface" ), mi,
             SLOT( toggleFullScreen() ), QString( "F11" ) );
-    fullscreenViewAction = action;
     action->setCheckable( true );
+    action->setChecked( mi->isFullScreen() );
+    CONNECT( mi, fullscreenInterfaceToggled( bool ),
+             action, setChecked( bool ) );
 
     /* Advanced Controls */
     action = menu->addAction( qtr( "&Advanced Controls" ), mi,
index 76b65f695dba39ac7e79005180421071074f5c89..3ab5ae08b6f4c1eb90bca472fb33c50cd9a212f6 100644 (file)
@@ -94,10 +94,6 @@ public:
     /* Actions */
     static void DoAction( QObject * );
 
-    /* HACK for minimalView */
-    static QAction *minimalViewAction;
-    static QAction *fullscreenViewAction;
-
 private:
     /* All main Menus */
     static QMenu *FileMenu( intf_thread_t *, QWidget * );