From d3ef6289529aafda3675b811ccc3ab9058d54dfa Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 13 Oct 2011 19:16:54 -0700 Subject: EXP-1319 FIX Nearby chat toasts should not underlap toolbars --- indra/newview/llchannelmanager.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'indra/newview/llchannelmanager.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 4ab3d8dc98..59842aeb6c 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -68,7 +68,7 @@ LLChannelManager::~LLChannelManager() LLScreenChannel* LLChannelManager::createNotificationChannel() { // creating params for a channel - LLChannelManager::Params p; + LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); p.channel_align = CA_RIGHT; @@ -106,7 +106,7 @@ void LLChannelManager::onLoginCompleted() else { // create a channel for the StartUp Toast - LLChannelManager::Params p; + LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID")); p.channel_align = CA_RIGHT; mStartUpChannel = createChannel(p); @@ -164,26 +164,15 @@ LLScreenChannelBase* LLChannelManager::addChannel(LLScreenChannelBase* channel) return channel; } -LLScreenChannel* LLChannelManager::createChannel(LLChannelManager::Params& p) +LLScreenChannel* LLChannelManager::createChannel(LLScreenChannelBase::Params& p) { - LLScreenChannel* new_channel = new LLScreenChannel(p.id); + LLScreenChannel* new_channel = new LLScreenChannel(p); - 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); - - addChannel(new_channel); - } + addChannel(new_channel); return new_channel; } -LLScreenChannelBase* LLChannelManager::getChannel(LLChannelManager::Params& p) +LLScreenChannelBase* LLChannelManager::getChannel(LLScreenChannelBase::Params& p) { LLScreenChannelBase* new_channel = findChannelByID(p.id); @@ -195,7 +184,7 @@ LLScreenChannelBase* LLChannelManager::getChannel(LLChannelManager::Params& p) } //-------------------------------------------------------------------------- -LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID id) +LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID& id) { std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) @@ -207,7 +196,7 @@ LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID id) } //-------------------------------------------------------------------------- -void LLChannelManager::removeChannelByID(const LLUUID id) +void LLChannelManager::removeChannelByID(const LLUUID& id) { std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) -- cgit v1.2.3 From cf98cdf69f481dd473363d4a80a80f27e96f87e8 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 14 Oct 2011 16:43:43 -0700 Subject: fix for crash on exit --- indra/newview/llchannelmanager.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'indra/newview/llchannelmanager.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 59842aeb6c..ca635eaa8f 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -58,7 +58,10 @@ LLChannelManager::~LLChannelManager() { for(std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) { - delete (*it).channel; + LLScreenChannelBase* channel = it->channel.get(); + if (!channel) continue; + + delete channel; } mChannelList.clear(); @@ -84,16 +87,19 @@ void LLChannelManager::onLoginCompleted() // calc a number of all offline notifications for(std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); ++it) { + LLScreenChannelBase* channel = it->channel.get(); + if (!channel) continue; + // don't calc notifications for Nearby Chat - if((*it).channel->getChannelID() == LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))) + if(channel->getChannelID() == LLUUID(gSavedSettings.getString("NearByChatChannelUUID"))) { continue; } // don't calc notifications for channels that always show their notifications - if(!(*it).channel->getDisplayToastsAlways()) + if(!channel->getDisplayToastsAlways()) { - away_notifications +=(*it).channel->getNumberOfHiddenToasts(); + away_notifications +=channel->getNumberOfHiddenToasts(); } } @@ -157,7 +163,7 @@ LLScreenChannelBase* LLChannelManager::addChannel(LLScreenChannelBase* channel) ChannelElem new_elem; new_elem.id = channel->getChannelID(); - new_elem.channel = channel; + new_elem.channel = channel->getHandle(); mChannelList.push_back(new_elem); @@ -189,7 +195,7 @@ LLScreenChannelBase* LLChannelManager::findChannelByID(const LLUUID& id) std::vector::iterator it = find(mChannelList.begin(), mChannelList.end(), id); if(it != mChannelList.end()) { - return (*it).channel; + return (*it).channel.get(); } return NULL; @@ -211,7 +217,10 @@ void LLChannelManager::muteAllChannels(bool mute) for (std::vector::iterator it = mChannelList.begin(); it != mChannelList.end(); it++) { - it->channel->setShowToasts(!mute); + if (it->channel.get()) + { + it->channel.get()->setShowToasts(!mute); + } } } -- cgit v1.2.3 From 0976964f8315aab5879678f07318267b6887ed95 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 14 Oct 2011 18:25:30 -0700 Subject: EXP-1336 FIX Move Notifications to upper right also made toolbar buttons not trigger if enabled callback returns false --- indra/newview/llchannelmanager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llchannelmanager.cpp') diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index ca635eaa8f..987651fc80 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -74,6 +74,7 @@ LLScreenChannel* LLChannelManager::createNotificationChannel() LLScreenChannelBase::Params p; p.id = LLUUID(gSavedSettings.getString("NotificationChannelUUID")); p.channel_align = CA_RIGHT; + p.toast_align = NA_TOP; // Getting a Channel for our notifications return dynamic_cast (LLChannelManager::getInstance()->getChannel(p)); -- cgit v1.2.3