changeset 2:fee291c8d42a

settings: profiles management first draft
author Goffi <goffi@goffi.org>
date Mon, 08 Aug 2011 10:30:23 +0200
parents 2e015f69f756
children 2195295a2058
files bellaciao.cpp bellaciao.h bellaciao.pro main_win.ui parameters.cpp parameters.h parameters_win.ui session.cpp session.h settings.cpp settings.h settings.ui
diffstat 12 files changed, 553 insertions(+), 259 deletions(-) [+]
line wrap: on
line diff
--- a/bellaciao.cpp	Sat Aug 06 15:38:00 2011 +0200
+++ b/bellaciao.cpp	Mon Aug 08 10:30:23 2011 +0200
@@ -17,7 +17,7 @@
 */
 
 #include "bellaciao.h"
-#include "parameters.h"
+#include "settings.h"
 
 Bellaciao::Bellaciao()
     :QMainWindow(0)
@@ -26,10 +26,14 @@
 
     //Ui
     setupUi(this);
+    const QString & media_dir = m_bridge->getConfig("", "media_dir");
+    setWindowIcon(QIcon(media_dir+"/icons/apps/32/sat.png"));
     m_contactList = new ContactList(this);
+    
 
     //Signals & Slots
-    connect(actionParameters, SIGNAL(triggered()), this, SLOT(showParameters()));
+    connect(actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
+    connect(actionQuit, SIGNAL(triggered()), this, SLOT(quit()));
 
 
     addDockWidget(Qt::LeftDockWidgetArea, m_contactList);
@@ -39,7 +43,6 @@
     QList<MenuT> menus = m_bridge->getMenus();
     foreach(const MenuT &menu, menus)
         qDebug() << menu.name;
-    StringDict waiting=m_bridge->getWaitingSub("jabberfr");
 
     QList<ContactT> contacts = m_bridge->getContacts("jabberfr");
 
@@ -50,26 +53,26 @@
 
 }
 
-void Bellaciao::disconnect()
+void Bellaciao::quit()
 {
     if ( QMessageBox::question (
             this,
-            tr("Disconnect?"),
-            tr("Do you really want to disconnect ?"),
+            tr("Quit?"),
+            tr("Do you really want to quit ?"),
             QMessageBox::Yes | QMessageBox::No,
             QMessageBox::No
             ) == QMessageBox::Yes
        )
     {
-        m_bridge->disconnect("jabberfr");
+        qApp->quit();
     }
 }
 
-void Bellaciao::showParameters()
+void Bellaciao::showSettings()
 {
-    qDebug("Show parameters");
-    ParametersWin *params = new ParametersWin();
-    params->show();
+    qDebug("Show settings");
+    Settings::getDialog()->show();
+    Settings::getDialog()->raise();
 }
 
 void Bellaciao::on_actionToggle_fullscreen_triggered()
--- a/bellaciao.h	Sat Aug 06 15:38:00 2011 +0200
+++ b/bellaciao.h	Mon Aug 08 10:30:23 2011 +0200
@@ -34,8 +34,8 @@
         
 
     private slots:
-        void disconnect();
-        void showParameters();
+        void quit();
+        void showSettings();
         void on_actionToggle_fullscreen_triggered();
 
     private:
--- a/bellaciao.pro	Sat Aug 06 15:38:00 2011 +0200
+++ b/bellaciao.pro	Mon Aug 08 10:30:23 2011 +0200
@@ -7,8 +7,9 @@
 DEPENDPATH += .
 INCLUDEPATH += .
 QT += dbus
+CONFIG += debug
 
 # Input
-HEADERS += bellaciao.h contact_list.h dbus_bridge.h dbus_types.h bridge.h parameters.h
-SOURCES += main.cpp bellaciao.cpp contact_list.cpp dbus_bridge.cpp dbus_types.cpp bridge.cpp parameters.cpp
-FORMS += main_win.ui parameters_win.ui
+HEADERS += bellaciao.h contact_list.h dbus_bridge.h dbus_types.h bridge.h settings.h session.h
+SOURCES += main.cpp bellaciao.cpp contact_list.cpp dbus_bridge.cpp dbus_types.cpp bridge.cpp settings.cpp session.cpp
+FORMS += main_win.ui settings.ui
--- a/main_win.ui	Sat Aug 06 15:38:00 2011 +0200
+++ b/main_win.ui	Mon Aug 08 10:30:23 2011 +0200
@@ -47,7 +47,7 @@
     <property name="title">
      <string>General</string>
     </property>
-    <addaction name="actionParameters"/>
+    <addaction name="actionSettings"/>
     <addaction name="actionToggle_fullscreen"/>
     <addaction name="separator"/>
     <addaction name="actionQuit"/>
