summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-05-18 15:28:08 -0700
committerRichard Linden <none@none>2012-05-18 15:28:08 -0700
commit4c7142f4836da9da77ac6ff2910aaa19506a655b (patch)
treed1c59c3c98d877414fc6448c4e0987f94a76f607
parent7251f780ff5ecf1c804e1d198bbeb015290c919a (diff)
CHUI-96 FIX Cannot dismiss modal dialogs related to merchant outbox
notification duplicate suppression now doesn't generate multiple dialogs
-rw-r--r--indra/newview/llnotificationalerthandler.cpp62
-rw-r--r--indra/newview/llnotificationhandler.h2
-rw-r--r--indra/newview/llscreenchannel.cpp17
3 files changed, 40 insertions, 41 deletions
diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp
index d13e2b629d..2bc9cdd3c1 100644
--- a/indra/newview/llnotificationalerthandler.cpp
+++ b/indra/newview/llnotificationalerthandler.cpp
@@ -82,39 +82,39 @@ bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
}
if (notification->canLogToIM() && notification->hasFormElements())
- {
- const std::string name = LLHandlerUtil::getSubstitutionName(notification);
-
- LLUUID from_id = notification->getPayload()["from_id"];
-
- // firstly create session...
- LLHandlerUtil::spawnIMSession(name, from_id);
-
- // ...then log message to have IM Well notified about new message
- LLHandlerUtil::logToIMP2P(notification);
- }
-
- LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
- LLToast::Params p;
- p.notif_id = notification->getID();
- p.notification = notification;
- p.panel = dynamic_cast<LLToastPanel*>(alert_dialog);
- p.enable_hide_btn = false;
- p.can_fade = false;
- p.is_modal = mIsModal;
- p.on_delete_toast = boost::bind(&LLAlertHandler::onDeleteToast, this, _1);
-
- // Show alert in middle of progress view (during teleport) (EXT-1093)
- LLProgressView* progress = gViewerWindow->getProgressView();
- LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
- mChannel.get()->updatePositionAndSize(rc);
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
- if(channel)
- channel->addToast(p);
+ {
+ const std::string name = LLHandlerUtil::getSubstitutionName(notification);
+
+ LLUUID from_id = notification->getPayload()["from_id"];
+
+ // firstly create session...
+ LLHandlerUtil::spawnIMSession(name, from_id);
+
+ // ...then log message to have IM Well notified about new message
+ LLHandlerUtil::logToIMP2P(notification);
+ }
+
+ LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
+ LLToast::Params p;
+ p.notif_id = notification->getID();
+ p.notification = notification;
+ p.panel = dynamic_cast<LLToastPanel*>(alert_dialog);
+ p.enable_hide_btn = false;
+ p.can_fade = false;
+ p.is_modal = mIsModal;
+ p.on_delete_toast = boost::bind(&LLAlertHandler::onDeleteToast, this, _1);
+
+ // Show alert in middle of progress view (during teleport) (EXT-1093)
+ LLProgressView* progress = gViewerWindow->getProgressView();
+ LLRect rc = progress && progress->getVisible() ? progress->getRect() : gViewerWindow->getWorldViewRectScaled();
+ mChannel.get()->updatePositionAndSize(rc);
+
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
+ if(channel)
+ channel->addToast(p);
return false;
- }
+}
void LLAlertHandler::onChange( LLNotificationPtr notification )
{
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 4d54bb78fc..0899625242 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -258,7 +258,7 @@ public:
: LLNotificationChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"))
{}
/*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); }
- /*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
+ /*virtual*/ void onChange(LLNotificationPtr p) { }
/*virtual*/ void onDelete(LLNotificationPtr p);
bool processNotification(const LLNotificationPtr& p);
};
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 839ca0f9c5..157821d554 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -499,21 +499,20 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
void LLScreenChannel::removeToastByNotificationID(LLUUID id)
{
- std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), id);
- if( it != mToastList.end())
+ std::vector<ToastElem>::iterator it = mToastList.begin();
+ while( it != mToastList.end())
{
+ // find next toast with matching id
+ it = find(it, mToastList.end(), id);
deleteToast(it->getToast());
mToastList.erase(it);
redrawToasts();
}
- else
+ it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
+ if (it != mStoredToastList.end())
{
- it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
- if (it != mStoredToastList.end())
- {
- deleteToast(it->getToast());
- mStoredToastList.erase(it);
- }
+ deleteToast(it->getToast());
+ mStoredToastList.erase(it);
}
}