[vlc-devel] commit: Remember to check MI when you use it in menus. cpp that can be called by skins. (Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Aug 11 18:03:40 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug 11 09:02:52 2008 -0700| [84c9ebfe17f868306c6b0c5bd4f57836d5ae0076] | committer: Jean-Baptiste Kempf 

Remember to check MI when you use it in menus.cpp that can be called by skins.

Close #1846

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=84c9ebfe17f868306c6b0c5bd4f57836d5ae0076
---

 modules/gui/qt4/menus.cpp |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 04aaad4..373d835 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -371,6 +371,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
     }
     if( mi )
     {
+        msg_Dbg( p_intf, "I am here" );
         /* Minimal View */
         QAction *action = menu->addAction( qtr( "Mi&nimal View..." ), mi,
                                 SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
@@ -837,20 +838,26 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
         if( !b_isFullscreen )
         {
             submenu = new QMenu( qtr( "Interface" ), menu );
-            submenu->addAction( QIcon( ":/playlist" ),
-                     qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
+            if( mi )
+            {
+                submenu->addAction( QIcon( ":/playlist" ),
+                         qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
+            }
             addDPStaticEntry( submenu, qtr( I_MENU_EXT ), "",
                 ":/settings", SLOT( extendedDialog() ) );
-            action = submenu->addAction( QIcon( "" ),
-                 qtr( "Minimal View..." ), mi, SLOT( toggleMinimalView() ) );
-            action->setCheckable( true );
-            action->setChecked( !( mi->getControlsVisibilityStatus() &
-                                   CONTROLS_VISIBLE ) );
-            action = submenu->addAction( QIcon( "" ),
-                 qtr( "Toggle Fullscreen Interface" ),
-                 mi, SLOT( toggleFullScreen() ) );
-            action->setCheckable( true );
-            action->setChecked( mi->isFullScreen() );
+            if( mi )
+            {
+                action = submenu->addAction( QIcon( "" ),
+                     qtr( "Minimal View..." ), mi, SLOT( toggleMinimalView() ) );
+                action->setCheckable( true );
+                action->setChecked( !( mi->getControlsVisibilityStatus() &
+                            CONTROLS_VISIBLE ) );
+                action = submenu->addAction( QIcon( "" ),
+                        qtr( "Toggle Fullscreen Interface" ),
+                        mi, SLOT( toggleFullScreen() ) );
+                action->setCheckable( true );
+                action->setChecked( mi->isFullScreen() );
+            }
             menu->addMenu( submenu );
         }
 




More information about the vlc-devel mailing list