diff options
| author | Kevin Smith <git@kismith.co.uk> | 2009-11-26 18:26:34 (GMT) | 
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2009-11-26 18:26:34 (GMT) | 
| commit | 7ac33c721c12e94404cddff2b5c12b15deafe527 (patch) | |
| tree | e75f99b242bcdce3c02fc02f0c3f3b3117840d9f /Swift/QtUI | |
| parent | eebdef9a7724ff7fa86a5d1cca37759d37bbb336 (diff) | |
| download | swift-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.cpp | 9 | ||||
| -rw-r--r-- | Swift/QtUI/QtLoginWindow.h | 1 | 
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 @@ -130,12 +130,21 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {   */  void QtLoginWindow::setGentleGeometry(const QRect& rect) {  	resize(rect.size());  	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;  	int windowHeight = 500;  	QRect screen = desktop.screenGeometry(-1); //appear on default screen  	windowWidth = std::min(windowWidth, screen.width()); 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 @@ -27,12 +27,13 @@ namespace Swift {  			void morphInto(MainWindow *mainWindow);  			virtual void loggedOut();  			virtual void setMessage(const String& message);  			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();  		private slots:  			void loginClicked();  			void handleCertficateChecked(bool); | 
 Swift
 Swift