#include "coreconnectdlg.h"
+#include "client.h"
#include "clientsettings.h"
#include "clientsyncer.h"
#include "coreconfigwizard.h"
#include "iconloader.h"
+#include "quassel.h"
CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
: QDialog(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);
clientSyncer = new ClientSyncer(this);
+ connect(this, SIGNAL(newClientSyncer(ClientSyncer *)), Client::instance(), SIGNAL(newClientSyncer(ClientSyncer *)));
+ emit newClientSyncer(clientSyncer); // announce the new client syncer via the client.
+
wizard = 0;
doingAutoConnect = false;
connectToCore();
}
+void CoreConnectDlg::on_useInternalCore_clicked() {
+ clientSyncer->useInternalCore();
+ startSync();
+}
+
/*****************************************************
* Connecting to the Core
****************************************************/
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());
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();
}
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);
}
Q_UNUSED(text);
setWidgetStates();
}
-
-void CoreAccountEditDlg::on_useRemote_toggled(bool state) {
- Q_UNUSED(state);
- setWidgetStates();
-}