void CoreAccountSettingsPage::load() { model()->update(Client::coreAccountModel()); SettingsPage::load(); CoreAccountSettings s; if (Quassel::runMode() != Quassel::Monolithic) { // make sure we don't have selected the internal account as autoconnect account if (s.autoConnectOnStartup() && s.autoConnectToFixedAccount()) { CoreAccount acc = model()->account(s.autoConnectAccount()); if (acc.isInternal()) ui.autoConnectOnStartup->setChecked(false); } } ui.accountView->setCurrentIndex(filteredModel()->index(0, 0)); ui.accountView->selectionModel()->select(filteredModel()->index(0, 0), QItemSelectionModel::Select); QModelIndex idx = filteredModel()->mapFromSource(model()->accountIndex(s.autoConnectAccount())); ui.autoConnectAccount->setCurrentIndex(idx.isValid() ? idx.row() : 0); ui.autoConnectAccount->setProperty("storedValue", ui.autoConnectAccount->currentIndex()); setWidgetStates(); // Mark as no changes made, we just loaded settings setChangedState(false); }
PasswordChangeDlg::PasswordChangeDlg(QWidget* parent) : QDialog(parent) { ui.setupUi(this); CoreAccount account = Client::currentCoreAccount(); ui.infoLabel->setText(tr("This changes the password for your username <b>%1</b> " "on the Quassel Core running at <b>%2</b>.") .arg(account.user(), account.hostName())); connect(ui.oldPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged); connect(ui.newPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged); connect(ui.confirmPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &PasswordChangeDlg::changePassword); connect(Client::instance(), &Client::passwordChanged, this, &PasswordChangeDlg::passwordChanged); ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); }
void CoreConnection::onLoginSuccessful(const CoreAccount &account) { updateProgress(0, 0); // save current account data accountModel()->createOrUpdateAccount(account); accountModel()->save(); _reconnectTimer.stop(); setProgressText(tr("Receiving session state")); setState(Synchronizing); emit connectionMsg(tr("Synchronizing to %1...").arg(account.accountName())); }
/***************************************************************************************** * CoreAccountEditDlg *****************************************************************************************/ CoreAccountEditDlg::CoreAccountEditDlg(const CoreAccount &acct, QWidget *parent) : QDialog(parent) { ui.setupUi(this); _account = acct; ui.hostName->setText(acct.hostName()); ui.port->setValue(acct.port()); ui.accountName->setText(acct.accountName()); ui.user->setText(acct.user()); ui.password->setText(acct.password()); ui.rememberPassword->setChecked(acct.storePassword()); ui.useProxy->setChecked(acct.useProxy()); ui.proxyHostName->setText(acct.proxyHostName()); ui.proxyPort->setValue(acct.proxyPort()); ui.proxyType->setCurrentIndex(acct.proxyType() == QNetworkProxy::Socks5Proxy ? 0 : 1); ui.proxyUser->setText(acct.proxyUser()); ui.proxyPassword->setText(acct.proxyPassword()); if (acct.accountId().isValid()) setWindowTitle(tr("Edit Core Account")); else setWindowTitle(tr("Add Core Account")); }
bool CoreAccount::operator==(const CoreAccount &o) const { return toVariantMap(true) == o.toVariantMap(true); }
/***************************************************************************************** * CoreAccountEditDlg *****************************************************************************************/ CoreAccountEditDlg::CoreAccountEditDlg(const CoreAccount &acct, QWidget *parent) : QDialog(parent) { ui.setupUi(this); _account = acct; ui.hostName->setText(acct.hostName()); ui.port->setValue(acct.port()); ui.accountName->setText(acct.accountName()); ui.user->setText(acct.user()); ui.password->setText(acct.password()); ui.rememberPassword->setChecked(acct.storePassword()); ui.buttonGroupProxyType->setId(ui.radioButtonNoProxy, 0); ui.buttonGroupProxyType->setId(ui.radioButtonSystemProxy, 1); ui.buttonGroupProxyType->setId(ui.radioButtonManualProxy, 2); bool manualProxy = false; switch (acct.proxyType()) { case QNetworkProxy::NoProxy: ui.buttonGroupProxyType->button(0)->setChecked(true); break; case QNetworkProxy::DefaultProxy: ui.buttonGroupProxyType->button(1)->setChecked(true); break; case QNetworkProxy::Socks5Proxy: ui.buttonGroupProxyType->button(2)->setChecked(true); ui.proxyType->setCurrentIndex(0); manualProxy = true; break; case QNetworkProxy::HttpProxy: ui.buttonGroupProxyType->button(2)->setChecked(true); ui.proxyType->setCurrentIndex(1); manualProxy = true; break; default: break; } if (manualProxy) { ui.proxyHostName->setText(acct.proxyHostName()); ui.proxyPort->setValue(acct.proxyPort()); ui.proxyType->setEnabled(true); ui.proxyUser->setText(acct.proxyUser()); ui.proxyPassword->setText(acct.proxyPassword()); } if (acct.accountId().isValid()) setWindowTitle(tr("Edit Core Account")); else setWindowTitle(tr("Add Core Account")); }