From af98aad98d43ec8b128ecac3089426d6ae6edc3f Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 26 Aug 2009 20:47:27 +0000 Subject: svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3 EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717 --- indra/newview/llchannelmanager.cpp | 68 ++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 17 deletions(-) (limited to 'indra/newview/llchannelmanager.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 57ea6064a4..a8373491cf 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -36,6 +36,7 @@ #include "llappviewer.h" #include "llviewercontrol.h" +#include "llimview.h" #include @@ -62,44 +63,66 @@ void LLChannelManager::onLoginCompleted() for(std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) { + if((*it).channel->getChannelID() == LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))) + { + continue; + } + if(!(*it).channel->getDisplayToastsAlways()) { away_notifications +=(*it).channel->getNumberOfHiddenToasts(); } } + // *TODO: calculate IM notifications + away_notifications += gIMMgr->getNumberOfUnreadIM(); + if(!away_notifications) { - LLScreenChannel::setStartUpToastShown(); + onStartUpToastClose(); return; } LLChannelManager::Params p; - p.id = LLUUID(STARTUP_CHANNEL_ID); + p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); p.channel_right_bound = getRootView()->getRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); p.channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mStartUpChannel = createChannel(p); if(!mStartUpChannel) + { + onStartUpToastClose(); return; + } - static_cast(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::removeStartUpChannel, this)); + mStartUpChannel->setShowToasts(true); + static_cast(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("ChannelBottomPanelMargin"), gSavedSettings.getS32("StartUpToastTime")); } //-------------------------------------------------------------------------- -void LLChannelManager::removeStartUpChannel() +void LLChannelManager::onStartUpToastClose() { - if(!mStartUpChannel) - return; + if(mStartUpChannel) + { + mStartUpChannel->setVisible(FALSE); + mStartUpChannel->closeStartUpToast(); + getRootView()->removeChild(mStartUpChannel); + removeChannelByID(LLUUID(gSavedSettings.getString("StartUpChannelUUID"))); + delete mStartUpChannel; + mStartUpChannel = NULL; + } - mStartUpChannel->setVisible(FALSE); - mStartUpChannel->closeStartUpToast(); - getRootView()->removeChild(mStartUpChannel); - delete mStartUpChannel; - mStartUpChannel = NULL; + // set StartUp Toast Flag + LLScreenChannel::setStartUpToastShown(); + + // allow all other channels to show incoming toasts + for(std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) + { + (*it).channel->setShowToasts(true); + } - //force NEARBY CHAT CHANNEL to repost all toasts if present + // force NEARBY CHAT CHANNEL to repost all toasts if present LLScreenChannel* nearby_channel = getChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); nearby_channel->loadStoredToastsToChannel(); nearby_channel->setCanStoreToasts(false); @@ -122,7 +145,7 @@ LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) if(new_channel) return new_channel; - new_channel = new LLScreenChannel(); + new_channel = new LLScreenChannel(p.id); getRootView()->addChild(new_channel); new_channel->init(p.channel_right_bound - p.channel_width, p.channel_right_bound); new_channel->setToastAlignment(p.align); @@ -179,15 +202,26 @@ void LLChannelManager::reshape(S32 width, S32 height, BOOL called_from_parent) } //-------------------------------------------------------------------------- - -LLScreenChannel* LLChannelManager::getStartUpChannel() +void LLChannelManager::removeChannelByID(const LLUUID id) { - return mStartUpChannel; + std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); + if(it != mChannelList.end()) + { + mChannelList.erase(it); + } } //-------------------------------------------------------------------------- +void LLChannelManager::removeChannelByChiclet(const LLChiclet* chiclet) +{ + std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), chiclet); + if(it != mChannelList.end()) + { + mChannelList.erase(it); + } +} - +//-------------------------------------------------------------------------- -- cgit v1.2.3