Reenable CoreConfigWizard
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Nov 2009 23:18:53 +0000 (00:18 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Nov 2009 23:39:42 +0000 (00:39 +0100)
Adapt the wizard to CoreConnection and make it work again.

src/client/coreconnection.cpp
src/client/coreconnection.h
src/qtui/coreconfigwizard.cpp
src/qtui/coreconfigwizard.h
src/qtui/mainwin.cpp
src/qtui/mainwin.h
src/qtui/ui/coreconfigwizardadminuserpage.ui

index 3d769cc..3a6b784 100644 (file)
@@ -200,9 +200,9 @@ void CoreConnection::coreHasData() {
       disconnectFromCore();
       return;
     } else if(msg["MsgType"] == "CoreSetupAck") {
       disconnectFromCore();
       return;
     } else if(msg["MsgType"] == "CoreSetupAck") {
-      //emit coreSetupSuccess();
+      emit coreSetupSuccess();
     } else if(msg["MsgType"] == "CoreSetupReject") {
     } else if(msg["MsgType"] == "CoreSetupReject") {
-      //emit coreSetupFailed(msg["Error"].toString());
+      emit coreSetupFailed(msg["Error"].toString());
     } else if(msg["MsgType"] == "ClientLoginReject") {
       loginFailed(msg["Error"].toString());
     } else if(msg["MsgType"] == "ClientLoginAck") {
     } else if(msg["MsgType"] == "ClientLoginReject") {
       loginFailed(msg["Error"].toString());
     } else if(msg["MsgType"] == "ClientLoginAck") {
@@ -459,6 +459,13 @@ void CoreConnection::connectionReady() {
   _coreMsgBuffer.clear();
 }
 
   _coreMsgBuffer.clear();
 }
 
+void CoreConnection::loginToCore(const QString &user, const QString &password, bool remember) {
+  _account.setUser(user);
+  _account.setPassword(password);
+  _account.setStorePassword(remember);
+  loginToCore();
+}
+
 void CoreConnection::loginToCore(const QString &prevError) {
   emit connectionMsg(tr("Logging in..."));
   if(currentAccount().user().isEmpty() || currentAccount().password().isEmpty() || !prevError.isEmpty()) {
 void CoreConnection::loginToCore(const QString &prevError) {
   emit connectionMsg(tr("Logging in..."));
   if(currentAccount().user().isEmpty() || currentAccount().password().isEmpty() || !prevError.isEmpty()) {
@@ -565,3 +572,10 @@ void CoreConnection::checkSyncState() {
     emit synchronized();
   }
 }
     emit synchronized();
   }
 }
+
+void CoreConnection::doCoreSetup(const QVariant &setupData) {
+  QVariantMap setup;
+  setup["MsgType"] = "CoreSetupData";
+  setup["SetupData"] = setupData;
+  SignalProxy::writeDataToDevice(_socket, setup);
+}
index 5342636..2f9d7cc 100644 (file)
@@ -90,6 +90,9 @@ signals:
   void progressTextChanged(const QString &);
 
   void startCoreSetup(const QVariantList &);
   void progressTextChanged(const QString &);
 
   void startCoreSetup(const QVariantList &);
+  void coreSetupSuccess();
+  void coreSetupFailed(const QString &error);
+
   void startInternalCore();
   void connectToInternalCore(SignalProxy *proxy);
 
   void startInternalCore();
   void connectToInternalCore(SignalProxy *proxy);
 
@@ -122,12 +125,14 @@ private slots:
 
   void resetConnection();
   void connectionReady();
 
   void resetConnection();
   void connectionReady();
-  //void doCoreSetup(const QVariant &setupData);
 
 
+  void loginToCore(const QString &user, const QString &password, bool remember); // for config wizard
   void loginToCore(const QString &previousError = QString());
   void loginSuccess();
   void loginFailed(const QString &errorMessage);
 
   void loginToCore(const QString &previousError = QString());
   void loginSuccess();
   void loginFailed(const QString &errorMessage);
 
+  void doCoreSetup(const QVariant &setupData);
+
   void updateProgress(int value, int maximum);
   void setProgressText(const QString &text);
   void setProgressValue(int value);
   void updateProgress(int value, int maximum);
   void setProgressText(const QString &text);
   void setProgressValue(int value);
@@ -159,6 +164,8 @@ private:
   QString _coreInfoString(const QVariantMap &);
 
   inline CoreAccountModel *accountModel() const;
   QString _coreInfoString(const QVariantMap &);
 
   inline CoreAccountModel *accountModel() const;
+
+  friend class CoreConfigWizard;
 };
 
 Q_DECLARE_METATYPE(CoreConnection::ConnectionState)
 };
 
 Q_DECLARE_METATYPE(CoreConnection::ConnectionState)
