X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconnectdlg.cpp;h=6903d93741e771b53b5d6d56d9e8a5af2d286171;hp=d7d52de2344cdc7db3d81c9e72d69ff2f402f39b;hb=f4ae0007ac4524612ae73a778ca491659cf22393;hpb=671e451cf1c10a6e3f442af82b58bfc4de0cb5a2 diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index d7d52de2..6903d937 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -27,19 +27,25 @@ #include "clientsettings.h" #include "clientsyncer.h" #include "coreconfigwizard.h" +#include "iconloader.h" +#include "monoapplication.h" -CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool autoconnect) +CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent) : QDialog(parent) { ui.setupUi(this); + ui.editAccount->setIcon(SmallIcon("document-properties")); + ui.addAccount->setIcon(SmallIcon("list-add")); + ui.deleteAccount->setIcon(SmallIcon("list-remove")); + ui.connectIcon->setPixmap(BarIcon("network-disconnect")); + ui.secureConnection->setPixmap(SmallIcon("document-encrypt")); // make it look more native under Mac OS X: setWindowFlags(Qt::Sheet); clientSyncer = new ClientSyncer(this); - wizard = 0; - setAttribute(Qt::WA_DeleteOnClose); + wizard = 0; doingAutoConnect = false; @@ -207,6 +213,18 @@ void CoreConnectDlg::on_accountButtonBox_accepted() { connectToCore(); } +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(); +} + /***************************************************** * Connecting to the Core ****************************************************/ @@ -215,7 +233,7 @@ void CoreConnectDlg::on_accountButtonBox_accepted() { void CoreConnectDlg::connectToCore() { ui.secureConnection->hide(); - ui.connectIcon->setPixmap(QPixmap::fromImage(QImage(":/22x22/actions/network-disconnect"))); + ui.connectIcon->setPixmap(BarIcon("network-disconnect")); ui.connectLabel->setText(tr("Connect to %1").arg(accountData["Host"].toString())); ui.coreInfoLabel->setText(""); ui.loginStack->setCurrentWidget(ui.loginEmptyPage); @@ -231,7 +249,7 @@ void CoreConnectDlg::connectToCore() { void CoreConnectDlg::initPhaseError(const QString &error) { doingAutoConnect = false; ui.secureConnection->hide(); - ui.connectIcon->setPixmap(QPixmap::fromImage(QImage(":/22x22/status/dialog-error"))); + ui.connectIcon->setPixmap(BarIcon("dialog-error")); //ui.connectLabel->setBrush(QBrush("red")); ui.connectLabel->setText(tr("
Connection to %1 failed!
").arg(accountData["Host"].toString())); ui.coreInfoLabel->setText(error); @@ -277,7 +295,7 @@ void CoreConnectDlg::restartPhaseNull() { *********************************************************/ void CoreConnectDlg::startLogin() { - ui.connectIcon->setPixmap(QPixmap::fromImage(QImage(":/22x22/actions/network-connect"))); + ui.connectIcon->setPixmap(BarIcon("network-connect")); ui.loginStack->setCurrentWidget(ui.loginCredentialsPage); //ui.loginStack->setMinimumSize(ui.loginStack->sizeHint()); ui.loginStack->updateGeometry(); ui.loginButtonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); @@ -338,6 +356,7 @@ void CoreConnectDlg::loginFailed(const QString &error) { if(wizard) { wizard->reject(); } + ui.connectIcon->setPixmap(BarIcon("dialog-error")); ui.loginStack->setCurrentWidget(ui.loginCredentialsPage); ui.loginGroup->setTitle(tr("Login")); ui.user->setEnabled(true); @@ -438,6 +457,8 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co : QDialog(parent) { ui.setupUi(this); + ui.useSsl->setIcon(SmallIcon("document-encrypt")); + existing = _existing; if(id.isValid()) { existing.removeAll(acct["AccountName"].toString()); @@ -445,7 +466,7 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co ui.port->setValue(acct["Port"].toUInt()); ui.useInternal->setChecked(acct["UseInternal"].toBool()); ui.accountName->setText(acct["AccountName"].toString()); -#ifndef QT_NO_OPENSSL +#ifdef HAVE_SSL ui.useSsl->setChecked(acct["useSsl"].toBool()); #else ui.useSsl->setChecked(false); @@ -459,11 +480,19 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co ui.proxyPassword->setText(acct["proxyPassword"].toString()); } else { setWindowTitle(tr("Add Core Account")); -#ifdef QT_NO_OPENSSL +#ifndef HAVE_SSL ui.useSsl->setChecked(false); 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() {