summaryrefslogtreecommitdiff
path: root/indra/newview/llscriptfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llscriptfloater.cpp')
-rw-r--r--indra/newview/llscriptfloater.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index b68fc3b002..75797dae81 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -176,7 +176,15 @@ void LLScriptFloater::onClose(bool app_quitting)
if(getNotificationId().notNull())
{
- LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId());
+ // we shouldn't kill notification on exit since it may be used as persistent.
+ if (app_quitting)
+ {
+ LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId());
+ }
+ else
+ {
+ LLScriptFloaterManager::getInstance()->removeNotification(getNotificationId());
+ }
}
}
@@ -352,7 +360,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
set_new_message |= !floater->hasFocus();
}
- onRemoveNotification(it->first);
+ removeNotification(it->first);
}
}
@@ -379,6 +387,17 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
toggleScriptFloater(notification_id, set_new_message);
}
+void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id)
+{
+ LLNotificationPtr notification = LLNotifications::instance().find(notification_id);
+ if (notification != NULL && !notification->isCancelled())
+ {
+ LLNotificationsUtil::cancel(notification);
+ }
+
+ onRemoveNotification(notification_id);
+}
+
void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
@@ -392,6 +411,8 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
LLIMWellWindow::getInstance()->removeObjectRow(notification_id);
+ mNotifications.erase(notification_id);
+
// close floater
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
if(floater)
@@ -400,8 +421,6 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
floater->setNotificationId(LLUUID::null);
floater->closeFloater();
}
-
- mNotifications.erase(notification_id);
}
void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message)