summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-11-26 18:26:34 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-11-26 18:26:34 (GMT)
commit7ac33c721c12e94404cddff2b5c12b15deafe527 (patch)
treee75f99b242bcdce3c02fc02f0c3f3b3117840d9f /Swift/QtUI
parenteebdef9a7724ff7fa86a5d1cca37759d37bbb336 (diff)
downloadswift-7ac33c721c12e94404cddff2b5c12b15deafe527.zip
swift-7ac33c721c12e94404cddff2b5c12b15deafe527.tar.bz2
Remember the last used account.
This is the last account to be logged in with, not the last account to be logged out. If you want that, open a new ticket. Resolves: #241
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp9
-rw-r--r--Swift/QtUI/QtLoginWindow.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 2fd27c6..a222e8e 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -133,6 +133,15 @@ void QtLoginWindow::setGentleGeometry(const QRect& rect) {
move(rect.topLeft());
}
+void QtLoginWindow::selectUser(const String& username) {
+ for (int i = 0; i < usernames_.count(); i++) {
+ if (P2QSTRING(username) == usernames_[i]) {
+ username_->setCurrentIndex(i);
+ break;
+ }
+ }
+}
+
QRect QtLoginWindow::defaultPosition() {
QDesktopWidget desktop;
int windowWidth = 200;
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index 491521b..38852ce 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -30,6 +30,7 @@ namespace Swift {
virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate);
static QRect defaultPosition();
void setGentleGeometry(const QRect&);
+ void selectUser(const String& user);
signals:
void geometryChanged();