diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-26 21:57:40 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-26 21:57:40 +0300 |
commit | a0d7d873552dc1611eb4f8957cf99e777b199dbe (patch) | |
tree | 4d2bff47d6d7bd253076473c85f43f17eedbc12c /indra/newview/llavataractions.cpp | |
parent | 2ea5c5986a467e253ad0131b4af0faee23b263a4 (diff) | |
parent | d7f1c88c35849e56f5b352f13c16a08467d1533b (diff) |
Merge branch 'master' into DRTVWR-460
# Conflicts:
# indra/llmath/llquaternion.h
# indra/newview/lldrawpoolwater.cpp
# indra/newview/lljoystickbutton.cpp
# indra/newview/llvosky.cpp
# indra/newview/skins/default/textures/textures.xml
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r-- | indra/newview/llavataractions.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f0b74e7439..1797d2dd6e 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -626,10 +626,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; @@ -694,7 +694,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 @@ -703,7 +703,6 @@ namespace action_give_inventory return; } - const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -786,11 +785,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; @@ -824,7 +823,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)); } } @@ -877,11 +876,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(); @@ -911,15 +913,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) |