Finally here: the long awaited auto reconnect! Your auto reconnect settings
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 18 Feb 2008 18:56:05 +0000 (18:56 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 18 Feb 2008 18:56:05 +0000 (18:56 +0000)
should now be honored - if they are not, please report :)

src/common/network.cpp
src/common/network.h
src/core/coresession.cpp
src/core/networkconnection.cpp
src/core/networkconnection.h
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/settingspages/networkssettingspage.h
src/qtui/settingspages/networkssettingspage.ui

index b565a78..7fa2a2a 100644 (file)
@@ -860,11 +860,16 @@ QDataStream &operator>>(QDataStream &in, NetworkInfo &info) {
   return in;
 }
 
   return in;
 }
 
-
-
-
-
-
+QDebug operator<<(QDebug dbg, const NetworkInfo &i) {
+  dbg.nospace() << "(id = " << i.networkId << " name = " << i.networkName << " identity = " << i.identity
+      << " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding
+      << " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform
+      << " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword
+      << " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval
+      << " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries
+      << " rejoinChannels = " << i.rejoinChannels << ")";
+  return dbg.space();
+}
 
 
 
 
 
 
index a64fb08..c52cd59 100644 (file)
@@ -68,7 +68,7 @@ class Network : public SyncableObject {
   Q_PROPERTY(bool rejoinChannels READ rejoinChannels WRITE setRejoinChannels STORED false)
 
 public:
   Q_PROPERTY(bool rejoinChannels READ rejoinChannels WRITE setRejoinChannels STORED false)
 
 public:
-  enum ConnectionState { Disconnected, Connecting, Initializing, Initialized, Disconnecting };
+  enum ConnectionState { Disconnected, Connecting, Initializing, Initialized, Reconnecting, Disconnecting };
 
   Network(const NetworkId &networkid, QObject *parent = 0);
   ~Network();
 
   Network(const NetworkId &networkid, QObject *parent = 0);
   ~Network();
@@ -234,7 +234,7 @@ signals:
   void autoIdentifyPasswordSet(const QString &);
   void useAutoReconnectSet(bool);
   void autoReconnectIntervalSet(quint32);
   void autoIdentifyPasswordSet(const QString &);
   void useAutoReconnectSet(bool);
   void autoReconnectIntervalSet(quint32);
-  void autoReconnectRetriesSet(qint16);
+  void autoReconnectRetriesSet(quint16);
   void unlimitedReconnectRetriesSet(bool);
   void rejoinChannelsSet(bool);
 
   void unlimitedReconnectRetriesSet(bool);
   void rejoinChannelsSet(bool);
 
@@ -340,6 +340,7 @@ struct NetworkInfo {
 
 QDataStream &operator<<(QDataStream &out, const NetworkInfo &info);
 QDataStream &operator>>(QDataStream &in, NetworkInfo &info);
 
 QDataStream &operator<<(QDataStream &out, const NetworkInfo &info);
 QDataStream &operator>>(QDataStream &in, NetworkInfo &info);
+QDebug operator<<(QDebug dbg, const NetworkInfo &i);
 
 Q_DECLARE_METATYPE(NetworkInfo);
 
 
 Q_DECLARE_METATYPE(NetworkInfo);
 
index 22ed212..23456ab 100644 (file)
@@ -230,7 +230,7 @@ void CoreSession::connectToNetwork(NetworkId id, const QVariant &previousState)
 
 void CoreSession::attachNetworkConnection(NetworkConnection *conn) {
   connect(conn, SIGNAL(connected(NetworkId)), this, SLOT(networkConnected(NetworkId)));
 
 void CoreSession::attachNetworkConnection(NetworkConnection *conn) {
   connect(conn, SIGNAL(connected(NetworkId)), this, SLOT(networkConnected(NetworkId)));
-  connect(conn, SIGNAL(disconnected(NetworkId)), this, SLOT(networkDisconnected(NetworkId)));
+  connect(conn, SIGNAL(quitRequested(NetworkId)), this, SLOT(networkDisconnected(NetworkId)));
 
   // I guess we don't need these anymore, client-side can just connect the network's signals directly
   //signalProxy()->attachSignal(conn, SIGNAL(connected(NetworkId)), SIGNAL(networkConnected(NetworkId)));
 
   // I guess we don't need these anymore, client-side can just connect the network's signals directly
   //signalProxy()->attachSignal(conn, SIGNAL(connected(NetworkId)), SIGNAL(networkConnected(NetworkId)));
@@ -272,11 +272,8 @@ void CoreSession::networkConnected(NetworkId networkid) {
   Core::bufferInfo(user(), networkid, BufferInfo::StatusBuffer); // create status buffer
 }
 
   Core::bufferInfo(user(), networkid, BufferInfo::StatusBuffer); // create status buffer
 }
 
+// called now only on /quit and requested disconnects, not on normal disconnects!
 void CoreSession::networkDisconnected(NetworkId networkid) {
 void CoreSession::networkDisconnected(NetworkId networkid) {
-  // FIXME
-  // connection should only go away on explicit /part, and handle reconnections etcpp internally otherwise
-
-  //Q_ASSERT(_connections.contains(networkid));
   if(_connections.contains(networkid)) _connections.take(networkid)->deleteLater();
 }
 
   if(_connections.contains(networkid)) _connections.take(networkid)->deleteLater();
 }
 
@@ -448,7 +445,7 @@ void CoreSession::updateNetwork(const NetworkInfo &info) {
     qWarning() << "Update request for unknown network received!";
     return;
   }
     qWarning() << "Update request for unknown network received!";
     return;
   }
-  _networks[info.networkId]->setNetworkInfo(info); qDebug() << "unlim" << info.unlimitedReconnectRetries << _networks[info.networkId]->unlimitedReconnectRetries();
+  _networks[info.networkId]->setNetworkInfo(info);
   Core::updateNetwork(user(), info);
 }
 
   Core::updateNetwork(user(), info);
 }
 