@@ -55,9 +55,9 @@
    <addaction name="menuGeneral"/>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
-  <action name="actionParameters">
+  <action name="actionSettings">
    <property name="text">
-    <string>Parameters</string>
+    <string>Settings</string>
    </property>
   </action>
   <action name="actionOpen">
--- a/parameters.cpp	Sat Aug 06 15:38:00 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-Bellaciao: a Salut à Toi frontend
-Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "parameters.h"
-
-ParametersWin :: ParametersWin(QWidget *parent)
-    : QWidget(parent)
-{
-    setupUi(this);
-
-    //We fill the profiles list
-    m_bridge = Bridge::getBridge();
-    const QList<QString>& profiles = m_bridge->getProfilesList();
-    foreach(const QString& profile, profiles)
-        new QListWidgetItem(profile, profileList);
-
-}
-
--- a/parameters.h	Sat Aug 06 15:38:00 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-Bellaciao: a Salut à Toi frontend
-Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef PARAMETERS_H
-#define PARAMETERS_H
-
-
-#include <QtGui>
-#include "ui_parameters_win.h"
-#include "bridge.h"
-
-class ParametersWin : public QWidget, private Ui::ParametersWin
-{
-    Q_OBJECT
-
-    public:
-        ParametersWin(QWidget *parent = 0);
-
-    private:
-        Bridge* m_bridge;
-
-};
-
-
-
-
-#endif
--- a/parameters_win.ui	Sat Aug 06 15:38:00 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ParametersWin</class>
- <widget class="QWidget" name="ParametersWin">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <item>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>Profiles</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QWidget" name="widget" native="true">
-         <layout class="QHBoxLayout" name="horizontalLayout">
-          <item>
-           <widget class="QListWidget" name="profileList"/>
-          </item>
-          <item>
-           <widget class="QWidget" name="widget_2" native="true">
-            <layout class="QVBoxLayout" name="verticalLayout_3">
-             <item>
-              <widget class="QWidget" name="widget_3" native="true">
-               <layout class="QFormLayout" name="formLayout">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label">
-                  <property name="text">
-                   <string>jid</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLineEdit" name="lineEdit"/>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="label_2">
-                  <property name="text">
-                   <string>Password</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLineEdit" name="lineEdit_2"/>
-                </item>
-               </layout>
-              </widget>
-             </item>
-             <item>
-              <widget class="QGroupBox" name="groupBox_2">
-               <property name="title">
-                <string>Custom Server</string>
-               </property>
-               <property name="checkable">
-                <bool>true</bool>
-               </property>
-               <property name="checked">
-                <bool>false</bool>
-               </property>
-               <layout class="QFormLayout" name="formLayout_2">
-                <property name="fieldGrowthPolicy">
-                 <enum>QFormLayout::ExpandingFieldsGrow</enum>
-                </property>
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label_5">
-                  <property name="text">
-                   <string>Server</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLineEdit" name="lineEdit_5"/>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="label_6">
-                  <property name="text">
-                   <string>Port</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLineEdit" name="lineEdit_6"/>
-                </item>
-                <item row="2" column="1">
-                 <spacer name="verticalSpacer">
-                  <property name="orientation">
-                   <enum>Qt::Vertical</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>20</width>
-                    <height>40</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
-               </layout>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <widget class="QWidget" name="widget_4" native="true">
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <item>
-           <widget class="QPushButton" name="pushButton">
-            <property name="text">
-             <string>New</string>
-            </property>
-            <property name="checkable">
-             <bool>false</bool>
-            </property>
-            <property name="checked">
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="pushButton_2">
-            <property name="text">
-             <string>Delete</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="pushButton_3">
-            <property name="text">
-             <string>Set as default</string>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="title">
-       <string>Contact list layout</string>
-      </attribute>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/session.cpp	Mon Aug 08 10:30:23 2011 +0200
@@ -0,0 +1,36 @@
+/*
+Bellaciao: a Salut à Toi frontend
+Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "session.h"
+
+Session* Session::_instance = 0;
+
+
+Session::Session()
+{
+}
+
+Session* Session::getSession()
+{
+    if (_instance == 0)
+        _instance = new Session;
+
+    return _instance;
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/session.h	Mon Aug 08 10:30:23 2011 +0200
@@ -0,0 +1,36 @@
+/*
+Bellaciao: a Salut à Toi frontend
+Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SESSION_H
+#define SESSION_H
+
+class Session
+{
+public:
+    static Session* getSession();
+
+protected:
+    Session();
+
+private:
+    static Session* _instance;
+};
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/settings.cpp	Mon Aug 08 10:30:23 2011 +0200
@@ -0,0 +1,175 @@
+/*
+Bellaciao: a Salut à Toi frontend
+Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "settings.h"
+
+using namespace Qt;
+
+Settings* Settings::_instance = 0;
+
+ProfileListWidgetItem::ProfileListWidgetItem(const QString & profile, QListWidget * parent, bool isDefault)
+    :QListWidgetItem(profile, parent)
+{
+    m_profile = profile;
+    if (isDefault) {
+        setText(text() + QObject::tr(" (default)"));
+        QFont _font = font();
+        _font.setWeight(QFont::Bold);
+        setFont(_font);
+    }
+
+}
+
+const QString& ProfileListWidgetItem::getProfile()
+{
+    return m_profile;
+}
+
+Settings::Settings(QWidget *parent)
+    : QWidget(parent)
+{
+    setupUi(this);
+
+    this->setAttribute(WA_DeleteOnClose);
+
+    //We fill the profiles list
+    m_bridge = Bridge::getBridge();
+    const QList<QString>& profiles = m_bridge->getProfilesList();
+    const QString& default_profile = m_bridge->getProfileName("@DEFAULT@");
+    foreach(const QString& profile, profiles) {
+        ProfileListWidgetItem *item = new ProfileListWidgetItem(profile, profileList, profile==default_profile);
+        item->setFlags(item->flags() | ItemIsUserCheckable);
+        item->setCheckState(Checked);
+    }
+    
+    connect(profileList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(profileChanged(QListWidgetItem*)));
+    connect(profileList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(profileCurrentChanged(QListWidgetItem*, QListWidgetItem*)));
+
+    //Profiles manipulation buttons
+    connect(buttonsGroupConfirm, SIGNAL(accepted()), this, SLOT(saveSettings()));
+
+    //Confirmation buttons
+    connect(buttonsGroupConfirm, SIGNAL(accepted()), this, SLOT(saveSettings()));
+    connect(buttonsGroupConfirm, SIGNAL(rejected()), this, SLOT(cancelSettings()));
+}
+
+Settings::~Settings()
+{
+    _instance = 0;
+}
+
+Settings* Settings::getDialog() {
+    if (_instance == 0) {
+        _instance = new Settings;
+    }
+    
+    return _instance;
+}
+
+//Profile settings slots
+void Settings::profileChanged(QListWidgetItem* item)
+{
+    qDebug() << "profileChanged";
+}
+
+void Settings::profileCurrentChanged(QListWidgetItem* current, QListWidgetItem* previous)
+{
+    if (!current) {
+        profileData->setEnabled(false);
+        customServerGroup->setEnabled(false);
+        customServerGroup->setChecked(false);
+        buttonDelete->setEnabled(false);
+        buttonSetDefault->setEnabled(false);
+        jidField->clear();
+        passwordField->clear();
+        serverField->clear();
+        portField->clear();
+        return;
+    }
+
+    ProfileListWidgetItem *item = dynamic_cast<ProfileListWidgetItem*>(current);
+
+    profileData->setEnabled(true);
+    customServerGroup->setEnabled(true);
+    jidField->setEnabled(true);
+    passwordField->setEnabled(true);
+    buttonDelete->setEnabled(true);
+    buttonSetDefault->setEnabled(true);
+    const QString& jid = m_bridge->getParamA("JabberID", "Connection", "value", item->getProfile());
+    const QString& password = m_bridge->getParamA("Password", "Connection", "value", item->getProfile());
+    jidField->setText(jid);
+    passwordField->setText(password);
+}
+
+
+void Settings::on_buttonNew_clicked() {
+    bool ok;
+    QString name = QInputDialog::getText(this, tr("New profile"), tr("Please enter profile name: "), QLineEdit::Normal, QString(), &ok);
+    if (ok && !name.isEmpty()) {
+        int success = m_bridge->createProfile(name);
+        ProfileListWidgetItem *item;
+        
+        switch (success) {
+            case 0: //success
+                item = new ProfileListWidgetItem(name, profileList);
+                item->setFlags(item->flags() | ItemIsUserCheckable);
+                item->setCheckState(Checked);
+                break;
+            case 1: //profile name conflict
+                QMessageBox::warning(this, tr("Profile name conflict"), tr("A profile with this name already exists. Please choose an other name"));
+                break;
+            default:
+                QMessageBox::warning(this, tr("Profile creation error"), tr("Can't create profile"));
+                
+        }
+    }
+}
+
+
+void Settings::on_buttonDelete_clicked() {
+    ProfileListWidgetItem *item = dynamic_cast<ProfileListWidgetItem*>(profileList->currentItem());
+
+    if ( QMessageBox::question (
+            this,
+            tr("Delete profile?"),
+            tr("Do you really want to delete profile \"%1\" ?").arg(item->getProfile()),
+            QMessageBox::Yes | QMessageBox::No,
+            QMessageBox::No
+            ) == QMessageBox::Yes
+       )
+    {
+        int success = m_bridge->deleteProfile(item->getProfile());
+        if (success==0)
+            delete(item);
+        else
+            QMessageBox::warning(this, tr("Profile deletion error"), tr("Can't delete profile"));
+    }
+
+    
+}
+
+
+//Global settings slots
+void Settings::saveSettings()
+{
+}
+
+void Settings::cancelSettings()
+{
+    this->close();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/settings.h	Mon Aug 08 10:30:23 2011 +0200
@@ -0,0 +1,65 @@
+/*
+Bellaciao: a Salut à Toi frontend
+Copyright (C) 2011  Jérôme Poisson (goffi@goffi.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+
+#include <QtGui>
+#include "ui_settings.h"
+#include "bridge.h"
+
+class ProfileListWidgetItem : public QListWidgetItem
+{
+
+    public:
+        ProfileListWidgetItem(const QString & profile, QListWidget * parent, bool isDefault=false);
+        const QString& getProfile();
+    private:
+        QString m_profile;
+};
+
+class Settings : public QWidget, private Ui::SettingsDlg
+{
+    Q_OBJECT
+
+    public:
+        ~Settings();
+        static Settings* getDialog();
+
+
+    private slots:
+        void profileChanged(QListWidgetItem* item);
+        void profileCurrentChanged(QListWidgetItem* current, QListWidgetItem* previous);
+        void on_buttonNew_clicked();
+        void on_buttonDelete_clicked();
+        void saveSettings();
+        void cancelSettings();
+   
+    protected:
+        Settings(QWidget *parent = 0);
+    
+    private:
+        static Settings* _instance;
+        Bridge* m_bridge;
+
+};
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/settings.ui	Mon Aug 08 10:30:23 2011 +0200
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SettingsDlg</class>
+ <widget class="QWidget" name="SettingsDlg">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>629</width>
+    <height>360</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>Profiles</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QWidget" name="widget" native="true">
+         <layout class="QHBoxLayout" name="horizontalLayout">
+          <item>
+           <widget class="QWidget" name="widget_5" native="true">
+            <layout class="QVBoxLayout" name="verticalLayout_4">
+             <item>
+              <widget class="QLabel" name="label_3">
+               <property name="text">
+                <string>Check profiles you want to use</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignCenter</set>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QListWidget" name="profileList">
+               <property name="sortingEnabled">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
+          <item>
+           <widget class="QWidget" name="widget_2" native="true">
+            <layout class="QVBoxLayout" name="verticalLayout_3">
+             <item>
+              <widget class="QWidget" name="profileData" native="true">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <layout class="QFormLayout" name="formLayout">
+                <item row="0" column="0">
+                 <widget class="QLabel" name="label">
+                  <property name="text">
+                   <string>jid</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="1">
+                 <widget class="QLineEdit" name="jidField">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="0">
+                 <widget class="QLabel" name="label_2">
+                  <property name="text">
+                   <string>Password</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="1">
+                 <widget class="QLineEdit" name="passwordField">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="echoMode">
+                   <enum>QLineEdit::Password</enum>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </widget>
+             </item>
+             <item>
+              <widget class="QGroupBox" name="customServerGroup">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="title">
+                <string>Custom Server</string>
+               </property>
+               <property name="checkable">
+                <bool>true</bool>
+               </property>
+               <property name="checked">
+                <bool>false</bool>
+               </property>
+               <layout class="QFormLayout" name="formLayout_2">
+                <property name="fieldGrowthPolicy">
+                 <enum>QFormLayout::ExpandingFieldsGrow</enum>
+                </property>
+                <item row="0" column="0">
+                 <widget class="QLabel" name="label_5">
+                  <property name="text">
+                   <string>Server</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="1">
+                 <widget class="QLineEdit" name="serverField"/>
+                </item>
+                <item row="1" column="0">
+                 <widget class="QLabel" name="label_6">
+                  <property name="text">
+                   <string>Port</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="1">
+                 <widget class="QLineEdit" name="portField"/>
+                </item>
+                <item row="2" column="1">
+                 <spacer name="verticalSpacer">
+                  <property name="orientation">
+                   <enum>Qt::Vertical</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>20</width>
+                    <height>40</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QWidget" name="widget_4" native="true">
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <widget class="QPushButton" name="buttonNew">
+            <property name="text">
+             <string>New</string>
+            </property>
+            <property name="checkable">
+             <bool>false</bool>
+            </property>
+            <property name="checked">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="buttonDelete">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+            <property name="text">
+             <string>Delete</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="buttonSetDefault">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+            <property name="text">
+             <string>Set as default</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>Contact list layout</string>
+      </attribute>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonsGroupConfirm">
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+     <property name="centerButtons">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>