index 0d5c977..837b084 100644 (file)
 #include <QSpinBox>
 
 #include "coreconfigwizard.h"
 #include <QSpinBox>
 
 #include "coreconfigwizard.h"
+#include "coreconnection.h"
 #include "iconloader.h"
 
 #include "iconloader.h"
 
-CoreConfigWizard::CoreConfigWizard(const QList<QVariant> &backends, QWidget *parent) : QWizard(parent) {
-  foreach(QVariant v, backends) _backends[v.toMap()["DisplayName"].toString()] = v;
+CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList<QVariant> &backends, QWidget *parent)
+  : QWizard(parent),
+  _connection(connection)
+{
+  setModal(true);
+  setAttribute(Qt::WA_DeleteOnClose);
+
+  foreach(const QVariant &v, backends)
+    _backends[v.toMap()["DisplayName"].toString()] = v;
+
   setPage(IntroPage, new CoreConfigWizardPages::IntroPage(this));
   setPage(AdminUserPage, new CoreConfigWizardPages::AdminUserPage(this));
   setPage(StorageSelectionPage, new CoreConfigWizardPages::StorageSelectionPage(_backends, this));
   syncPage = new CoreConfigWizardPages::SyncPage(this);
   setPage(IntroPage, new CoreConfigWizardPages::IntroPage(this));
   setPage(AdminUserPage, new CoreConfigWizardPages::AdminUserPage(this));
   setPage(StorageSelectionPage, new CoreConfigWizardPages::StorageSelectionPage(_backends, this));
   syncPage = new CoreConfigWizardPages::SyncPage(this);
-  connect(syncPage, SIGNAL(setupCore(const QString &, const QVariantMap &)), this, SLOT(prepareCoreSetup(const QString &, const QVariantMap &)));
+  connect(syncPage, SIGNAL(setupCore(const QString &, const QVariantMap &)), SLOT(prepareCoreSetup(const QString &, const QVariantMap &)));
   setPage(SyncPage, syncPage);
   syncRelayPage = new CoreConfigWizardPages::SyncRelayPage(this);
   connect(syncRelayPage, SIGNAL(startOver()), this, SLOT(startOver()));
   setPage(SyncPage, syncPage);
   syncRelayPage = new CoreConfigWizardPages::SyncRelayPage(this);
   connect(syncRelayPage, SIGNAL(startOver()), this, SLOT(startOver()));
@@ -59,6 +68,12 @@ CoreConfigWizard::CoreConfigWizard(const QList<QVariant> &backends, QWidget *par
 
   setWindowTitle(tr("Core Configuration Wizard"));
   setPixmap(QWizard::LogoPixmap, DesktopIcon("quassel"));
 
   setWindowTitle(tr("Core Configuration Wizard"));
   setPixmap(QWizard::LogoPixmap, DesktopIcon("quassel"));
+
+  connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
+  connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));
+  //connect(connection, SIGNAL(loginSuccess()), SLOT(loginSuccess()));
+  connect(connection, SIGNAL(synchronized()), SLOT(syncFinished()));
+  connect(this, SIGNAL(rejected()), connection, SLOT(disconnectFromCore()));
 }
 
 QHash<QString, QVariant> CoreConfigWizard::backends() const {
 }
 
 QHash<QString, QVariant> CoreConfigWizard::backends() const {
@@ -75,18 +90,14 @@ void CoreConfigWizard::prepareCoreSetup(const QString &backend, const QVariantMa
   foo["AdminPasswd"] = field("adminUser.password").toString();
   foo["Backend"] = backend;
   foo["ConnectionProperties"] = properties;
   foo["AdminPasswd"] = field("adminUser.password").toString();
   foo["Backend"] = backend;
   foo["ConnectionProperties"] = properties;
-  emit setupCore(foo);
+  coreConnection()->doCoreSetup(foo);
 }
 
 void CoreConfigWizard::coreSetupSuccess() {
   syncPage->setStatus(tr("Your core has been successfully configured. Logging you in..."));
   syncPage->setError(false);
   syncRelayPage->setMode(CoreConfigWizardPages::SyncRelayPage::Error);
 }
 
 void CoreConfigWizard::coreSetupSuccess() {
   syncPage->setStatus(tr("Your core has been successfully configured. Logging you in..."));
   syncPage->setError(false);
   syncRelayPage->setMode(CoreConfigWizardPages::SyncRelayPage::Error);
-  QVariantMap loginData;
-  loginData["User"] = field("adminUser.user");
-  loginData["Password"] = field("adminUser.password");
-  loginData["RememberPasswd"] = field("adminUser.rememberPasswd");
-  emit loginToCore(loginData);
+  coreConnection()->loginToCore(field("adminUser.user").toString(), field("adminUser.password").toString(), field("adminUser.rememberPasswd").toBool());
 }
 
 void CoreConfigWizard::coreSetupFailed(const QString &error) {
 }
 
 void CoreConfigWizard::coreSetupFailed(const QString &error) {
@@ -112,8 +123,7 @@ void CoreConfigWizard::loginSuccess() {
 }
 
 void CoreConfigWizard::syncFinished() {
 }
 
 void CoreConfigWizard::syncFinished() {
-  // TODO: display identities and networks settings if appropriate!
-  // accept();
+  accept();
 }
 
 namespace CoreConfigWizardPages {
 }
 
 namespace CoreConfigWizardPages {
@@ -201,22 +211,22 @@ QVariantMap StorageSelectionPage::connectionProperties() const {
       QWidget *widget = _connectionBox->findChild<QWidget *>(key);
       QVariant def;
       if(defaults.contains(key)) {
       QWidget *widget = _connectionBox->findChild<QWidget *>(key);
       QVariant def;
       if(defaults.contains(key)) {
-       def = defaults[key];
+        def = defaults[key];
       }
       switch(def.type()) {
       case QVariant::Int:
       }
       switch(def.type()) {
       case QVariant::Int:
-       {
-         QSpinBox *spinbox = qobject_cast<QSpinBox *>(widget);
-         Q_ASSERT(spinbox);
-         def = QVariant(spinbox->value());
-       }
-       break;
+        {
+          QSpinBox *spinbox = qobject_cast<QSpinBox *>(widget);
+          Q_ASSERT(spinbox);
+          def = QVariant(spinbox->value());
+        }
+        break;
       default:
       default:
-       {
-         QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
-         Q_ASSERT(lineEdit);
-         def = QVariant(lineEdit->text());
-       }
+        {
+          QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
+          Q_ASSERT(lineEdit);
+          def = QVariant(lineEdit->text());
+        }
       }
       properties[key] = def;
     }
       }
       properties[key] = def;
     }
@@ -271,25 +281,25 @@ void StorageSelectionPage::on_backendList_currentIndexChanged() {
       QWidget *widget = 0;
       QVariant def;
       if(defaults.contains(key)) {
       QWidget *widget = 0;
       QVariant def;
       if(defaults.contains(key)) {
-       def = defaults[key];
+        def = defaults[key];
       }
       switch(def.type()) {
       case QVariant::Int:
       }
       switch(def.type()) {
       case QVariant::Int:
-       {
-         QSpinBox *spinbox = new QSpinBox(propertyBox);
-         spinbox->setMaximum(64000);
-         spinbox->setValue(def.toInt());
-         widget = spinbox;
-       }
-       break;
+        {
+          QSpinBox *spinbox = new QSpinBox(propertyBox);
+          spinbox->setMaximum(64000);
+          spinbox->setValue(def.toInt());
+          widget = spinbox;
+        }
+        break;
       default:
       default:
-       {
-         QLineEdit *lineEdit = new QLineEdit(def.toString(), propertyBox);
-         if(key.toLower().contains("password")) {
-           lineEdit->setEchoMode(QLineEdit::Password);
-         }
-         widget = lineEdit;
-       }
+        {
+          QLineEdit *lineEdit = new QLineEdit(def.toString(), propertyBox);
+          if(key.toLower().contains("password")) {
+            lineEdit->setEchoMode(QLineEdit::Password);
+          }
+          widget = lineEdit;
+        }
       }
       widget->setObjectName(key);
       formlayout->addRow(key + ":", widget);
       }
       widget->setObjectName(key);
       formlayout->addRow(key + ":", widget);
index 91b532f..b6d9de8 100644 (file)
@@ -30,6 +30,8 @@
 #include "ui_coreconfigwizardstorageselectionpage.h"
 #include "ui_coreconfigwizardsyncpage.h"
 
 #include "ui_coreconfigwizardstorageselectionpage.h"
 #include "ui_coreconfigwizardsyncpage.h"
 
+class CoreConnection;
+
 namespace CoreConfigWizardPages {
   class SyncPage;
   class SyncRelayPage;
 namespace CoreConfigWizardPages {
   class SyncPage;
   class SyncRelayPage;
@@ -49,12 +51,14 @@ class CoreConfigWizard : public QWizard {
       ConclusionPage
     };
 
       ConclusionPage
     };
 
-    CoreConfigWizard(const QList<QVariant> &backends, QWidget *parent = 0);
+    CoreConfigWizard(CoreConnection *connection, const QList<QVariant> &backends, QWidget *parent = 0);
     QHash<QString, QVariant> backends() const;
 
     QHash<QString, QVariant> backends() const;
 
+    inline CoreConnection *coreConnection() const { return _connection; }
+
   signals:
     void setupCore(const QVariant &setupData);
   signals:
     void setupCore(const QVariant &setupData);
-    void loginToCore(const QVariantMap &loginData);
+    void loginToCore(const QString &user, const QString &password, bool rememberPassword);
 
   public slots:
     void loginSuccess();
 
   public slots:
     void loginSuccess();
@@ -70,6 +74,8 @@ class CoreConfigWizard : public QWizard {
     QHash<QString, QVariant> _backends;
     CoreConfigWizardPages::SyncPage *syncPage;
     CoreConfigWizardPages::SyncRelayPage *syncRelayPage;
     QHash<QString, QVariant> _backends;
     CoreConfigWizardPages::SyncPage *syncPage;
     CoreConfigWizardPages::SyncRelayPage *syncRelayPage;
+
+    CoreConnection *_connection;
 };
 
 namespace CoreConfigWizardPages {
 };
 
 namespace CoreConfigWizardPages {
index 6312749..24d9ac6 100644 (file)
@@ -55,6 +55,7 @@
 #include "clientbufferviewconfig.h"
 #include "clientbufferviewmanager.h"
 #include "clientignorelistmanager.h"
 #include "clientbufferviewconfig.h"
 #include "clientbufferviewmanager.h"
 #include "clientignorelistmanager.h"
+#include "coreconfigwizard.h"
 #include "coreconnectdlg.h"
 #include "coreconnection.h"
 #include "coreconnectionstatuswidget.h"
 #include "coreconnectdlg.h"
 #include "coreconnection.h"
 #include "coreconnectionstatuswidget.h"
@@ -160,6 +161,8 @@ void MainWin::init() {
            SLOT(messagesInserted(const QModelIndex &, int, int)));
   connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId)));
   connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
            SLOT(messagesInserted(const QModelIndex &, int, int)));
   connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId)));
   connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString)));
