SL-10927 FIXED [EEP] Unable to share environment settings from My Environments floater
parent
f9c0b021ea
commit
b172ced57a
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ public:
|
|||
*/
|
||||
static void viewChatHistory(const LLUUID& id);
|
||||
|
||||
static std::set<LLUUID> getInventorySelectedUUIDs();
|
||||
static std::set<LLUUID> getInventorySelectedUUIDs(LLInventoryPanel* active_panel = NULL);
|
||||
|
||||
private:
|
||||
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
|
||||
|
|
|
|||
Loading…
Reference in New Issue