summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-04-19 18:02:56 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-04-19 18:02:56 -0700
commit41357bb01297ce0977da7a3e2e9308d3c903d3a8 (patch)
treecf677aea0a81ecddbb394e64c9bd07db517880af /indra/newview/llsidepanelinventory.cpp
parentc3fa45282f5bdb0cb7a3fcd680154e88cafde4bb (diff)
parent3a7490e492b35d5dc55f6124d2e1acbca3bd4d79 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-hotfix
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 73880563d7..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)
@@ -161,7 +163,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()
@@ -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<LLPanelMainInventory>("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 <LLInvFVBridge*> (current_item->getListener())
+ : NULL;
+
+ return bridge ? bridge->canShare() : false;
+}
+
LLInventoryItem *LLSidepanelInventory::getSelectedItem()
{
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");