+
+  connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList)), SLOT(showCoreConfigWizard(QVariantList)));
   connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString)));
   connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount *, bool *, QString)), SLOT(userAuthenticationRequired(CoreAccount *, bool *, QString)));
   connect(Client::coreConnection(), SIGNAL(handleNoSslInClient(bool*)), SLOT(handleNoSslInClient(bool *)));
   connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString)));
   connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount *, bool *, QString)), SLOT(userAuthenticationRequired(CoreAccount *, bool *, QString)));
   connect(Client::coreConnection(), SIGNAL(handleNoSslInClient(bool*)), SLOT(handleNoSslInClient(bool *)));
@@ -882,6 +885,12 @@ void MainWin::showCoreConnectionDlg() {
   }
 }
 
   }
 }
 
+void MainWin::showCoreConfigWizard(const QVariantList &backends) {
+  CoreConfigWizard *wizard = new CoreConfigWizard(Client::coreConnection(), backends, this);
+
+  wizard->show();
+}
+
 void MainWin::showChannelList(NetworkId netId) {
   ChannelListDlg *channelListDlg = new ChannelListDlg();
 
 void MainWin::showChannelList(NetworkId netId) {
   ChannelListDlg *channelListDlg = new ChannelListDlg();
 
index 8caa8b3..bc4ba1e 100644 (file)
@@ -119,6 +119,7 @@ class MainWin
     void showAboutDlg();
     void showChannelList(NetworkId netId = NetworkId());
     void showCoreConnectionDlg();
     void showAboutDlg();
     void showChannelList(NetworkId netId = NetworkId());
     void showCoreConnectionDlg();
+    void showCoreConfigWizard(const QVariantList &);
     void showCoreInfoDlg();
     void showAwayLog();
     void showSettingsDlg();
     void showCoreInfoDlg();
     void showAwayLog();
     void showSettingsDlg();
index 261d5f8..e55859f 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>CoreConfigWizardAdminUserPage</class>
  <class>CoreConfigWizardAdminUserPage</class>
- <widget class="QWidget" name="CoreConfigWizardAdminUserPage" >
-  <property name="geometry" >
+ <widget class="QWidget" name="CoreConfigWizardAdminUserPage">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
    <rect>
     <x>0</x>
     <y>0</y>
     <height>273</height>
    </rect>
   </property>
     <height>273</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Form</string>
   </property>
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" >
+  <layout class="QVBoxLayout">
    <item>
    <item>
-    <layout class="QGridLayout" >
-     <item row="0" column="0" >
-      <widget class="QLabel" name="label_2" >
-       <property name="text" >
+    <layout class="QGridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label_2">
+       <property name="text">
         <string>Username:</string>
        </property>
       </widget>
      </item>
         <string>Username:</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QLineEdit" name="user" />
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="user"/>
      </item>
      </item>
-     <item row="1" column="0" >
-      <widget class="QLabel" name="label_3" >
-       <property name="text" >
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
         <string>Password:</string>
        </property>
       </widget>
      </item>
         <string>Password:</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="1" >
-      <widget class="QLineEdit" name="password" >
-       <property name="echoMode" >
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="password">
+       <property name="echoMode">
         <enum>QLineEdit::Password</enum>
        </property>
       </widget>
      </item>
         <enum>QLineEdit::Password</enum>
        </property>
       </widget>
      </item>
-     <item row="2" column="0" >
-      <widget class="QLabel" name="label_4" >
-       <property name="text" >
+     <item row="2" column="0">
+      <widget class="QLabel" name="label_4">
+       <property name="text">
         <string>Repeat password:</string>
        </property>
       </widget>
      </item>
         <string>Repeat password:</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="1" >
-      <widget class="QLineEdit" name="password2" >
-       <property name="echoMode" >
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="password2">
+       <property name="echoMode">
         <enum>QLineEdit::Password</enum>
        </property>
       </widget>
      </item>
         <enum>QLineEdit::Password</enum>
        </property>
       </widget>
      </item>
-     <item row="3" column="1" >
-      <widget class="QCheckBox" name="rememberPasswd" >
-       <property name="text" >
+     <item row="3" column="1">
+      <widget class="QCheckBox" name="rememberPasswd">
+       <property name="text">
         <string>Remember password</string>
        </property>
       </widget>
         <string>Remember password</string>
        </property>
       </widget>
     </layout>
    </item>
    <item>
     </layout>
    </item>
    <item>
-    <widget class="QLabel" name="label" >
-     <property name="text" >
-      <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;">&lt;span style=" font-size:10pt; font-weight:600;">Note: &lt;/span>&lt;span style=" font-size:10pt;">Adding more users and changing your username/password is not possible via Quassel's interface yet.&lt;/span>&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:10pt;">If you need to do these things have a look at the manageusers.py script which is located in the /scripts directory.&lt;/p>&lt;/body>&lt;/html></string>
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>&lt;b&gt;Note:&lt;/b&gt; Adding more users and changing your username/password is not possible via Quassel's client interface yet.
+If you need to do these things, please run &quot;&lt;tt&gt;&lt;nobr&gt;quasselcore --help&lt;/nobr&gt;&lt;/tt&gt;&quot;.</string>
      </property>
      </property>
-     <property name="alignment" >
+     <property name="alignment">
       <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
      </property>
       <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
      </property>
-     <property name="wordWrap" >
+     <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <spacer>
       <bool>true</bool>
      </property>
     </widget>
    </item>
    <item>
     <spacer>
-     <property name="orientation" >
+     <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>405</width>
        <height>51</height>
       <size>
        <width>405</width>
        <height>51</height>