summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-06 22:44:15 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-06 22:44:15 (GMT)
commit39e4547f396b6a21ec4ceb2f28c003c4011229a7 (patch)
treead7d2dbb5d968cd187360585387817d7f9358f1f /Swift/QtUI/QtLoginWindow.cpp
parentf3e75e58e57e5a49a79da8a88d25f17c784812b6 (diff)
downloadswift-39e4547f396b6a21ec4ceb2f28c003c4011229a7.zip
swift-39e4547f396b6a21ec4ceb2f28c003c4011229a7.tar.bz2
Add option to log in automatically.
Resolves: #240
Diffstat (limited to 'Swift/QtUI/QtLoginWindow.cpp')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp15
1 files changed, 12 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) {