diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 15 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.h | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index ff2a50b..a73da52 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -98,6 +98,9 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() { layout->addStretch(); remember_ = new QCheckBox(tr("Remember Password?"), this); layout->addWidget(remember_); + loginAutomatically_ = new QCheckBox(tr("Login Automatically?"), this); + layout->addWidget(loginAutomatically_); + connect(loginButton_, SIGNAL(clicked()), SLOT(loginClicked())); stack_->addWidget(wrapperWidget); #ifdef SWIFTEN_PLATFORM_MACOSX @@ -218,10 +221,16 @@ void QtLoginWindow::loggedOut() { setEnabled(true); } +void QtLoginWindow::setIsLoggingIn(bool loggingIn) { + setEnabled(!loggingIn); +} + void QtLoginWindow::loginClicked() { - setEnabled(false); - message_->setText(""); - onLoginRequest(Q2PSTRING(username_->currentText()), Q2PSTRING(password_->text()), Q2PSTRING(certificateFile_), remember_->isChecked()); + onLoginRequest(Q2PSTRING(username_->currentText()), Q2PSTRING(password_->text()), Q2PSTRING(certificateFile_), remember_->isChecked(), loginAutomatically_->isChecked()); +} + +void QtLoginWindow::setLoginAutomatically(bool loginAutomatically) { + loginAutomatically_->setChecked(loginAutomatically); } void QtLoginWindow::handleCertficateChecked(bool checked) { diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h index 69327e9..b609b64 100644 --- a/Swift/QtUI/QtLoginWindow.h +++ b/Swift/QtUI/QtLoginWindow.h @@ -28,6 +28,8 @@ namespace Swift { virtual void loggedOut(); virtual void setMessage(const String& message); virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate); + virtual void setLoginAutomatically(bool loginAutomatically); + virtual void setIsLoggingIn(bool loggingIn); static QRect defaultPosition(); void setGentleGeometry(const QRect&); void selectUser(const String& user); @@ -56,6 +58,7 @@ namespace Swift { QLineEdit* password_; QPushButton* loginButton_; QCheckBox* remember_; + QCheckBox* loginAutomatically_; QStackedWidget* stack_; QLabel* message_; QString certificateFile_; |