index 3799e03..24238de 100644 (file)
@@ -43,9 +43,16 @@ NetworkConnection::NetworkConnection(Network *network, CoreSession *session, con
     _ircServerHandler(new IrcServerHandler(this)),
     _userInputHandler(new UserInputHandler(this)),
     _ctcpHandler(new CtcpHandler(this)),
     _ircServerHandler(new IrcServerHandler(this)),
     _userInputHandler(new UserInputHandler(this)),
     _ctcpHandler(new CtcpHandler(this)),
-    _previousState(state)
+    _previousState(state),
+    _autoReconnectCount(0)
 {
 {
+  _autoReconnectTimer.setSingleShot(true);
+  connect(&_autoReconnectTimer, SIGNAL(timeout()), this, SLOT(doAutoReconnect()));
+
   connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(networkInitialized(const QString &)));
   connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(networkInitialized(const QString &)));
+  connect(network, SIGNAL(useAutoReconnectSet(bool)), this, SLOT(autoReconnectSettingsChanged()));
+  connect(network, SIGNAL(autoReconnectIntervalSet(quint32)), this, SLOT(autoReconnectSettingsChanged()));
+  connect(network, SIGNAL(autoReconnectRetriesSet(quint16)), this, SLOT(autoReconnectSettingsChanged()));
 
   connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected()));
   connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
 
   connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected()));
   connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
@@ -56,7 +63,8 @@ NetworkConnection::NetworkConnection(Network *network, CoreSession *session, con
 }
 
 NetworkConnection::~NetworkConnection() {
 }
 
 NetworkConnection::~NetworkConnection() {
-  disconnectFromIrc();
+  if(connectionState() != Network::Disconnected && connectionState() != Network::Reconnecting)
+    disconnectFromIrc();
   delete _ircServerHandler;
   delete _userInputHandler;
   delete _ctcpHandler;
   delete _ircServerHandler;
   delete _userInputHandler;
   delete _ctcpHandler;
@@ -145,8 +153,25 @@ QByteArray NetworkConnection::userEncode(const QString &userNick, const QString
   return network()->encodeString(string);
 }
 
   return network()->encodeString(string);
 }
 
