hiding internal connection mode in client only build
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 21 Oct 2008 16:26:59 +0000 (18:26 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 21 Oct 2008 16:52:53 +0000 (18:52 +0200)
src/qtui/coreconnectdlg.cpp
src/qtui/coreconnectdlg.h
src/qtui/ui/coreaccounteditdlg.ui

index d61a021..953b8da 100644 (file)
@@ -29,6 +29,7 @@
 #include "clientsyncer.h"
 #include "coreconfigwizard.h"
 #include "iconloader.h"
+#include "quassel.h"
 
 CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
   : QDialog(parent)
@@ -40,6 +41,10 @@ CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
   ui.connectIcon->setPixmap(BarIcon("network-disconnect"));
   ui.secureConnection->setPixmap(SmallIcon("document-encrypt"));
 
+  if(Quassel::runMode() != Quassel::Monolithic) {
+    ui.useInternalCore->hide();
+  }
+
   // make it look more native under Mac OS X:
   setWindowFlags(Qt::Sheet);
 
@@ -216,13 +221,6 @@ void CoreConnectDlg::on_accountButtonBox_accepted() {
 }
 
 void CoreConnectDlg::on_useInternalCore_clicked() {
-//   // FIXME: this needs to be a qobject_cast - therefore MonolithicApplication needs to be a proper QObject... :/
-//   MonolithicApplication *monoApp = qobject_cast<MonolithicApplication *>(QApplication::instance());
-//   if(monoApp) {
-//     qDebug() << "starting core...";
-//     monoApp->startInternalCore();
-//     monoApp->connectClientSyncer(clientSyncer);
-//   }
   clientSyncer->useInternalCore();
   startSync();
 }
@@ -466,7 +464,6 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co
     existing.removeAll(acct["AccountName"].toString());
     ui.host->setText(acct["Host"].toString());
     ui.port->setValue(acct["Port"].toUInt());
-    ui.useInternal->setChecked(acct["UseInternal"].toBool());
     ui.accountName->setText(acct["AccountName"].toString());
 #ifdef HAVE_SSL
     ui.useSsl->setChecked(acct["useSsl"].toBool());
@@ -487,21 +484,12 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co
     ui.useSsl->setEnabled(false);
 #endif
   }
-
-#ifndef BUILD_MONO
-  // if we don't have a mono build we hide the option to use the internal connection and force the setting to use remote host
-  ui.useInternal->setChecked(false);
-  ui.useInternal->hide();
-  ui.useRemote->hide();
-  ui.labelUseBuiltinCore->hide();
-#endif
 }
 
 QVariantMap CoreAccountEditDlg::accountData() {
   account["AccountName"] = ui.accountName->text().trimmed();
   account["Host"] = ui.host->text().trimmed();
   account["Port"] = ui.port->value();
-  account["UseInternal"] = ui.useInternal->isChecked();
   account["useSsl"] = ui.useSsl->isChecked();
   account["useProxy"] = ui.useProxy->isChecked();
   account["proxyHost"] = ui.proxyHost->text().trimmed();
@@ -513,7 +501,7 @@ QVariantMap CoreAccountEditDlg::accountData() {
 }
 
 void CoreAccountEditDlg::setWidgetStates() {
-  bool ok = !ui.accountName->text().trimmed().isEmpty() && !existing.contains(ui.accountName->text()) && (ui.useInternal->isChecked() || !ui.host->text().isEmpty());
+  bool ok = !ui.accountName->text().trimmed().isEmpty() && !existing.contains(ui.accountName->text()) && !ui.host->text().isEmpty();
   ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok);
 }
 
@@ -526,8 +514,3 @@ void CoreAccountEditDlg::on_accountName_textChanged(const QString &text) {
   Q_UNUSED(text);
   setWidgetStates();
 }
-
-void CoreAccountEditDlg::on_useRemote_toggled(bool state) {
-  Q_UNUSED(state);
-  setWidgetStates();
-}
index ae3d5b7..7abaac9 100644 (file)
@@ -112,7 +112,6 @@ public:
 private slots:
   void on_host_textChanged(const QString &);
   void on_accountName_textChanged(const QString &);
-  void on_useRemote_toggled(bool);
 
   void setWidgetStates();
 
index 7c67ef6..be88b7a 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>514</width>
-    <height>534</height>
+    <width>509</width>
+    <height>458</height>
    </rect>
   </property>
   <property name="windowTitle" >
         <item>
          <layout class="QGridLayout" >
           <item row="0" column="0" >
-           <widget class="QRadioButton" name="useInternal" >
-            <property name="enabled" >
-             <bool>false</bool>
-            </property>
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="0" column="1" colspan="2" >
-           <widget class="QLabel" name="labelUseBuiltinCore" >
-            <property name="enabled" >
-             <bool>false</bool>
-            </property>
-            <property name="text" >
-             <string>Use built-in Quassel Core</string>
-            </property>
-            <property name="buddy" >
-             <cstring>useInternal</cstring>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="0" >
-           <widget class="QRadioButton" name="useRemote" >
-            <property name="text" >
-             <string/>
-            </property>
-            <property name="checked" >
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="1" >
            <widget class="QLabel" name="label_2" >
             <property name="text" >
              <string>Hostname:</string>
             </property>
-            <property name="buddy" >
-             <cstring>useRemote</cstring>
-            </property>
            </widget>
           </item>
-          <item row="1" column="2" >
+          <item row="0" column="1" >
            <widget class="QLabel" name="label_3" >
             <property name="text" >
              <string>Port:</string>
             </property>
            </widget>
           </item>
-          <item row="2" column="1" >
+          <item row="1" column="0" >
            <widget class="QLineEdit" name="host" >
             <property name="text" >
              <string>localhost</string>
             </property>
            </widget>
           </item>
-          <item row="2" column="2" >
+          <item row="1" column="1" >
            <widget class="QSpinBox" name="port" >
             <property name="minimum" >
              <number>1</number>
             </property>
            </widget>
           </item>
-          <item row="3" column="1" colspan="2" >
+          <item row="2" column="0" colspan="2" >
            <widget class="QCheckBox" name="useSsl" >
             <property name="text" >
              <string>Use secure connection (SSL)</string>
             </property>
             <property name="icon" >
-             <iconset resource="../../icons/icons.qrc" >
+             <iconset>
               <normaloff>:/16x16/actions/oxygen/16x16/actions/document-encrypt.png</normaloff>:/16x16/actions/oxygen/16x16/actions/document-encrypt.png</iconset>
             </property>
             <property name="checked" >
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>useInternal</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>host</receiver>
-   <slot>setDisabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>63</x>
-     <y>100</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>92</x>
-     <y>143</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useInternal</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>port</receiver>
-   <slot>setDisabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>63</x>
-     <y>100</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>400</x>
-     <y>144</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useRemote</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>host</receiver>
-   <slot>setFocus()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>59</x>
-     <y>126</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>184</x>
-     <y>146</y>
-    </hint>
-   </hints>
-  </connection>
  </connections>
 </ui>