]> git.sesse.net Git - vlc/commitdiff
Qt: New configuration var "qt-autoload-extensions"
authorJean-Philippe André <jpeg@videolan.org>
Thu, 28 Jan 2010 14:55:49 +0000 (15:55 +0100)
committerJean-Philippe André <jpeg@videolan.org>
Thu, 28 Jan 2010 15:17:35 +0000 (16:17 +0100)
If true, load the extensions on startup. Otherwise, don't load
them automatically.

modules/gui/qt4/menus.cpp
modules/gui/qt4/qt4.cpp

index aec591b28c9ff8afa4dcaa49a335b08f7303f5d5..28be14dafca37eebbcbb08fb169824ecf392dfe4 100644 (file)
@@ -493,8 +493,6 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
         ":/menu/preferences", SLOT( toolbarDialog() ) );
 
     /* Extensions */
-    /// @todo Check configuration variable "auto load extensions"
-    menu->addSeparator();
     ExtensionsMenu( p_intf, menu );
 
     return menu;
@@ -520,12 +518,20 @@ void QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *extMenu )
 {
     /* Get ExtensionsManager and load extensions if needed */
     ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf );
+
+    if( !var_InheritBool( p_intf, "qt-autoload-extensions")
+        && !extMgr->isLoaded() )
+    {
+        return;
+    }
+
     if( !extMgr->isLoaded() && !extMgr->cannotLoad() )
     {
         extMgr->loadExtensions();
     }
 
     /* Let the ExtensionsManager build itself the menu */
+    extMenu->addSeparator();
     extMgr->menu( extMenu );
 }
 
index 010758c84768651e6d1f7864c8758f5bb48b50b7..e238dbd826224a7e88957734489c0ebd662a07c8 100644 (file)
@@ -161,6 +161,10 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define FULLSCREEN_NUMBER_LONGTEXT N_( "Screennumber of fullscreen, instead of" \
                                        "same screen where interface is" )
 
+#define QT_AUTOLOAD_EXTENSIONS_TEXT N_( "Load extensions on startup" )
+#define QT_AUTOLOAD_EXTENSIONS_LONGTEXT N_( "Automatically load the "\
+                                            "extensions module on startup" )
+
 /* Various modes definition */
 static const int i_mode_list[] =
     { QT_NORMAL_MODE, QT_ALWAYS_VIDEO_MODE, QT_MINIMAL_MODE };
@@ -236,6 +240,10 @@ vlc_module_begin ()
     add_integer( "qt-fullscreen-screennumber", -1, NULL, FULLSCREEN_NUMBER_TEXT,
                FULLSCREEN_NUMBER_LONGTEXT, false );
 
+    add_bool( "qt-autoload-extensions", true, NULL,
+              QT_AUTOLOAD_EXTENSIONS_TEXT, QT_AUTOLOAD_EXTENSIONS_LONGTEXT,
+              false )
+
     add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
 
     add_submodule ()