]> git.sesse.net Git - vlc/commitdiff
Qt: reload some preferences live
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 25 Sep 2011 23:03:54 +0000 (01:03 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 25 Sep 2011 23:06:03 +0000 (01:06 +0200)
Close #3148

modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index 1d2a3aee9cadcf67754546229379834c3b925d8b..e7fd4c5d5520505f4d85fb4acca69075e357f071 100644 (file)
@@ -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();
 }
 
index c5623068b9fee19426bc152b3674138edbd42620..41fea294005025813505cc1a9ea1ecbdadd90109 100644 (file)
@@ -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 */
index 59389fa501a5561e66983da60cf0eb312a8accee..fd925c464503d0aa318f927db221089d196f6ff2 100644 (file)
@@ -206,6 +206,8 @@ public slots:
 
     void emitBoss();
 
+    void reloadPrefs();
+
 private slots:
     void debug();
     void destroyPopupMenu();