diff options
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 6 | ||||
-rw-r--r-- | Swift/Controllers/MainController.h | 1 | ||||
-rw-r--r-- | Swift/Controllers/Settings/DummySettingsProvider.h | 1 | ||||
-rw-r--r-- | Swift/Controllers/Settings/SettingsProvider.h | 1 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/LoginWindow.h | 2 |
5 files changed, 11 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 98599bb..31a1d5a 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -137,6 +137,7 @@ MainController::MainController( loginWindow_->selectUser(selectedLoginJID); loginWindow_->setLoginAutomatically(loginAutomatically); loginWindow_->onLoginRequest.connect(boost::bind(&MainController::handleLoginRequest, this, _1, _2, _3, _4, _5)); + loginWindow_->onPurgeSavedLoginRequest.connect(boost::bind(&MainController::handlePurgeSavedLoginRequest, this, _1)); loginWindow_->onCancelLoginRequest.connect(boost::bind(&MainController::handleCancelLoginRequest, this)); loginWindow_->onQuitRequest.connect(boost::bind(&MainController::handleQuitRequest, this)); @@ -367,6 +368,11 @@ void MainController::handleLoginRequest(const String &username, const String &pa performLoginFromCachedCredentials(); } +void MainController::handlePurgeSavedLoginRequest(const String& username) { + settings_->removeProfile(username); + loginWindow_->removeAvailableAccount(username); +} + void MainController::performLoginFromCachedCredentials() { /* If we logged in with a bare JID, and we have a full bound JID, re-login with the * bound JID to try and keep dynamically assigned resources */ diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h index 09f17d2..07bf661 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/MainController.h @@ -92,6 +92,7 @@ namespace Swift { void handleEventQueueLengthChange(int count); void handleVCardReceived(const JID& j, VCard::ref vCard); void handleUIEvent(boost::shared_ptr<UIEvent> event); + void handlePurgeSavedLoginRequest(const String& username); void sendPresence(boost::shared_ptr<Presence> presence); void handleInputIdleChanged(bool); void logout(); diff --git a/Swift/Controllers/Settings/DummySettingsProvider.h b/Swift/Controllers/Settings/DummySettingsProvider.h index 6c3dd52..631b68d 100644 --- a/Swift/Controllers/Settings/DummySettingsProvider.h +++ b/Swift/Controllers/Settings/DummySettingsProvider.h @@ -21,6 +21,7 @@ class DummySettingsProvider : public SettingsProvider { virtual void storeInt(const String &, int ) {} virtual std::vector<String> getAvailableProfiles() {return std::vector<String>();} virtual void createProfile(const String& ) {} + virtual void removeProfile(const String& ) {} }; } diff --git a/Swift/Controllers/Settings/SettingsProvider.h b/Swift/Controllers/Settings/SettingsProvider.h index 7ddf789..a2cdad4 100644 --- a/Swift/Controllers/Settings/SettingsProvider.h +++ b/Swift/Controllers/Settings/SettingsProvider.h @@ -24,6 +24,7 @@ class SettingsProvider { virtual void storeInt(const String &settingPath, int settingValue) = 0; virtual std::vector<String> getAvailableProfiles() = 0; virtual void createProfile(const String& profile) = 0; + virtual void removeProfile(const String& profile) = 0; }; } diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index a25cdb9..fc28424 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -23,6 +23,7 @@ namespace Swift { virtual void setMessage(const String&) = 0; virtual void setIsLoggingIn(bool loggingIn) = 0; virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate) = 0; + virtual void removeAvailableAccount(const String& jid) = 0; boost::signal<void (const String&, const String&, const String& /* certificateFile */, bool /* remember password*/, bool /* login automatically */)> onLoginRequest; virtual void setLoginAutomatically(bool loginAutomatically) = 0; virtual void quit() = 0; @@ -31,5 +32,6 @@ namespace Swift { boost::signal<void ()> onCancelLoginRequest; boost::signal<void ()> onQuitRequest; + boost::signal<void (const String&)> onPurgeSavedLoginRequest; }; } |