summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-21 15:37:25 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-21 15:37:25 +0300
commit4cf42435733a111610a13620c56728b1b659b1e9 (patch)
tree5ac5ac10070448dcfdf38bf36e23ea9b6b766f95 /indra/newview/llavataractions.cpp
parentdcb6b5489d2c3cfdb13d5862f8cb29fee06745a7 (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merge branch 'master' into DRTVWR-483
# Conflicts: # indra/newview/CMakeLists.txt # indra/newview/llviewerfloaterreg.cpp # indra/newview/skins/default/xui/de/floater_preview_texture.xml # indra/newview/skins/default/xui/es/floater_preview_texture.xml # indra/newview/skins/default/xui/fr/floater_preview_texture.xml # indra/newview/skins/default/xui/it/floater_preview_texture.xml # indra/newview/skins/default/xui/ja/panel_edit_classified.xml # indra/newview/skins/default/xui/ja/panel_me.xml # indra/newview/skins/default/xui/ru/floater_preview_texture.xml # indra/newview/skins/default/xui/tr/floater_picks.xml # indra/newview/skins/default/xui/tr/floater_preview_texture.xml # indra/newview/skins/default/xui/tr/panel_edit_classified.xml # indra/newview/skins/default/xui/tr/panel_me.xml # indra/newview/skins/default/xui/zh/floater_preview_texture.xml
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index ba97574149..112a2f6624 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -690,10 +690,10 @@ namespace action_give_inventory
* Checks My Inventory visibility.
*/
- static bool is_give_inventory_acceptable()
+ static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL)
{
// check selection in the panel
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty()) return false; // nothing selected
bool acceptable = false;
@@ -758,7 +758,7 @@ namespace action_give_inventory
uuid_vec_t mAvatarUuids;
};
- static void give_inventory_cb(const LLSD& notification, const LLSD& response)
+ static void give_inventory_cb(const LLSD& notification, const LLSD& response, std::set<LLUUID> inventory_selected_uuids)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
// if Cancel pressed
@@ -767,7 +767,6 @@ namespace action_give_inventory
return;
}
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
if (inventory_selected_uuids.empty())
{
return;
@@ -850,11 +849,11 @@ namespace action_give_inventory
* @param avatar_names - avatar names request to be sent.
* @param avatar_uuids - avatar names request to be sent.
*/
- static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names)
+ 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());
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty())
{
return;
@@ -888,7 +887,7 @@ namespace action_give_inventory
substitutions["ITEMS"] = items;
LLShareInfo::instance().mAvatarNames = avatar_names;
LLShareInfo::instance().mAvatarUuids = avatar_uuids;
- LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb);
+ LLNotificationsUtil::add(notification, substitutions, LLSD(), boost::bind(&give_inventory_cb, _1, _2, inventory_selected_uuids));
}
}
@@ -941,11 +940,14 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std::
}
//static
-std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
+std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs(LLInventoryPanel* active_panel)
{
std::set<LLFolderViewItem*> inventory_selected;
- LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel();
+ if (!active_panel)
+ {
+ active_panel = action_give_inventory::get_active_inventory_panel();
+ }
if (active_panel)
{
inventory_selected= active_panel->getRootFolder()->getSelectionList();
@@ -975,15 +977,16 @@ void LLAvatarActions::shareWithAvatars(LLView * panel)
{
using namespace action_give_inventory;
- LLFloater* root_floater = gFloaterView->getParentFloater(panel);
+ LLFloater* root_floater = gFloaterView->getParentFloater(panel);
+ LLInventoryPanel* inv_panel = dynamic_cast<LLInventoryPanel*>(panel);
LLFloaterAvatarPicker* picker =
- LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE, FALSE, root_floater->getName());
+ LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2, inv_panel), TRUE, FALSE, FALSE, root_floater->getName());
if (!picker)
{
return;
}
- picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable));
+ picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable, inv_panel));
picker->openFriendsTab();
if (root_floater)