X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fcoreconnectdlg.cpp;h=953b8da225391f0dc0e954e87645efd4f009d95d;hb=1d145922198e7e5d727c9bca8a92f95cf40d02ef;hp=6903d93741e771b53b5d6d56d9e8a5af2d286171;hpb=f4ae0007ac4524612ae73a778ca491659cf22393;p=quassel.git diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index 6903d937..953b8da2 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -24,11 +24,12 @@ #include "coreconnectdlg.h" +#include "client.h" #include "clientsettings.h" #include "clientsyncer.h" #include "coreconfigwizard.h" #include "iconloader.h" -#include "monoapplication.h" +#include "quassel.h" CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent) : QDialog(parent) @@ -40,10 +41,16 @@ 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); 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; @@ -214,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 = static_cast(QApplication::instance()); - if(monoApp) { - qDebug() << "starting core..."; - monoApp->startInternalCore(); - monoApp->connectClientSyncer(clientSyncer); - } clientSyncer->useInternalCore(); startSync(); } @@ -464,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()); @@ -485,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(); @@ -511,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); } @@ -524,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(); -}