summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2014-05-28 16:16:09 -0700
committerRichard Linden <none@none>2014-05-28 16:16:09 -0700
commitf06b305d9fe72b6972a2ab0d6047b792fa2706cd (patch)
tree2d1fd9c1d45065098e78c69b98d4354ae5f7cc8b
parent8a45e1915dfa2bb1fed85b8340b0e21584e3dc8a (diff)
ACME-1471 WIP [VWR] Merge multiple Exp Perm dialogs into one
merged multiple experience toasts into a single one reviewed by Cho
-rwxr-xr-xindra/newview/llnotificationhandler.h1
-rwxr-xr-xindra/newview/llnotificationscripthandler.cpp26
-rwxr-xr-xindra/newview/llscreenchannel.cpp14
3 files changed, 28 insertions, 13 deletions
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index bff4efa9ea..e3270547c1 100755
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -169,6 +169,7 @@ public:
virtual ~LLScriptHandler();
virtual void onDelete(LLNotificationPtr p);
+ virtual void onChange(LLNotificationPtr p);
virtual bool processNotification(const LLNotificationPtr& p);
protected:
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index a3b15931c6..65b1d5f95f 100755
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -116,18 +116,28 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
return false;
}
+void LLScriptHandler::onChange( LLNotificationPtr notification )
+{
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if (channel)
+ {
+ LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
+ channel->modifyToastByNotificationID(notification->getID(), notify_box);
+
+ }
+}
void LLScriptHandler::onDelete( LLNotificationPtr notification )
- {
+{
if(notification->hasFormElements() && !notification->canShowToast())
- {
- LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
- }
- else
- {
- mChannel.get()->removeToastByNotificationID(notification->getID());
- }
+ {
+ LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
+ }
+ else
+ {
+ mChannel.get()->removeToastByNotificationID(notification->getID());
}
+}
//--------------------------------------------------------------------------
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 6a840f3f40..0318199050 100755
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -533,19 +533,23 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
{
std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), id);
+ LLPanel* panel_to_delete = panel;
+
if( it != mToastList.end() && panel)
{
LLToast* toast = it->getToast();
if (toast)
{
- LLPanel* old_panel = toast->getPanel();
- toast->removeChild(old_panel);
- delete old_panel;
- toast->insertPanel(panel);
- toast->startTimer();
+ LLPanel* old_panel = toast->getPanel();
+ toast->removeChild(old_panel);
+ panel_to_delete = old_panel;
+ toast->insertPanel(panel);
+ toast->startTimer();
}
redrawToasts();
}
+
+ delete panel_to_delete;
}
//--------------------------------------------------------------------------