From d0c029c6094bf23ad9a016d9029b830d674a566a Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 11 Jan 2010 14:12:03 +0200 Subject: Fixed normal bug EXT-3764 - Notifications should not stack when selected from the Well. --HG-- branch : product-engine --- indra/newview/llscreenchannel.cpp | 14 +++++++++++++- indra/newview/llscreenchannel.h | 2 ++ indra/newview/llsyswellwindow.cpp | 4 ++++ indra/newview/llsyswellwindow.h | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index da3f1543dd..d0b537cdfc 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -357,7 +357,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) toast->setIsHidden(false); toast->resetTimer(); mToastList.push_back((*it)); - mStoredToastList.erase(it); redrawToasts(); } @@ -778,6 +777,19 @@ void LLScreenChannel::hideToastsFromScreen() (*it).toast->setVisible(FALSE); } +//-------------------------------------------------------------------------- +void LLScreenChannel::hideToast(const LLUUID& notification_id) +{ + std::vector::iterator it = find(mToastList.begin(), mToastList.end(), notification_id); + if(mToastList.end() != it) + { + ToastElem te = *it; + te.toast->setVisible(FALSE); + te.toast->stopTimer(); + mToastList.erase(it); + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::removeToastsFromChannel() { diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 38f27f756b..661b9e4e60 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -176,6 +176,8 @@ public: void modifyToastByNotificationID(LLUUID id, LLPanel* panel); // hide all toasts from screen, but not remove them from a channel void hideToastsFromScreen(); + // hide toast by notification id + void hideToast(const LLUUID& notification_id); // removes all toasts from a channel void removeToastsFromChannel(); // show all toasts in a channel diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 44cf82540a..b5884e8364 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -701,7 +701,11 @@ void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) { LLUUID id = item->getID(); if(mChannel) + { + mChannel->hideToast(mLoadedToastId); mChannel->loadStoredToastByNotificationIDToChannel(id); + mLoadedToastId = id; + } } void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index ded3abcbf4..0c81d1f369 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -162,6 +162,9 @@ private: void onItemClick(LLSysWellItem* item); void onItemClose(LLSysWellItem* item); + // ID of a toast loaded by user (by clicking notification well item) + LLUUID mLoadedToastId; + }; /** -- cgit v1.2.3