From 1ec47c39a6c4a6e7e518d0b91a87f50596362f06 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 1 Apr 2010 17:50:48 -0400 Subject: EXT-6679 : INFRASTRUCTURE : Have LLInvFVBridge contain a LLFolderView *mRoot instead of passing it along everywhere such as in performAction mRoot is now stored for all LLInventoryBridge types. Did some superficial formatting cleanup for LLInventoryBridge. --- indra/newview/llsidepanelinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 73880563d7..18e56a9c01 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -161,7 +161,7 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) { return; } - current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getRootFolder(), panel_main_inventory->getActivePanel()->getModel(), action); + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() -- cgit v1.2.3 From 27b457f2ce860f7fc36d15e8792bfa89bca5b93f Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 12 Apr 2010 17:02:16 +0300 Subject: Implemented major task EXT-6710(Feature request: Allow drag and drop from Inventory panel to Resident Picker) - added handling the drag add drop inventory items to resident picker - added "Share" verb button to the inventory panel which opens resident picker - added "Share" menu item to the individual inventory context menu which acts as verb button Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/215/ --HG-- branch : product-engine --- indra/newview/llsidepanelinventory.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 18e56a9c01..fa543f1371 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -33,6 +33,7 @@ #include "llsidepanelinventory.h" #include "llagent.h" +#include "llavataractions.h" #include "llbutton.h" #include "llinventorybridge.h" #include "llinventorypanel.h" @@ -151,6 +152,7 @@ void LLSidepanelInventory::onInfoButtonClicked() void LLSidepanelInventory::onShareButtonClicked() { + LLAvatarActions::shareWithAvatars(); } void LLSidepanelInventory::performActionOnSelection(const std::string &action) @@ -252,7 +254,9 @@ void LLSidepanelInventory::updateVerbs() mPlayBtn->setEnabled(FALSE); mTeleportBtn->setVisible(FALSE); mTeleportBtn->setEnabled(FALSE); - + + mShareBtn->setEnabled(canShare()); + const LLInventoryItem *item = getSelectedItem(); if (!item) return; @@ -260,7 +264,6 @@ void LLSidepanelInventory::updateVerbs() bool is_single_selection = getSelectedCount() == 1; mInfoBtn->setEnabled(is_single_selection); - mShareBtn->setEnabled(is_single_selection); switch(item->getInventoryType()) { @@ -285,6 +288,25 @@ void LLSidepanelInventory::updateVerbs() } } +bool LLSidepanelInventory::canShare() +{ + LLPanelMainInventory* panel_main_inventory = + mInventoryPanel->getChild("panel_main_inventory"); + + LLFolderView* root_folder = + panel_main_inventory->getActivePanel()->getRootFolder(); + + LLFolderViewItem* current_item = root_folder->hasVisibleChildren() + ? root_folder->getCurSelectedItem() + : NULL; + + LLInvFVBridge* bridge = current_item + ? dynamic_cast (current_item->getListener()) + : NULL; + + return bridge ? bridge->canShare() : false; +} + LLInventoryItem *LLSidepanelInventory::getSelectedItem() { LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); -- cgit v1.2.3