[vlc-commits] Qt: reload some preferences live

Jean-Baptiste Kempf git at videolan.org
Mon Sep 26 01:06:21 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Sep 26 01:03:54 2011 +0200| [eff056b10c1b9cddbbb3c3b41215358d062a44f5] | committer: Jean-Baptiste Kempf

Qt: reload some preferences live

Close #3148

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

 modules/gui/qt4/dialogs/preferences.cpp |    4 ++++
 modules/gui/qt4/main_interface.cpp      |   15 +++++++++++++++
 modules/gui/qt4/main_interface.hpp      |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
index 1d2a3ae..e7fd4c5 100644
--- a/modules/gui/qt4/dialogs/preferences.cpp
+++ b/modules/gui/qt4/dialogs/preferences.cpp
@@ -33,6 +33,7 @@
 #include "components/complete_preferences.hpp"
 #include "components/simple_preferences.hpp"
 #include "util/searchlineedit.hpp"
+#include "main_interface.hpp"
 
 #include <QHBoxLayout>
 #include <QGroupBox>
@@ -318,6 +319,9 @@ void PrefsDialog::save()
         ErrorsDialog::getInstance (p_intf)->addError( qtr( "Cannot save Configuration" ),
             qtr("Preferences file could not be saved") );
     }
+
+    if( p_intf->p_sys->p_mi )
+        p_intf->p_sys->p_mi->reloadPrefs();
     accept();
 }
 
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index c562306..41fea29 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -121,6 +121,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Do we want anoying popups or not */
     b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" );
 
+    /* */
     b_pauseOnMinimize = var_InheritBool( p_intf, "qt-pause-minimized" );
 
     /* Set the other interface settings */
@@ -376,6 +377,20 @@ void MainInterface::recreateToolbars()
     settings->endGroup();
 }
 
+void MainInterface::reloadPrefs()
+{
+    b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" );
+    b_pauseOnMinimize = var_InheritBool( p_intf, "qt-pause-minimized" );
+#ifdef WIN32
+    p_intf->p_sys->disable_volume_keys = var_InheritBool( p_intf, "qt-disable-volume-keys" );
+#endif
+    if( !var_InheritBool( p_intf, "qt-fs-controller" ) && fullscreenControls )
+    {
+        delete fullscreenControls;
+        fullscreenControls = NULL;
+    }
+}
+
 void MainInterface::createMainWidget( QSettings *settings )
 {
     /* Create the main Widget and the mainLayout */
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 59389fa..fd925c4 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -206,6 +206,8 @@ public slots:
 
     void emitBoss();
 
+    void reloadPrefs();
+
 private slots:
     void debug();
     void destroyPopupMenu();



More information about the vlc-commits mailing list