From 8dae4c265e75e93ce3691ea1143e314f2fa84d93 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 29 Apr 2010 15:35:44 +0300 Subject: fixed EXT-6736 Notecard floater missing Keep/Discard Buttons (vwr 2.0) Added functionality to close hidden IM toasts when IM floater opens. reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/321/ --HG-- branch : product-engine --- indra/newview/llscreenchannel.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index af440a3689..de1da248c1 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -706,6 +706,31 @@ void LLScreenChannel::hideToast(const LLUUID& notification_id) } } +void LLScreenChannel::closeHiddenToasts(const Matcher& matcher) +{ + // since we can't guarantee that close toast operation doesn't change mToastList + // we collect matched toasts that should be closed into separate list + std::list toasts; + for (std::vector::iterator it = mToastList.begin(); it + != mToastList.end(); it++) + { + LLToast * toast = it->toast; + // add to list valid toast that match to provided matcher criteria + if (toast != NULL && !toast->isDead() && toast->getNotification() != NULL + && !toast->getVisible() && matcher.matches(toast->getNotification())) + { + toasts.push_back(*it); + } + } + + // close collected toasts + for (std::list::iterator it = toasts.begin(); it + != toasts.end(); it++) + { + it->toast->closeFloater(); + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::removeToastsFromChannel() { -- cgit v1.2.3