merge from PE's viewer-trunk
commit
b6804a855b
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
@ -277,16 +276,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)
|
||||
{
|
||||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue