summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-10-29 10:59:11 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-10-29 10:59:11 (GMT)
commit06e40dd580e43e11e519acbb2d30156c18081f79 (patch)
tree83503e4acac19c40c745c44504e3675894cb2dea /Swift/Controllers/MainController.cpp
parent7cb49cb679156151f19a556de76274c5a25e6de2 (diff)
downloadswift-contrib-06e40dd580e43e11e519acbb2d30156c18081f79.zip
swift-contrib-06e40dd580e43e11e519acbb2d30156c18081f79.tar.bz2
Make the --eagle-mode banner per-login, not per-run
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
-rw-r--r--Swift/Controllers/MainController.cpp2
1 files changed, 0 insertions, 2 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();