From e97f7728a90dd66014f6b3f0cd5e8d4c71f48691 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 30 Jul 2009 23:22:41 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0/indra@1170 https://svn.aws.productengine.com/secondlife/pe/stable-1/indra@1187 -> viewer-2.0.0-3 --- indra/newview/llchannelmanager.cpp | 46 +++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchannelmanager.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 723bf2a248..0eb0801a2c 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -34,6 +34,9 @@ #include "llchannelmanager.h" +#include "llappviewer.h" +#include "llviewercontrol.h" + #include using namespace LLNotificationsUI; @@ -41,6 +44,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLChannelManager::LLChannelManager() { + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLChannelManager::onLoginCompleted, this)); } //-------------------------------------------------------------------------- @@ -49,6 +53,45 @@ LLChannelManager::~LLChannelManager() //All channels are being deleted by Parent View } +//-------------------------------------------------------------------------- +void LLChannelManager::onLoginCompleted() +{ + S32 hidden_notifications = 0; + + for(std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) + { + //(*it).channel->showToasts(); + hidden_notifications +=(*it).channel->getNumberOfHiddenToasts(); + } + + if(!hidden_notifications) + { + LLScreenChannel::setStartUpToastShown(); + return; + } + + LLChannelManager::Params p; + p.id = LLUUID(STARTUP_CHANNEL_ID); + p.channel_right_bound = getRootView()->getRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + p.channel_width = gSavedSettings.getS32("NotifyBoxWidth"); + mStartUpChannel = NULL; + mStartUpChannel = createChannel(p); + + if(!mStartUpChannel) + return; + + static_cast(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::enableShowToasts, this)); + mStartUpChannel->setNumberOfHiddenToasts(hidden_notifications); + mStartUpChannel->createOverflowToast(gSavedSettings.getS32("ChannelBottomPanelMargin"), gSavedSettings.getS32("StartUpToastTime")); +} + +//-------------------------------------------------------------------------- +void LLChannelManager::enableShowToasts() +{ + LLScreenChannel::setStartUpToastShown(); + delete mStartUpChannel; +} + //-------------------------------------------------------------------------- LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) { @@ -67,7 +110,8 @@ LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) return new_channel; new_channel = new LLScreenChannel(); - new_channel->init(p.channel_right_bound - p.channel_width, getRootView()); + getRootView()->addChild(new_channel); + new_channel->init(p.channel_right_bound - p.channel_width, p.channel_right_bound); new_channel->setToastAlignment(p.align); ChannelElem new_elem; -- cgit v1.2.3