diff options
| author | Kevin Smith <git@kismith.co.uk> | 2011-10-29 10:59:11 (GMT) |
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2011-10-29 10:59:11 (GMT) |
| commit | 06e40dd580e43e11e519acbb2d30156c18081f79 (patch) | |
| tree | 83503e4acac19c40c745c44504e3675894cb2dea /Swift/Controllers | |
| parent | 7cb49cb679156151f19a556de76274c5a25e6de2 (diff) | |
| download | swift-contrib-06e40dd580e43e11e519acbb2d30156c18081f79.zip swift-contrib-06e40dd580e43e11e519acbb2d30156c18081f79.tar.bz2 | |
Make the --eagle-mode banner per-login, not per-run
Diffstat (limited to 'Swift/Controllers')
| -rw-r--r-- | Swift/Controllers/MainController.cpp | 2 | ||||
| -rw-r--r-- | Swift/Controllers/UIInterfaces/LoginWindow.h | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index f4e7adc..ce347ab 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -123,72 +123,70 @@ MainController::MainController( quitRequested_ = false; clientInitialized_ = false; timeBeforeNextReconnect_ = -1; dock_ = dock; uiEventStream_ = new UIEventStream(); notifier_ = new TogglableNotifier(notifier); eventController_ = new EventController(); eventController_->onEventQueueLengthChange.connect(boost::bind(&MainController::handleEventQueueLengthChange, this, _1)); systemTrayController_ = new SystemTrayController(eventController_, systemTray); loginWindow_ = uiFactory_->createLoginWindow(uiEventStream_); soundEventController_ = new SoundEventController(eventController_, soundPlayer, settings, uiEventStream_); xmppURIController_ = new XMPPURIController(uriHandler_, uiEventStream_); std::string selectedLoginJID = settings_->getStringSetting("lastLoginJID"); bool loginAutomatically = settings_->getBoolSetting("loginAutomatically", false); std::string cachedPassword; std::string cachedCertificate; if (!eagleMode_) { foreach (std::string profile, settings->getAvailableProfiles()) { ProfileSettingsProvider profileSettings(profile, settings); std::string password = eagleMode ? "" : profileSettings.getStringSetting("pass"); std::string certificate = profileSettings.getStringSetting("certificate"); std::string jid = profileSettings.getStringSetting("jid"); loginWindow_->addAvailableAccount(jid, password, certificate); if (jid == selectedLoginJID) { cachedPassword = password; cachedCertificate = certificate; } } loginWindow_->selectUser(selectedLoginJID); loginWindow_->setLoginAutomatically(loginAutomatically); - } else { - loginWindow_->setRememberingAllowed(false); } 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)); idleDetector_->setIdleTimeSeconds(600); idleDetector_->onIdleChanged.connect(boost::bind(&MainController::handleInputIdleChanged, this, _1)); xmlConsoleController_ = new XMLConsoleController(uiEventStream_, uiFactory_); fileTransferListController_ = new FileTransferListController(uiEventStream_, uiFactory_); uiEventStream_->onUIEvent.connect(boost::bind(&MainController::handleUIEvent, this, _1)); bool enabled = settings_->getBoolSetting(SHOW_NOTIFICATIONS, true); uiEventStream_->send(boost::shared_ptr<ToggleNotificationsUIEvent>(new ToggleNotificationsUIEvent(enabled))); if (loginAutomatically) { profileSettings_ = new ProfileSettingsProvider(selectedLoginJID, settings_); handleLoginRequest(selectedLoginJID, cachedPassword, cachedCertificate, true, true); } else { profileSettings_ = NULL; } } MainController::~MainController() { idleDetector_->onIdleChanged.disconnect(boost::bind(&MainController::handleInputIdleChanged, this, _1)); purgeCachedCredentials(); //setManagersOffline(); eventController_->disconnectAll(); resetClient(); diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index fcaeb42..61fcaa1 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -1,39 +1,37 @@ /* * Copyright (c) 2010 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include "Swiften/Base/boost_bsignals.h" #include <boost/shared_ptr.hpp> #include <string> #include <Swiften/TLS/Certificate.h> namespace Swift { class MainWindow; class LoginWindow { public: virtual ~LoginWindow() {}; virtual void selectUser(const std::string&) = 0; virtual void morphInto(MainWindow *mainWindow) = 0; virtual void loggedOut() = 0; virtual void setMessage(const std::string&) = 0; virtual void setIsLoggingIn(bool loggingIn) = 0; virtual void addAvailableAccount(const std::string& defaultJID, const std::string& defaultPassword, const std::string& defaultCertificate) = 0; virtual void removeAvailableAccount(const std::string& jid) = 0; boost::signal<void (const std::string&, const std::string&, const std::string& /* certificateFile */, bool /* remember password*/, bool /* login automatically */)> onLoginRequest; virtual void setLoginAutomatically(bool loginAutomatically) = 0; virtual void quit() = 0; - /** Disable any GUI elements that suggest saving of passwords. */ - virtual void setRememberingAllowed(bool allowed) = 0; /** Blocking request whether a cert should be permanently trusted.*/ virtual bool askUserToTrustCertificatePermanently(const std::string& message, Certificate::ref) = 0; boost::signal<void ()> onCancelLoginRequest; boost::signal<void ()> onQuitRequest; boost::signal<void (const std::string&)> onPurgeSavedLoginRequest; }; } |
Swift