diff options
Diffstat (limited to 'Swift/Controllers')
| -rw-r--r-- | Swift/Controllers/MainController.cpp | 1 | ||||
| -rw-r--r-- | Swift/Controllers/UIInterfaces/LoginWindow.h | 1 | 
2 files changed, 2 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 7ed53a2..046120d 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -104,70 +104,71 @@ MainController::MainController(  			certificateStorageFactory_(certificateStorageFactory),  			settings_(settings),  			uriHandler_(uriHandler),  			idleDetector_(idleDetector),  			loginWindow_(NULL) ,  			useDelayForLatency_(useDelayForLatency),  			eagleMode_(eagleMode),  			ftOverview_(NULL) {  	storages_ = NULL;  	certificateStorage_ = NULL;  	statusTracker_ = NULL;  	presenceNotifier_ = NULL;  	eventNotifier_ = NULL;  	rosterController_ = NULL;  	chatsManager_ = NULL;  	eventWindowController_ = NULL;  	profileController_ = NULL;  	contactEditController_ = NULL;  	userSearchControllerChat_ = NULL;  	userSearchControllerAdd_ = NULL;  	adHocManager_ = NULL;  	quitRequested_ = false;  	clientInitialized_ = false;  	offlineRequested_ = 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_); +	loginWindow_->setShowNotificationToggle(!notifier->isExternallyConfigured());  	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);  	}  	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_); diff --git a/Swift/Controllers/UIInterfaces/LoginWindow.h b/Swift/Controllers/UIInterfaces/LoginWindow.h index 61fcaa1..a8ee5a4 100644 --- a/Swift/Controllers/UIInterfaces/LoginWindow.h +++ b/Swift/Controllers/UIInterfaces/LoginWindow.h @@ -1,37 +1,38 @@  /*   * 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 setShowNotificationToggle(bool) = 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;  			/** 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