]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/menus.cpp
qt4/menu.cpp: * Work around libqt4 opening gconf
[vlc] / modules / gui / qt4 / menus.cpp
index 132e74a6f79afc8053ae7f10d1a6f6876eea7d13..05908081da4f4849d6bf2995f402df972a063e8b 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * menus.cpp : Qt menus
  *****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2007 the VideoLAN team
  * $Id$
  *
- * Authors: ClÃment Stenac <zorglub@videolan.org>
+ * Authors: Clément Stenac <zorglub@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <QActionGroup>
 #include <QSignalMapper>
 
+#ifndef WIN32
+#   include <signal.h>
+#endif
+
 #include <vlc_intf_strings.h>
 
 #include "main_interface.hpp"
@@ -44,8 +48,30 @@ enum
 static QActionGroup *currentGroup;
 
 // Add static entries to menus
-#define DP_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEDP, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEDP, SLOT( slot ) ); } }
-#define MIM_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEMIM, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEMIM, SLOT( slot ) ); } }
+#define DP_SADD( text, help, icon, slot ) \
+    { \
+    if( strlen(icon) > 0 ) \
+    { \
+        QAction *action = menu->addAction( text, THEDP, SLOT( slot ) ); \
+        action->setIcon(QIcon(icon)); \
+    } \
+    else \
+    { \
+        menu->addAction( text, THEDP, SLOT( slot ) ); \
+    } \
+    }
+#define MIM_SADD( text, help, icon, slot ) \
+    { \
+    if( strlen(icon) > 0 ) \
+    { \
+        QAction *action = menu->addAction( text, THEMIM, SLOT( slot ) ); \
+        action->setIcon(QIcon(icon)); \
+    } \
+    else \
+    { \
+        menu->addAction( text, THEMIM, SLOT( slot ) ); \
+    } \
+    }
 #define PL_SADD
 
 /*****************************************************************************
@@ -124,7 +150,20 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
                               bool playlist, bool adv_controls_enabled,
                               bool visual_selector_enabled )
 {
+#ifndef WIN32    
+    /* Uglu klugde
+     * Remove SIGCHLD from the ignored signal the time to initialise
+     * Qt because it call gconf to get the icon theme */
+    sigset_t set;
+
+    sigemptyset( &set );
+    sigaddset( &set, SIGCHLD );
+    pthread_sigmask (SIG_UNBLOCK, &set, NULL);
+#endif
     QMenuBar *bar = mi->menuBar();
+#ifndef WIN32 
+    pthread_sigmask (SIG_BLOCK, &set, NULL);
+#endif
     BAR_ADD( FileMenu(), qtr("Media") );
     if( playlist )
     {
@@ -181,6 +220,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
     }
     DP_SADD( qtr(I_MENU_MSG), "", "", messagesDialog() );
     DP_SADD( qtr(I_MENU_INFO) , "", "", mediaInfoDialog() );
+    DP_SADD( qtr(I_MENU_CODECINFO) , "", "", mediaCodecDialog() );
     DP_SADD( qtr(I_MENU_EXT), "","",extendedDialog() );
     if( mi )
     {