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-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/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 @@ -79,12 +79,13 @@ MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowF  	loginWindow_ = loginWindowFactory_->createLoginWindow(uiEventStream_);  	foreach (String profile, settings->getAvailableProfiles()) {  		ProfileSettingsProvider* profileSettings = new ProfileSettingsProvider(profile, settings);  		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));  	idleDetector_.setIdleTimeSeconds(600);  	idleDetector_.onIdleChanged.connect(boost::bind(&MainController::handleInputIdleChanged, this, _1)); @@ -255,12 +256,13 @@ void MainController::handleIncomingPresence(boost::shared_ptr<Presence> presence  void MainController::handleLoginRequest(const String &username, const String &password, const String& certificateFile, bool remember) {  	loginWindow_->setMessage("");  	ProfileSettingsProvider* profileSettings = new ProfileSettingsProvider(username, settings_);  	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);  	password_ = password;  	certificateFile_ = certificateFile;  	performLoginFromCachedCredentials(); 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 @@ -8,12 +8,13 @@  namespace Swift {  	class MainWindow;  	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;  			virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate) = 0;  			boost::signal<void (const String&, const String&, const String& /* certificateFile */, bool)> onLoginRequest;  			boost::signal<void ()> onCancelLoginRequest; | 
 Swift
 Swift