summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2017-05-04 15:00:33 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2017-05-04 15:00:33 +0300
commit00529b31b722d64699615241d95ea492134bc9bf (patch)
tree8984aaf701d01923f86fb552c110a46334cf7836 /indra/newview/llavataractions.cpp
parentfd337f2c43470df43e4145fc4a88250688a45c97 (diff)
MAINT-7383 Revise notification for Empty Trash / Purge trash action to include number of items being deleted.
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 2045c3e297..0d0861efcc 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -930,6 +930,16 @@ void LLAvatarActions::shareWithAvatars(LLView * panel)
}
+//static
+void LLAvatarActions::purgeSelectedItems()
+{
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ if (inventory_selected_uuids.empty()) return;
+ LLSD args;
+ args["COUNT"] = (S32)inventory_selected_uuids.size();
+ LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), &callbackPurgeSelectedItems);
+}
+
// static
bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/)
{
@@ -1170,6 +1180,24 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con
return false;
}
+bool LLAvatarActions::callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0)
+ {
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ if (inventory_selected_uuids.empty()) return false;
+
+ std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin();
+ const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end();
+ for (; it != it_end; ++it)
+ {
+ remove_inventory_object(*it, NULL);
+ }
+ }
+ return false;
+}
+
// static
bool LLAvatarActions::handleKick(const LLSD& notification, const LLSD& response)
{