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/Controllers | |
parent | eebdef9a7724ff7fa86a5d1cca37759d37bbb336 (diff) | |
download | swift-contrib-7ac33c721c12e94404cddff2b5c12b15deafe527.zip swift-contrib-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/Controllers')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/LoginWindow.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 0705eb4..39c63dd 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -82,6 +82,7 @@ MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowF loginWindow_->addAvailableAccount(profileSettings->getStringSetting("jid"), profileSettings->getStringSetting("pass"), profileSettings->getStringSetting("certificate")); delete profileSettings; } + loginWindow_->selectUser(settings_->getStringSetting("lastLoginJID")); loginWindow_->onLoginRequest.connect(boost::bind(&MainController::handleLoginRequest, this, _1, _2, _3, _4)); loginWindow_->onCancelLoginRequest.connect(boost::bind(&MainController::handleCancelLoginRequest, this)); @@ -258,6 +259,7 @@ void MainController::handleLoginRequest(const String &username, const String &pa profileSettings->storeString("jid", username); profileSettings->storeString("certificate", certificateFile); profileSettings->storeString("pass", remember ? password : ""); + settings_->storeString("lastLoginJID", username); loginWindow_->addAvailableAccount(profileSettings->getStringSetting("jid"), profileSettings->getStringSetting("pass"), profileSettings->getStringSetting("certificate")); delete profileSettings; jid_ = JID(username); diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index cfa20c7..d165125 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -11,6 +11,7 @@ namespace Swift { class LoginWindow { public: virtual ~LoginWindow() {}; + virtual void selectUser(const String&) = 0; virtual void morphInto(MainWindow *mainWindow) = 0; virtual void loggedOut() = 0; virtual void setMessage(const String&) = 0; |