diff options
| author | Steven Bennetts <steve@lindenlab.com> | 2009-09-29 19:37:05 +0000 |
|---|---|---|
| committer | Steven Bennetts <steve@lindenlab.com> | 2009-09-29 19:37:05 +0000 |
| commit | 606b381c9fbc43c214afd26fb2e2598eec656b66 (patch) | |
| tree | 422a6d5d94d50bd97ac5bcbdb52f0f6de083c6e7 /indra/newview/llchannelmanager.cpp | |
| parent | 751cc7cf68bb4d766e8ecaaf76af054dcfbbe9dc (diff) | |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1830 https://svn.aws.productengine.com/secondlife/pe/stable-2@1839 -> viewer-2.0.0-3
JIRAS:
EXT-96 EXT-204 EXT-312 EXT-334 EXT-479 EXT-498 EXT-514 EXT-637 EXT-647 EXT-746 EXT-748 EXT-749 EXT-757 EXT-789 EXT-794 EXT-808 EXT-817 EXT-823 EXT-831 EXT-834 EXT-837 EXT-844 EXT-848 EXT-862 EXT-876 EXT-896 EXT-897 EXT-898 EXT-899 EXT-910 EXT-912 EXT-918 EXT-921 EXT-925 EXT-926 EXT-928 EXT-930 EXT-931 EXT-935 EXT-938 EXT-939 EXT-952 EXT-985 EXT-986 EXT-992 EXT-994 EXT-995 EXT-996 EXT-997 EXT-998 EXT-1001 EXT-1004 EXT-1010 EXT-1012 EXT-1016 EXT-1018 EXT-1020 EXT-1028 EXT-1041 EXT-1044 EXT-1051 EXT-1052 EXT-1061 EXT-1069 EXT-1071 EXT-1074 EXT-1075 EXT-1076 EXT-1078 EXT-1080 EXT-1081 EXT-1082 EXT-1083 EXT-1085 EXT-1092 EXT-1093 EXT-1099 EXT-1100 EXT-1101 EXT-1104 EXT-1106 EXT-1111 EXT-1113 EXT-1114 EXT-1115 EXT-1116 EXT-1118 EXT-1119 EXT-1129 EXT-1132 EXT-1135 EXT-1138 EXT-1142 EXT-1161 EXT-1162 EXT-1178 EXT-1180
* NEW DEVELOPMENT:
* EXT-898 - Add dock/undock support for camera and movement controls
* Avatar list changes
* Bottom bar changes: menu, docking, visibility
* Camera changes
* Camera & Movement Floaters
* Dockable Floaters (LLDockableFloater)
* Removed LLListCtrl
* Toast / Notification changes: signal / destruction changes, ordering
* Nearby chat input should display active voice indicator
QA NOTES:
* Message Well Window is ready to be tested for regression & matching the spec.
* Verify Group List Item L&F
* Verify All tabs in People Panel
* Verify that Picks behavior is not changed
Diffstat (limited to 'indra/newview/llchannelmanager.cpp')
| -rw-r--r-- | indra/newview/llchannelmanager.cpp | 126 |
1 files changed, 54 insertions, 72 deletions
diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index a8373491cf..7ae9976338 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -37,6 +37,8 @@ #include "llappviewer.h" #include "llviewercontrol.h" #include "llimview.h" +#include "llbottomtray.h" +#include "llviewerwindow.h" #include <algorithm> @@ -48,12 +50,34 @@ LLChannelManager::LLChannelManager() LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLChannelManager::onLoginCompleted, this)); mChannelList.clear(); mStartUpChannel = NULL; + + if(!gViewerWindow) + { + llerrs << "LLChannelManager::LLChannelManager() - viwer window is not initialized yet" << llendl; + } } //-------------------------------------------------------------------------- LLChannelManager::~LLChannelManager() { - //All channels are being deleted by Parent View + for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) + { + delete (*it).channel; + } + + mChannelList.clear(); +} + +//-------------------------------------------------------------------------- +LLScreenChannel* LLChannelManager::createNotificationChannel() +{ + // creating params for a channel + LLChannelManager::Params p; + p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); + p.channel_align = CA_RIGHT; + + // Getting a Channel for our notifications + return LLChannelManager::getInstance()->getChannel(p); } //-------------------------------------------------------------------------- @@ -61,20 +85,22 @@ void LLChannelManager::onLoginCompleted() { S32 away_notifications = 0; + // calc a number of all offline notifications for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) { + // don't calc notifications for Nearby Chat if((*it).channel->getChannelID() == LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))) { continue; } + // don't calc notifications for channels that always show their notifications if(!(*it).channel->getDisplayToastsAlways()) { away_notifications +=(*it).channel->getNumberOfHiddenToasts(); } } - // *TODO: calculate IM notifications away_notifications += gIMMgr->getNumberOfUnreadIM(); if(!away_notifications) @@ -83,11 +109,11 @@ void LLChannelManager::onLoginCompleted() return; } + // create a channel for the StartUp Toast LLChannelManager::Params p; 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); + p.channel_align = CA_RIGHT; + mStartUpChannel = getChannel(p); if(!mStartUpChannel) { @@ -95,8 +121,13 @@ void LLChannelManager::onLoginCompleted() return; } + // init channel's position and size + S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); + mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound); mStartUpChannel->setShowToasts(true); - static_cast<LLUICtrl*>(mStartUpChannel)->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); + + mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("ChannelBottomPanelMargin"), gSavedSettings.getS32("StartUpToastTime")); } @@ -107,76 +138,56 @@ void LLChannelManager::onStartUpToastClose() { mStartUpChannel->setVisible(FALSE); mStartUpChannel->closeStartUpToast(); - getRootView()->removeChild(mStartUpChannel); removeChannelByID(LLUUID(gSavedSettings.getString("StartUpChannelUUID"))); delete mStartUpChannel; mStartUpChannel = NULL; } - // set StartUp Toast Flag + // set StartUp Toast Flag to allow all other channels to show incoming toasts LLScreenChannel::setStartUpToastShown(); - // allow all other channels to show incoming toasts - for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) - { - (*it).channel->setShowToasts(true); - } - // force NEARBY CHAT CHANNEL to repost all toasts if present - LLScreenChannel* nearby_channel = getChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); + LLScreenChannel* nearby_channel = findChannelByID(LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))); nearby_channel->loadStoredToastsToChannel(); nearby_channel->setCanStoreToasts(false); } //-------------------------------------------------------------------------- -LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) +LLScreenChannel* LLChannelManager::getChannel(LLChannelManager::Params& p) { LLScreenChannel* new_channel = NULL; - if(!p.chiclet) - { - new_channel = getChannelByID(p.id); - } - else - { - new_channel = getChannelByChiclet(p.chiclet); - } + new_channel = findChannelByID(p.id); if(new_channel) return new_channel; 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); + + if(!new_channel) + { + llerrs << "LLChannelManager::getChannel(LLChannelManager::Params& p) - can't create a channel!" << llendl; + } + else + { + new_channel->setToastAlignment(p.toast_align); + new_channel->setChannelAlignment(p.channel_align); new_channel->setDisplayToastsAlways(p.display_toasts_always); ChannelElem new_elem; new_elem.id = p.id; - new_elem.chiclet = p.chiclet; new_elem.channel = new_channel; - - mChannelList.push_back(new_elem); //TODO: remove chiclet from ScreenChannel? - - return new_channel; -} -//-------------------------------------------------------------------------- -LLScreenChannel* LLChannelManager::getChannelByID(const LLUUID id) -{ - std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), id); - if(it != mChannelList.end()) - { - return (*it).channel; + mChannelList.push_back(new_elem); } - return NULL; + return new_channel; } //-------------------------------------------------------------------------- -LLScreenChannel* LLChannelManager::getChannelByChiclet(const LLChiclet* chiclet) +LLScreenChannel* LLChannelManager::findChannelByID(const LLUUID id) { - std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), chiclet); + std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) { return (*it).channel; @@ -186,22 +197,6 @@ LLScreenChannel* LLChannelManager::getChannelByChiclet(const LLChiclet* chiclet) } //-------------------------------------------------------------------------- -void LLChannelManager::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - for(std::vector<ChannelElem>::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) - { - if((*it).channel->getToastAlignment() == NA_CENTRE) - { - LLRect channel_rect = (*it).channel->getRect(); - S32 screen_width = getRootView()->getRect().getWidth(); - channel_rect.setLeftTopAndSize(screen_width/2, channel_rect.mTop, channel_rect.getWidth(), channel_rect.getHeight()); - (*it).channel->setRect(channel_rect); - (*it).channel->showToasts(); - } - } -} - -//-------------------------------------------------------------------------- void LLChannelManager::removeChannelByID(const LLUUID id) { std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), id); @@ -212,18 +207,5 @@ void LLChannelManager::removeChannelByID(const LLUUID id) } //-------------------------------------------------------------------------- -void LLChannelManager::removeChannelByChiclet(const LLChiclet* chiclet) -{ - std::vector<ChannelElem>::iterator it = find(mChannelList.begin(), mChannelList.end(), chiclet); - if(it != mChannelList.end()) - { - mChannelList.erase(it); - } -} - -//-------------------------------------------------------------------------- - - - |
