[vlc-devel] commit: Qt: fix First run dialog (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Dec 29 23:26:55 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Dec 29 23:25:01 2009 +0100| [0533a0cd43c38b3718355af5f482dd119e3371d1] | committer: Jean-Baptiste Kempf 

Qt: fix First run dialog

And close #3182 the unparented widget that could be bothering you.
The issue about the unparented widget was totalled found by freeruner (on IRC and trac)

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

 modules/gui/qt4/dialogs/firstrun.cpp |   20 ++++----------------
 modules/gui/qt4/dialogs/firstrun.hpp |   13 +++++++++++++
 modules/gui/qt4/dialogs/messages.cpp |    1 +
 modules/gui/qt4/main_interface.cpp   |    2 +-
 4 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/modules/gui/qt4/dialogs/firstrun.cpp b/modules/gui/qt4/dialogs/firstrun.cpp
index 232d463..afaf98c 100644
--- a/modules/gui/qt4/dialogs/firstrun.cpp
+++ b/modules/gui/qt4/dialogs/firstrun.cpp
@@ -29,25 +29,13 @@
 #include <QGroupBox>
 #include <QSettings>
 
-FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf )
+FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf  )
          : QWidget( _p ), p_intf( _p_intf )
 {
 #ifndef HAVE_MAEMO
-    /**
-     * Ask for the network policy on FIRST STARTUP
-     **/
-    if( getSettings()->value( "IsFirstRun", 1 ).toInt() )
-    {
-        if( config_GetInt( p_intf, "qt-privacy-ask") )
-        {
-            buildPrivDialog();
-            setVisible( true );
-        }
-        else
-            close();
-
-        getSettings()->setValue( "IsFirstRun", 0 );
-    }
+    msg_Dbg( p_intf, "Boring first Run Wizard" );
+    buildPrivDialog();
+    setVisible( true );
 #endif
 }
 
diff --git a/modules/gui/qt4/dialogs/firstrun.hpp b/modules/gui/qt4/dialogs/firstrun.hpp
index 357fed9..f1e7167 100644
--- a/modules/gui/qt4/dialogs/firstrun.hpp
+++ b/modules/gui/qt4/dialogs/firstrun.hpp
@@ -24,11 +24,24 @@
 #include "qt4.hpp"
 
 #include <QWidget>
+#include <QSettings>
+
 class ConfigControl;
 class FirstRun : public QWidget
 {
     Q_OBJECT
     public:
+        static void CheckAndRun( QWidget *_p, intf_thread_t *p_intf )
+        {
+            if( getSettings()->value( "IsFirstRun", 1 ).toInt() )
+            {
+                if( config_GetInt( p_intf, "qt-privacy-ask") )
+                {
+                    new FirstRun( _p, p_intf );
+                }
+                getSettings()->setValue( "IsFirstRun", 0 );
+            }
+        }
         FirstRun( QWidget *, intf_thread_t * );
     private:
         QList<ConfigControl *> controlsList;
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index 8d80e54..84d7259 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -189,6 +189,7 @@ void MessagesDialog::updateConfig()
 {
     config_PutPsz(p_intf, "verbose-objects", qtu(vbobjectsEdit->text()));
     //vbobjectsEdit->setText("vbEdit changed!");
+    msg_Dbg( p_intf, "Here" );
 
     char * psz_verbose_objects = strdup(qtu(vbobjectsEdit->text()));
     msg_EnableObjectPrinting(p_intf, "all");
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 8663c38..03a075c 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -100,7 +100,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     i_bg_height          = 0;
 
     /* Ask for Privacy */
-    new FirstRun( this, p_intf );
+    FirstRun::CheckAndRun( this, p_intf );
 
     /**
      *  Configuration and settings




More information about the vlc-devel mailing list