summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-12 16:10:28 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-12 16:10:28 +0300
commit929f9d8d5f2e7895016648557fa60c9d4a84baf6 (patch)
treec56628f2b391f7a313613f60dcfaf60915e31039 /indra/newview/llavataractions.cpp
parent14aa4dcdc23feafc537f06e49c48e9d693300103 (diff)
SL-19825 clear selection when right-clicking outside of selected items
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 6bd2b8bbee..313339f131 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -765,8 +765,18 @@ namespace action_give_inventory
static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL)
{
// check selection in the panel
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
- if (inventory_selected_uuids.empty()) return false; // nothing selected
+ std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
+ if (inventory_selected_uuids.empty())
+ {
+ if(panel && panel->getRootFolder() && panel->getRootFolder()->isSingleFolderMode())
+ {
+ inventory_selected_uuids.insert(panel->getRootFolderID());
+ }
+ else
+ {
+ return false; // nothing selected
+ }
+ }
return is_give_inventory_acceptable_ids(inventory_selected_uuids);
}
@@ -940,11 +950,18 @@ namespace action_give_inventory
static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names, LLInventoryPanel* panel = NULL)
{
llassert(avatar_names.size() == avatar_uuids.size());
+ std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);;
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty())
{
- return;
+ if(panel && panel->getRootFolder() && panel->getRootFolder()->isSingleFolderMode())
+ {
+ inventory_selected_uuids.insert(panel->getRootFolderID());
+ }
+ else
+ {
+ return;
+ }
}
give_inventory_ids(avatar_uuids, avatar_names, inventory_selected_uuids);
}