Skip to content
Snippets Groups Projects
Commit 2dc929b3 authored by Tofu Linden's avatar Tofu Linden
Browse files

merge from PE's viewer-release

parents ee7fce63 4081f6f5
Branches
Tags
No related merge requests found
...@@ -167,10 +167,18 @@ class CofClothingContextMenu : public CofContextMenu ...@@ -167,10 +167,18 @@ class CofClothingContextMenu : public CofContextMenu
protected: protected:
static void replaceWearable() static void replaceWearable()
{ {
static LLButton* show_add_wearables_btn = // *TODO: Most probable that accessing to LLPanelOutfitEdit instance should be:
LLSideTray::getInstance()->getChild<LLButton>("show_add_wearables_btn"); // LLSideTray::getInstance()->getSidepanelAppearance()->getPanelOutfitEdit()
// without casting. Getter methods provides possibility to check and construct
show_add_wearables_btn->onCommit(); // absent instance. Explicit relations between components avoids situations
// when we tries to construct instance with unsatisfied implicit input conditions.
LLPanelOutfitEdit * panel_outfit_edit =
dynamic_cast<LLPanelOutfitEdit*> (LLSideTray::getInstance()->getPanel(
"panel_outfit_edit"));
if (panel_outfit_edit != NULL)
{
panel_outfit_edit->showAddWearablesPanel(true);
}
} }
/*virtual*/ LLContextMenu* createMenu() /*virtual*/ LLContextMenu* createMenu()
......
...@@ -657,10 +657,10 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) ...@@ -657,10 +657,10 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata)
} }
if (command_name == "take_off") if (command_name == "take_off")
{ {
// Enable "Take Off" only if a worn item or base outfit is selected. // Enable "Take Off" if any of selected items can be taken off
return ( !hasItemSelected() // or the selected outfit contains items that can be taken off.
&& LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID ) return ( hasItemSelected() && canTakeOffSelected() )
|| hasWornItemSelected(); || ( !hasItemSelected() && LLAppearanceMgr::getCanRemoveFromCOF(mSelectedOutfitUUID) );
} }
if (command_name == "wear_add") if (command_name == "wear_add")
...@@ -955,14 +955,19 @@ void LLOutfitsList::applyFilterToTab( ...@@ -955,14 +955,19 @@ void LLOutfitsList::applyFilterToTab(
} }
} }
bool LLOutfitsList::hasWornItemSelected() bool LLOutfitsList::canTakeOffSelected()
{ {
uuid_vec_t selected_uuids; uuid_vec_t selected_uuids;
getSelectedItemsUUIDs(selected_uuids); getSelectedItemsUUIDs(selected_uuids);
LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false);
for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it) for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it)
{ {
if (get_is_item_worn(*it)) return true; LLViewerInventoryItem* item = gInventory.getItem(*it);
if (!item) continue;
if (is_worn(NULL, item)) return true;
} }
return false; return false;
} }
......
...@@ -179,9 +179,9 @@ class LLOutfitsList : public LLPanelAppearanceTab ...@@ -179,9 +179,9 @@ class LLOutfitsList : public LLPanelAppearanceTab
void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring); void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring);
/** /**
* Returns true if there are any worn items among currently selected, otherwise false. * Returns true if there are any items that can be taken off among currently selected, otherwise false.
*/ */
bool hasWornItemSelected(); bool canTakeOffSelected();
void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
......
...@@ -423,8 +423,9 @@ BOOL LLFloaterTexturePicker::postBuild() ...@@ -423,8 +423,9 @@ BOOL LLFloaterTexturePicker::postBuild()
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE); mInventoryPanel->setAllowMultiSelect(FALSE);
// store this filter as the default one // Commented out to scroll to currently selected texture. See EXT-5403.
mInventoryPanel->getRootFolder()->getFilter()->markDefault(); // // store this filter as the default one
// mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures // Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE); // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE);
......
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
multi_select="true" multi_select="true"
name="list_attachments" name="list_attachments"
top="0" top="0"
width="311" /> width="311">
<flat_list_view.no_items_text
value="No attachments worn" />
</flat_list_view>
</accordion_tab> </accordion_tab>
<accordion_tab <accordion_tab
layout="topleft" layout="topleft"
......
...@@ -52,14 +52,14 @@ width="333"> ...@@ -52,14 +52,14 @@ width="333">
visible="false" /> visible="false" />
<icon <icon
follows="top|left" follows="top|left"
height="32" height="31"
image_name="TabIcon_Appearance_Off" image_name="Shirt_Large"
name="outfit_icon" name="outfit_icon"
mouse_opaque="false" mouse_opaque="false"
visible="true" visible="true"
left="0" left="1"
top="0" top="0"
width="32" /> width="31" />
<text <text
font="SansSerifSmall" font="SansSerifSmall"
text_color="EmphasisColor" text_color="EmphasisColor"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment