diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-07-30 23:22:41 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-07-30 23:22:41 +0000 |
commit | e97f7728a90dd66014f6b3f0cd5e8d4c71f48691 (patch) | |
tree | 4be178df6b50a3395105cdd3ac0044d6467a9fa3 /indra/newview/llchannelmanager.cpp | |
parent | d5aa10143a0e6457b3326ba839c81b7c956a015e (diff) |
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
Diffstat (limited to 'indra/newview/llchannelmanager.cpp')
-rw-r--r-- | indra/newview/llchannelmanager.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
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 <algorithm> using namespace LLNotificationsUI; @@ -41,6 +44,7 @@ using namespace LLNotificationsUI; //-------------------------------------------------------------------------- LLChannelManager::LLChannelManager() { + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLChannelManager::onLoginCompleted, this)); } //-------------------------------------------------------------------------- @@ -50,6 +54,45 @@ LLChannelManager::~LLChannelManager() } //-------------------------------------------------------------------------- +void LLChannelManager::onLoginCompleted() +{ + S32 hidden_notifications = 0; + + for(std::vector<ChannelElem>::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<LLUICtrl*>(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) { LLScreenChannel* new_channel = NULL; @@ -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; |