summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp2
-rw-r--r--Swift/Controllers/UIInterfaces/LoginWindow.h1
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;