+void NetworkConnection::autoReconnectSettingsChanged() {
+  if(!network()->useAutoReconnect()) {
+    _autoReconnectTimer.stop();
+    _autoReconnectCount = 0;
+  } else {
+    _autoReconnectTimer.setInterval(network()->autoReconnectInterval() * 1000);
+    if(_autoReconnectCount != 0) {
+      if(network()->unlimitedReconnectRetries()) _autoReconnectCount = -1;
+      else _autoReconnectCount = network()->autoReconnectRetries();
+    }
+  }
+}
 
 
-void NetworkConnection::connectToIrc() {
+void NetworkConnection::connectToIrc(bool reconnecting) {
+  if(!reconnecting && network()->useAutoReconnect() && _autoReconnectCount == 0) {
+    _autoReconnectTimer.setInterval(network()->autoReconnectInterval() * 1000);
+    if(network()->unlimitedReconnectRetries()) _autoReconnectCount = -1;
+    else _autoReconnectCount = network()->autoReconnectRetries();
+  }
   QVariantList serverList = network()->serverList();
   Identity *identity = coreSession()->identity(network()->identity());
   if(!serverList.count()) {
   QVariantList serverList = network()->serverList();
   Identity *identity = coreSession()->identity(network()->identity());
   if(!serverList.count()) {
@@ -160,13 +185,18 @@ void NetworkConnection::connectToIrc() {
   // TODO implement cycling / random servers
   QString host = serverList[0].toMap()["Host"].toString();
   quint16 port = serverList[0].toMap()["Port"].toUInt();
   // TODO implement cycling / random servers
   QString host = serverList[0].toMap()["Host"].toString();
   quint16 port = serverList[0].toMap()["Port"].toUInt();
-  displayStatusMsg(QString("Connecting to %1:%2...").arg(host).arg(port));
+  displayStatusMsg(tr("Connecting to %1:%2...").arg(host).arg(port));
+  displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Connecting to %1:%2...").arg(host).arg(port));
   socket.connectToHost(host, port);
 }
 
 void NetworkConnection::networkInitialized(const QString &currentServer) {
   if(currentServer.isEmpty()) return;
 
   socket.connectToHost(host, port);
 }
 
 void NetworkConnection::networkInitialized(const QString &currentServer) {
   if(currentServer.isEmpty()) return;
 
+  if(network()->useAutoReconnect() && !network()->unlimitedReconnectRetries()) {
+    _autoReconnectCount = network()->autoReconnectRetries(); // reset counter
+  }
+
   sendPerform();
 
     // rejoin channels we've been in
   sendPerform();
 
     // rejoin channels we've been in
@@ -204,6 +234,9 @@ QVariant NetworkConnection::state() const {
 }
 
 void NetworkConnection::disconnectFromIrc() {
 }
 
 void NetworkConnection::disconnectFromIrc() {
+  _autoReconnectTimer.stop();
+  _autoReconnectCount = 0;
+  displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Disconnecting."));
   if(socket.state() < QAbstractSocket::ConnectedState) {
     setConnectionState(Network::Disconnected);
     socketDisconnected();
   if(socket.state() < QAbstractSocket::ConnectedState) {
     setConnectionState(Network::Disconnected);
     socketDisconnected();
@@ -222,6 +255,10 @@ void NetworkConnection::socketError(QAbstractSocket::SocketError) {
   emit connectionError(socket.errorString());
   emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
   network()->emitConnectionError(socket.errorString());
   emit connectionError(socket.errorString());
   emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
   network()->emitConnectionError(socket.errorString());
+  if(socket.state() < QAbstractSocket::ConnectedState) {
+    setConnectionState(Network::Disconnected);
+    socketDisconnected();
+  }
 }
 
 void NetworkConnection::socketConnected() {
 }
 
 void NetworkConnection::socketConnected() {
@@ -261,6 +298,22 @@ void NetworkConnection::socketStateChanged(QAbstractSocket::SocketState socketSt
 void NetworkConnection::socketDisconnected() {
   network()->setConnected(false);
   emit disconnected(networkId());
 void NetworkConnection::socketDisconnected() {
   network()->setConnected(false);
   emit disconnected(networkId());
+  if(_autoReconnectCount == 0) emit quitRequested(networkId());
+  else {
+    setConnectionState(Network::Reconnecting);
+    qDebug() << "trying to reconnect... " << _autoReconnectTimer.interval();
+    if(_autoReconnectCount == network()->autoReconnectRetries()) doAutoReconnect(); // first try is immediate
+    else _autoReconnectTimer.start();
+  }
+}
+
+void NetworkConnection::doAutoReconnect() {
+  if(connectionState() != Network::Disconnected && connectionState() != Network::Reconnecting) {
+    qWarning() << "NetworkConnection::doAutoReconnect(): Cannot reconnect while not being disconnected!";
+    return;
+  }
+  if(_autoReconnectCount > 0) _autoReconnectCount--;
+  connectToIrc(true);
 }
 
 // FIXME switch to BufferId
 }
 
 // FIXME switch to BufferId
index 745afc7..ace1e4e 100644 (file)
@@ -82,7 +82,7 @@ public:
 
 public slots:
   // void setServerOptions();
 
 public slots:
   // void setServerOptions();
-  void connectToIrc();
+  void connectToIrc(bool reconnecting = false);
   void disconnectFromIrc();
   void userInput(BufferInfo bufferInfo, QString msg);
 
   void disconnectFromIrc();
   void userInput(BufferInfo bufferInfo, QString msg);
 
@@ -92,6 +92,8 @@ public slots:
 
 private slots:
   void sendPerform();
 
 private slots:
   void sendPerform();
+  void autoReconnectSettingsChanged();
+  void doAutoReconnect();
 
 signals:
   // #void networkState(QString net, QVariantMap data);
 
 signals:
   // #void networkState(QString net, QVariantMap data);
@@ -105,6 +107,8 @@ signals:
   void connectionInitialized(); ///< Emitted after receipt of 001 to indicate that we can now send data to the IRC server
   void connectionError(const QString &errorMsg);
 
   void connectionInitialized(); ///< Emitted after receipt of 001 to indicate that we can now send data to the IRC server
   void connectionError(const QString &errorMsg);
 
+  void quitRequested(NetworkId networkId);
+
   //void queryRequested(QString network, QString nick);
 
 
   //void queryRequested(QString network, QString nick);
 
 
@@ -130,6 +134,9 @@ private:
 
   QVariant _previousState;
 
 
   QVariant _previousState;
 
+  QTimer _autoReconnectTimer;
+  int _autoReconnectCount;
+
   class ParseError : public Exception {
   public:
     ParseError(QString cmd, QString prefix, QStringList params);
   class ParseError : public Exception {
   public:
     ParseError(QString cmd, QString prefix, QStringList params);
@@ -139,7 +146,6 @@ private:
   public:
     UnknownCmdError(QString cmd, QString prefix, QStringList params);
   };
   public:
     UnknownCmdError(QString cmd, QString prefix, QStringList params);
   };
-    
 };
 
 #endif
 };
 
 #endif
index 573a033..614de27 100644 (file)
@@ -32,6 +32,7 @@
 
 NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("General"), tr("Networks"), parent) {
   ui.setupUi(this);
 
 NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("General"), tr("Networks"), parent) {
   ui.setupUi(this);
+  _ignoreWidgetChanges = false;
 
   connectedIcon = QIcon(":/22x22/actions/network-connect");
   connectingIcon = QIcon(":/22x22/actions/gear");
 
   connectedIcon = QIcon(":/22x22/actions/network-connect");
   connectingIcon = QIcon(":/22x22/actions/gear");
@@ -145,6 +146,7 @@ bool NetworksSettingsPage::aboutToSave() {
 }
 
 void NetworksSettingsPage::widgetHasChanged() {
 }
 
 void NetworksSettingsPage::widgetHasChanged() {
+  if(_ignoreWidgetChanges) return;
   bool changed = testHasChanged();
   if(changed != hasChanged()) setChangedState(changed);
 }
   bool changed = testHasChanged();
   if(changed != hasChanged()) setChangedState(changed);
 }
@@ -165,18 +167,25 @@ void NetworksSettingsPage::setWidgetStates() {
   // network list
   if(ui.networkList->selectedItems().count()) {
     NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
   // network list
   if(ui.networkList->selectedItems().count()) {
     NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+    const Network *net = 0;
+    if(id > 0) net = Client::network(id);
     ui.detailsBox->setEnabled(true);
     ui.renameNetwork->setEnabled(true);
     ui.deleteNetwork->setEnabled(true);
     ui.detailsBox->setEnabled(true);
     ui.renameNetwork->setEnabled(true);
     ui.deleteNetwork->setEnabled(true);
-    ui.connectNow->setEnabled(id > 0
-        && (Client::network(id)->connectionState() == Network::Initialized
-        || Client::network(id)->connectionState() == Network::Disconnected));
-    if(Client::network(id) && Client::network(id)->isConnected()) {
-      ui.connectNow->setIcon(disconnectedIcon);
-      ui.connectNow->setText(tr("Disconnect"));
+    ui.connectNow->setEnabled(net);
+    //    && (Client::network(id)->connectionState() == Network::Initialized
+    //    || Client::network(id)->connectionState() == Network::Disconnected));
+    if(net) {
+      if(net->connectionState() == Network::Disconnected) {
+        ui.connectNow->setIcon(connectedIcon);
+        ui.connectNow->setText(tr("Connect"));
+      } else {
+        ui.connectNow->setIcon(disconnectedIcon);
+        ui.connectNow->setText(tr("Disconnect"));
+      }
     } else {
     } else {
-      ui.connectNow->setIcon(connectedIcon);
-      ui.connectNow->setText(tr("Connect"));
+      ui.connectNow->setIcon(QIcon());
+      ui.connectNow->setText(tr("Apply first!"));
     }
   } else {
     ui.renameNetwork->setEnabled(false);
     }
   } else {
     ui.renameNetwork->setEnabled(false);
@@ -386,6 +395,7 @@ QListWidgetItem *NetworksSettingsPage::insertNetwork(const NetworkInfo &info) {
 }
 
 void NetworksSettingsPage::displayNetwork(NetworkId id) {
 }
 
 void NetworksSettingsPage::displayNetwork(NetworkId id) {
+  _ignoreWidgetChanges = true;
   if(id != 0) {
     NetworkInfo info = networkInfos[id];
     ui.identityList->setCurrentIndex(ui.identityList->findData(info.identity.toInt()));
   if(id != 0) {
     NetworkInfo info = networkInfos[id];
     ui.identityList->setCurrentIndex(ui.identityList->findData(info.identity.toInt()));
@@ -418,8 +428,11 @@ void NetworksSettingsPage::displayNetwork(NetworkId id) {
     ui.identityList->setCurrentIndex(-1);
     ui.serverList->clear();
     ui.performEdit->clear();
     ui.identityList->setCurrentIndex(-1);
     ui.serverList->clear();
     ui.performEdit->clear();
+    ui.autoIdentifyService->clear();
+    ui.autoIdentifyPassword->clear();
     setWidgetStates();
   }
     setWidgetStates();
   }
+  _ignoreWidgetChanges = false;
   currentId = id;
 }
 
   currentId = id;
 }
 
@@ -529,7 +542,7 @@ void NetworksSettingsPage::on_connectNow_clicked() {
   NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
   const Network *net = Client::network(id);
   if(!net) return;
   NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
   const Network *net = Client::network(id);
   if(!net) return;
-  if(!net->isConnected()) net->requestConnect();
+  if(net->connectionState() == Network::Disconnected) net->requestConnect();
   else net->requestDisconnect();
 }
 
   else net->requestDisconnect();
 }
 
index bb6499f..22a9e33 100644 (file)
@@ -81,6 +81,7 @@ class NetworksSettingsPage : public SettingsPage {
 
     NetworkId currentId;
     QHash<NetworkId, NetworkInfo> networkInfos;
 
     NetworkId currentId;
     QHash<NetworkId, NetworkInfo> networkInfos;
+    bool _ignoreWidgetChanges;
 
     QIcon connectedIcon, connectingIcon, disconnectedIcon;
 
 
     QIcon connectedIcon, connectingIcon, disconnectedIcon;
 
index eaf1a8c..c635afc 100644 (file)
    <string>Form</string>
   </property>
   <layout class="QHBoxLayout" >
    <string>Form</string>
   </property>
   <layout class="QHBoxLayout" >
-   <property name="leftMargin" >
-    <number>0</number>
-   </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
+   <property name="margin" >
     <number>0</number>
    </property>
    <item>
     <number>0</number>
    </property>
    <item>
@@ -53,7 +44,8 @@
             <string>Re&amp;name...</string>
            </property>
            <property name="icon" >
             <string>Re&amp;name...</string>
            </property>
            <property name="icon" >
-            <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-rename.png</iconset>
+            <iconset resource="../../icons/icons.qrc" >
+             <normaloff>:/16x16/actions/oxygen/16x16/actions/edit-rename.png</normaloff>:/16x16/actions/oxygen/16x16/actions/edit-rename.png</iconset>
            </property>
           </widget>
          </item>
            </property>
           </widget>
          </item>
@@ -69,7 +61,8 @@
             <string>&amp;Add...</string>
            </property>
            <property name="icon" >
             <string>&amp;Add...</string>
            </property>
            <property name="icon" >
-            <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
+            <iconset resource="../../icons/icons.qrc" >
+             <normaloff>:/16x16/actions/oxygen/16x16/actions/list-add.png</normaloff>:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
            </property>
            <property name="iconSize" >
             <size>
            </property>
            <property name="iconSize" >
             <size>
@@ -91,7 +84,8 @@
             <string>De&amp;lete</string>
            </property>
            <property name="icon" >
             <string>De&amp;lete</string>
            </property>
            <property name="icon" >
-            <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
+            <iconset resource="../../icons/icons.qrc" >
+             <normaloff>:/16x16/actions/oxygen/16x16/actions/edit-delete.png</normaloff>:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
            </property>
           </widget>
          </item>
            </property>
           </widget>
          </item>
            <property name="orientation" >
             <enum>Qt::Vertical</enum>
            </property>
            <property name="orientation" >
             <enum>Qt::Vertical</enum>
            </property>
-           <property name="sizeHint" >
+           <property name="sizeHint" stdset="0" >
             <size>
              <width>20</width>
              <height>40</height>
             <size>
              <width>20</width>
              <height>40</height>
             <string>Connect now</string>
            </property>
            <property name="icon" >
             <string>Connect now</string>
            </property>
            <property name="icon" >
-            <iconset/>
+            <iconset>
+             <normaloff/>
+            </iconset>
            </property>
           </widget>
          </item>
            </property>
           </widget>
          </item>
            <bool>true</bool>
           </property>
           <property name="currentIndex" >
            <bool>true</bool>
           </property>
           <property name="currentIndex" >
-           <number>2</number>
+           <number>1</number>
           </property>
           <widget class="QWidget" name="serversTab" >
            <property name="enabled" >
             <bool>true</bool>
            </property>
           </property>
           <widget class="QWidget" name="serversTab" >
            <property name="enabled" >
             <bool>true</bool>
            </property>
+           <property name="geometry" >
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>800</width>
+             <height>480</height>
+            </rect>
+           </property>
            <attribute name="title" >
             <string>Servers</string>
            </attribute>
            <attribute name="title" >
             <string>Servers</string>
            </attribute>
                      <string>&amp;Edit...</string>
                     </property>
                     <property name="icon" >
                      <string>&amp;Edit...</string>
                     </property>
                     <property name="icon" >
-                     <iconset/>
+                     <iconset>
+                      <normaloff/>
+                     </iconset>
                     </property>
                    </widget>
                   </item>
                     </property>
                    </widget>
                   </item>
                      <string>&amp;Add...</string>
                     </property>
                     <property name="icon" >
                      <string>&amp;Add...</string>
                     </property>
                     <property name="icon" >
-                     <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
+                     <iconset resource="../../icons/icons.qrc" >
+                      <normaloff>:/16x16/actions/oxygen/16x16/actions/list-add.png</normaloff>:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
                     </property>
                    </widget>
                   </item>
                     </property>
                    </widget>
                   </item>
                      <string>De&amp;lete</string>
                     </property>
                     <property name="icon" >
                      <string>De&amp;lete</string>
                     </property>
                     <property name="icon" >
-                     <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
+                     <iconset resource="../../icons/icons.qrc" >
+                      <normaloff>:/16x16/actions/oxygen/16x16/actions/edit-delete.png</normaloff>:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
                     </property>
                    </widget>
                   </item>
                     </property>
                    </widget>
                   </item>
                     <property name="spacing" >
                      <number>6</number>
                     </property>
                     <property name="spacing" >
                      <number>6</number>
                     </property>
-                    <property name="leftMargin" >
-                     <number>0</number>
-                    </property>
-                    <property name="topMargin" >
-                     <number>0</number>
-                    </property>
-                    <property name="rightMargin" >
-                     <number>0</number>
-                    </property>
-                    <property name="bottomMargin" >
+                    <property name="margin" >
                      <number>0</number>
                     </property>
                     <item>
                      <number>0</number>
                     </property>
                     <item>
                       <property name="orientation" >
                        <enum>Qt::Horizontal</enum>
                       </property>
                       <property name="orientation" >
                        <enum>Qt::Horizontal</enum>
                       </property>
-                      <property name="sizeHint" >
+                      <property name="sizeHint" stdset="0" >
                        <size>
                         <width>0</width>
                         <height>20</height>
                        <size>
                         <width>0</width>
                         <height>20</height>
                        <string>...</string>
                       </property>
                       <property name="icon" >
                        <string>...</string>
                       </property>
                       <property name="icon" >
-                       <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/go-up.png</iconset>
+                       <iconset resource="../../icons/icons.qrc" >
+                        <normaloff>:/16x16/actions/oxygen/16x16/actions/go-up.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-up.png</iconset>
                       </property>
                      </widget>
                     </item>
                       </property>
                      </widget>
                     </item>
                        <string>...</string>
                       </property>
                       <property name="icon" >
                        <string>...</string>
                       </property>
                       <property name="icon" >
-                       <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/go-down.png</iconset>
+                       <iconset resource="../../icons/icons.qrc" >
+                        <normaloff>:/16x16/actions/oxygen/16x16/actions/go-down.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-down.png</iconset>
                       </property>
                      </widget>
                     </item>
                       </property>
                      </widget>
                     </item>
                       <property name="orientation" >
                        <enum>Qt::Horizontal</enum>
                       </property>
                       <property name="orientation" >
                        <enum>Qt::Horizontal</enum>
                       </property>
-                      <property name="sizeHint" >
+                      <property name="sizeHint" stdset="0" >
                        <size>
                         <width>0</width>
                         <height>20</height>
                        <size>
                         <width>0</width>
                         <height>20</height>
                     <property name="orientation" >
                      <enum>Qt::Vertical</enum>
                     </property>
                     <property name="orientation" >
                      <enum>Qt::Vertical</enum>
                     </property>
-                    <property name="sizeHint" >
+                    <property name="sizeHint" stdset="0" >
                      <size>
                       <width>20</width>
                       <height>40</height>
                      <size>
                       <width>20</width>
                       <height>40</height>
            </layout>
           </widget>
           <widget class="QWidget" name="performTab" >
            </layout>
           </widget>
           <widget class="QWidget" name="performTab" >
+           <property name="geometry" >
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>394</width>
+             <height>340</height>
+            </rect>
+           </property>
            <attribute name="title" >
             <string>Perform</string>
            </attribute>
            <attribute name="title" >
             <string>Perform</string>
            </attribute>
            </layout>
           </widget>
           <widget class="QWidget" name="tab" >
            </layout>
           </widget>
           <widget class="QWidget" name="tab" >
+           <property name="geometry" >
+            <rect>
+             <x>0</x>
+             <y>0</y>
+             <width>394</width>
+             <height>340</height>
+            </rect>
+           </property>
            <attribute name="title" >
             <string>Advanced</string>
            </attribute>
            <attribute name="title" >
             <string>Advanced</string>
            </attribute>
                    <property name="orientation" >
                     <enum>Qt::Horizontal</enum>
                    </property>
                    <property name="orientation" >
                     <enum>Qt::Horizontal</enum>
                    </property>
-                   <property name="sizeHint" >
+                   <property name="sizeHint" stdset="0" >
                     <size>
                      <width>40</width>
                      <height>20</height>
                     <size>
                      <width>40</width>
                      <height>20</height>
                    <property name="orientation" >
                     <enum>Qt::Horizontal</enum>
                    </property>
                    <property name="orientation" >
                     <enum>Qt::Horizontal</enum>
                    </property>
-                   <property name="sizeHint" >
+                   <property name="sizeHint" stdset="0" >
                     <size>
                      <width>40</width>
                      <height>20</height>
                     <size>
                      <width>40</width>
                      <height>20</height>
               <property name="orientation" >
                <enum>Qt::Vertical</enum>
               </property>
               <property name="orientation" >
                <enum>Qt::Vertical</enum>
               </property>
-              <property name="sizeHint" >
+              <property name="sizeHint" stdset="0" >
                <size>
                 <width>386</width>
                 <height>31</height>
                <size>
                 <width>386</width>
                 <height>31</height>