diff options
| -rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 87dd849..e339d79 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -285,71 +285,72 @@ void QtLoginWindow::addAvailableAccount(const std::string& defaultJID, const std usernames_[index] = username; passwords_[index] = P2QSTRING(defaultPassword); certificateFiles_[index] = P2QSTRING(defaultCertificate); } } void QtLoginWindow::handleUsernameTextChanged() { QString username = username_->currentText(); for (int i = 0; i < usernames_.count(); i++) { if (username_->currentText() == usernames_[i]) { certificateFile_ = certificateFiles_[i]; password_->setText(passwords_[i]); remember_->setChecked(password_->text() != ""); } } if (!certificateFile_.isEmpty()) { certificateButton_->setChecked(true); } } void QtLoginWindow::loggedOut() { stack_->removeWidget(stack_->currentWidget()); stack_->addWidget(loginWidgetWrapper_); stack_->setCurrentWidget(loginWidgetWrapper_); setInitialMenus(); setIsLoggingIn(false); } void QtLoginWindow::setIsLoggingIn(bool loggingIn) { /* Change the for loop as well if you add to this.*/ QWidget* widgets[5] = {username_, password_, remember_, loginAutomatically_, certificateButton_}; loginButton_->setText(loggingIn ? tr("Cancel") : tr("Connect")); for (int i = 0; i < 5; i++) { widgets[i]->setEnabled(!loggingIn); } - + remember_->setEnabled(!eagleMode_); + loginAutomatically_->setEnabled(!eagleMode_); } void QtLoginWindow::loginClicked() { if (username_->isEnabled()) { if (eagleMode_) { QString clickThroughPath(P2QSTRING((Paths::getExecutablePath() / "eagle-banner.txt").string())); QFile clickThroughFile(clickThroughPath); if (clickThroughFile.exists() && clickThroughFile.open(QIODevice::ReadOnly)) { QString banner; while (!clickThroughFile.atEnd()) { QByteArray line = clickThroughFile.readLine(); banner += line + "\n"; } if (!banner.isEmpty()) { QMessageBox msgBox; msgBox.setWindowTitle(tr("Confirm terms of use")); msgBox.setText(""); msgBox.setInformativeText(banner); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); if (msgBox.exec() != QMessageBox::Yes) { return; } } } } onLoginRequest(Q2PSTRING(username_->currentText()), Q2PSTRING(password_->text()), Q2PSTRING(certificateFile_), remember_->isChecked(), loginAutomatically_->isChecked()); if (eagleMode_) { /* Mustn't remember logins */ username_->clearEditText(); password_->setText(""); } } else { onCancelLoginRequest(); } } |
Swift