summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-07-28 10:35:59 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-07-28 10:35:59 +0100
commit6c348f9133e0a0dee000894c40d17ed67bac68a5 (patch)
treee5706bacda7b26452f2f06f4f187ab4595982a52
parentc96caed698afb38c50db229fff35fa8b91e40f83 (diff)
parent0156e91c50ec77c92a6971c452a4cfe7a5f2bcab (diff)
merge from PE's viewer-trunk
-rw-r--r--indra/newview/llinventoryfunctions.cpp10
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp20
-rw-r--r--indra/newview/llpanelgroupgeneral.h1
-rw-r--r--indra/newview/llwearableitemslist.cpp14
4 files changed, 29 insertions, 16 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f20acbd016..2517db2678 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -251,6 +251,16 @@ BOOL get_can_item_be_worn(const LLUUID& id)
if (!item)
return FALSE;
+ const LLUUID trash_id = gInventory.findCategoryUUIDForType(
+ LLFolderType::FT_TRASH);
+
+ // item can't be worn if base obj in trash, see EXT-7015
+ if (gInventory.isObjectDescendentOf(item->getLinkedUUID(),
+ trash_id))
+ {
+ return false;
+ }
+
switch(item->getType())
{
case LLAssetType::AT_OBJECT:
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 8e1b7ba4d9..2302772803 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -184,8 +184,7 @@ BOOL LLPanelGroupGeneral::postBuild()
mComboActiveTitle = getChild<LLComboBox>("active_title", recurse);
if (mComboActiveTitle)
{
- mComboActiveTitle->setCommitCallback(onCommitTitle, this);
- mComboActiveTitle->resetDirty();
+ mComboActiveTitle->setCommitCallback(onCommitAny, this);
}
mIncompleteMemberDataStr = getString("incomplete_member_data_str");
@@ -278,16 +277,6 @@ void LLPanelGroupGeneral::onCommitEnrollment(LLUICtrl* ctrl, void* data)
}
// static
-void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data)
-{
- LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data;
- if (self->mGroupID.isNull() || !self->mAllowEdit) return;
- LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID());
- self->update(GC_TITLES);
- self->mComboActiveTitle->resetDirty();
-}
-
-// static
void LLPanelGroupGeneral::onClickInfo(void *userdata)
{
LLPanelGroupGeneral *self = (LLPanelGroupGeneral *)userdata;
@@ -356,6 +345,13 @@ void LLPanelGroupGeneral::draw()
bool LLPanelGroupGeneral::apply(std::string& mesg)
{
+ if (!mGroupID.isNull() && mAllowEdit && mComboActiveTitle && mComboActiveTitle->isDirty())
+ {
+ LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID());
+ update(GC_TITLES);
+ mComboActiveTitle->resetDirty();
+ }
+
BOOL has_power_in_group = gAgent.hasPowerInGroup(mGroupID,GP_GROUP_CHANGE_IDENTITY);
if (has_power_in_group || mGroupID.isNull())
diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h
index 6f4fa994da..358d353074 100644
--- a/indra/newview/llpanelgroupgeneral.h
+++ b/indra/newview/llpanelgroupgeneral.h
@@ -77,7 +77,6 @@ private:
static void onFocusEdit(LLFocusableElement* ctrl, void* data);
static void onCommitAny(LLUICtrl* ctrl, void* data);
static void onCommitUserOnly(LLUICtrl* ctrl, void* data);
- static void onCommitTitle(LLUICtrl* ctrl, void* data);
static void onCommitEnrollment(LLUICtrl* ctrl, void* data);
static void onClickInfo(void* userdata);
static void onReceiveNotices(LLUICtrl* ctrl, void* data);
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 912741cb5e..8ea731cf10 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -769,6 +769,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_links = 0; // number of links among the selected items
U32 n_editable = 0; // number of editable items among the selected ones
+ bool can_be_worn = false;
+
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
LLUUID id = *it;
@@ -804,16 +806,22 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
++n_already_worn;
}
+
+ // if any in trash
+ if (!can_be_worn)
+ {
+ can_be_worn = get_can_item_be_worn(item->getLinkedUUID());
+ }
} // for
bool standalone = mParent ? mParent->isStandalone() : false;
// *TODO: eliminate multiple traversals over the menu items
- setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
+ setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn);
setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
- setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && can_be_worn);
setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0);
- setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn);
//visible only when one item selected and this item is worn
setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1);
setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1);