Skip to content
Snippets Groups Projects
Commit 08381a27 authored by Mike Antipov's avatar Mike Antipov
Browse files

EXT-7755 ADDITIONAL FIX Fixed issues with wrong title after an outfit from the...

EXT-7755 ADDITIONAL FIX Fixed issues with wrong title after an outfit from the Inventory is worn, "Wear..." menu items state is made consistent with "Wear" button.

* Empty string is replaced with "Changing outfits" while changing COF;
* Fixed title to show "No Outfit" after an outfit from the Inventory is worn;
* Fixed bug with visible indicator after an empty folder is DnD from the Inventory "Clothing"
* Updated context and Gear "Wear..." menu items to take into account "isCOFChangeInProgress" state in on_enable callbacks

Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/625/

--HG--
branch : product-engine
parent 6290930c
Branches
No related tags found
No related merge requests found
...@@ -1697,9 +1697,10 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category, ...@@ -1697,9 +1697,10 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append) void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append)
{ {
gAgentWearables.notifyLoadingStarted();
if(!category) return; if(!category) return;
gAgentWearables.notifyLoadingStarted();
llinfos << "wearInventoryCategory( " << category->getName() llinfos << "wearInventoryCategory( " << category->getName()
<< " )" << llendl; << " )" << llendl;
......
...@@ -360,6 +360,9 @@ class CallAfterCategoryFetchStage1: public LLInventoryFetchDescendentsObserver ...@@ -360,6 +360,9 @@ class CallAfterCategoryFetchStage1: public LLInventoryFetchDescendentsObserver
<< llendl; << llendl;
//dec_busy_count(); //dec_busy_count();
gInventory.removeObserver(this); gInventory.removeObserver(this);
// lets notify observers that loading is finished.
gAgentWearables.notifyLoadingFinished();
delete this; delete this;
return; return;
} }
......
...@@ -103,8 +103,13 @@ class OutfitContextMenu : public LLListContextMenu ...@@ -103,8 +103,13 @@ class OutfitContextMenu : public LLListContextMenu
{ {
return get_is_category_renameable(&gInventory, outfit_cat_id); return get_is_category_renameable(&gInventory, outfit_cat_id);
} }
else if ("wear_replace" == param)
{
return !gAgentWearables.isCOFChangeInProgress();
}
else if ("wear_add" == param) else if ("wear_add" == param)
{ {
if (gAgentWearables.isCOFChangeInProgress()) return false;
return LLAppearanceMgr::getCanAddToCOF(outfit_cat_id); return LLAppearanceMgr::getCanAddToCOF(outfit_cat_id);
} }
else if ("take_off" == param) else if ("take_off" == param)
......
...@@ -72,11 +72,13 @@ static const std::string COF_TAB_NAME = "cof_tab"; ...@@ -72,11 +72,13 @@ static const std::string COF_TAB_NAME = "cof_tab";
static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory"); static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
class LLPanelOutfitsInventory;
class LLOutfitListGearMenu class LLOutfitListGearMenu
{ {
public: public:
LLOutfitListGearMenu(LLOutfitsList* olist) LLOutfitListGearMenu(LLOutfitsList* olist, LLPanelOutfitsInventory* parent_panel)
: mOutfitList(olist), : mOutfitList(olist),
mMyOutfitsPanel(parent_panel),
mMenu(NULL) mMenu(NULL)
{ {
llassert_always(mOutfitList); llassert_always(mOutfitList);
...@@ -209,6 +211,11 @@ class LLOutfitListGearMenu ...@@ -209,6 +211,11 @@ class LLOutfitListGearMenu
{ {
return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id); return LLAppearanceMgr::getCanRemoveFromCOF(selected_outfit_id);
} }
else if ("wear" == param)
{
return mMyOutfitsPanel->isActionEnabled(param);
}
return true; return true;
} }
...@@ -233,6 +240,7 @@ class LLOutfitListGearMenu ...@@ -233,6 +240,7 @@ class LLOutfitListGearMenu
LLOutfitsList* mOutfitList; LLOutfitsList* mOutfitList;
LLMenuGL* mMenu; LLMenuGL* mMenu;
LLPanelOutfitsInventory* mMyOutfitsPanel;
}; };
LLPanelOutfitsInventory::LLPanelOutfitsInventory() : LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
...@@ -550,13 +558,13 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() ...@@ -550,13 +558,13 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
, _7 // EAcceptance* accept , _7 // EAcceptance* accept
)); ));
mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel); mGearMenu = new LLOutfitListGearMenu(mMyOutfitsPanel, this);
} }
void LLPanelOutfitsInventory::updateListCommands() void LLPanelOutfitsInventory::updateListCommands()
{ {
bool trash_enabled = isActionEnabled("delete"); bool trash_enabled = isActionEnabled("delete");
bool wear_enabled = !gAgentWearables.isCOFChangeInProgress() && isActionEnabled("wear"); bool wear_enabled = isActionEnabled("wear");
bool wear_visible = !isCOFPanelActive(); bool wear_visible = !isCOFPanelActive();
bool make_outfit_enabled = isActionEnabled("save_outfit"); bool make_outfit_enabled = isActionEnabled("save_outfit");
...@@ -710,6 +718,8 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) ...@@ -710,6 +718,8 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
if (command_name == "wear") if (command_name == "wear")
{ {
if (gAgentWearables.isCOFChangeInProgress()) return FALSE;
if (isCOFPanelActive()) if (isCOFPanelActive())
{ {
return FALSE; return FALSE;
......
...@@ -112,6 +112,9 @@ class LLPanelOutfitsInventory : public LLPanel ...@@ -112,6 +112,9 @@ class LLPanelOutfitsInventory : public LLPanel
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
// List Commands // // List Commands //
public:
BOOL isActionEnabled(const LLSD& command_name);
protected: protected:
void initListCommandsHandlers(); void initListCommandsHandlers();
void updateListCommands(); void updateListCommands();
...@@ -119,7 +122,6 @@ class LLPanelOutfitsInventory : public LLPanel ...@@ -119,7 +122,6 @@ class LLPanelOutfitsInventory : public LLPanel
void showGearMenu(); void showGearMenu();
void onTrashButtonClick(); void onTrashButtonClick();
void onClipboardAction(const LLSD& userdata); void onClipboardAction(const LLSD& userdata);
BOOL isActionEnabled(const LLSD& command_name);
void onCustomAction(const LLSD& command_name); void onCustomAction(const LLSD& command_name);
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept);
bool hasItemsSelected(); bool hasItemsSelected();
......
...@@ -390,8 +390,8 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) ...@@ -390,8 +390,8 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
return; return;
} }
std::string look_name = gAgentWearables.isCOFChangeInProgress() ? "" : getString("No Outfit"); std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit";
mCurrentLookName->setText(look_name); mCurrentLookName->setText(getString(string_name));
mOpenOutfitBtn->setEnabled(FALSE); mOpenOutfitBtn->setEnabled(FALSE);
} }
else else
...@@ -475,6 +475,12 @@ void LLSidepanelAppearance::setWearablesLoading(bool val) ...@@ -475,6 +475,12 @@ void LLSidepanelAppearance::setWearablesLoading(bool val)
{ {
childSetVisible("wearables_loading_indicator", val); childSetVisible("wearables_loading_indicator", val);
childSetVisible("edit_outfit_btn", !val); childSetVisible("edit_outfit_btn", !val);
if (!val)
{
// refresh outfit name when COF is already changed.
refreshCurrentOutfitName();
}
} }
void LLSidepanelAppearance::showDefaultSubpart() void LLSidepanelAppearance::showDefaultSubpart()
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
name="wear_replace"> name="wear_replace">
<on_click <on_click
function="Outfit.WearReplace" /> function="Outfit.WearReplace" />
<on_enable
function="Outfit.OnEnable"
parameter="wear_replace" />
<on_visible <on_visible
function="Outfit.OnVisible" function="Outfit.OnVisible"
parameter="wear_replace" /> parameter="wear_replace" />
......
...@@ -21,6 +21,9 @@ width="333"> ...@@ -21,6 +21,9 @@ width="333">
<string <string
name="Now Wearing" name="Now Wearing"
value="Now wearing..." /> value="Now wearing..." />
<string
name="Changing outfits"
value="Changing outfits" />
<panel <panel
background_opaque="true" background_opaque="true"
background_visible="true" background_visible="true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment