Skip to content
Snippets Groups Projects
Commit e22f4bb4 authored by Alexei Arabadji's avatar Alexei Arabadji
Browse files

EXT-7613 FIXED Provided updating of base outfit name on outfit rename event.

1 Updated LLOutfitObserver to provide controlling of changing outfit name.
2 Added call of LLPanelOutfitEdit::updateCurrentOutfitName to LLPanelOutfitEdit::updateVerbs since both should be called on BOFChanged signal.
3 Corrected updating field LLOutfitObserver::mBaseOutfitLastVersion.

reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/553/

--HG--
branch : product-engine
parent 7629a39a
Branches
Tags
No related merge requests found
...@@ -74,6 +74,16 @@ S32 LLOutfitObserver::getCategoryVersion(const LLUUID& cat_id) ...@@ -74,6 +74,16 @@ S32 LLOutfitObserver::getCategoryVersion(const LLUUID& cat_id)
return cat->getVersion(); return cat->getVersion();
} }
// static
const std::string& LLOutfitObserver::getCategoryName(const LLUUID& cat_id)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
if (!cat)
return LLStringUtil::null;
return cat->getName();
}
bool LLOutfitObserver::checkCOF() bool LLOutfitObserver::checkCOF()
{ {
LLUUID cof = LLAppearanceMgr::getInstance()->getCOF(); LLUUID cof = LLAppearanceMgr::getInstance()->getCOF();
...@@ -105,8 +115,11 @@ void LLOutfitObserver::checkBaseOutfit() ...@@ -105,8 +115,11 @@ void LLOutfitObserver::checkBaseOutfit()
return; return;
const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id); const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id);
const std::string& baseoutfit_name = getCategoryName(baseoutfit_id);
if (baseoutfit_ver == mBaseOutfitLastVersion) if (baseoutfit_ver == mBaseOutfitLastVersion
// renaming category doesn't change version, so it's need to check it
&& baseoutfit_name == mLastBaseOutfitName)
return; return;
} }
else else
...@@ -116,9 +129,10 @@ void LLOutfitObserver::checkBaseOutfit() ...@@ -116,9 +129,10 @@ void LLOutfitObserver::checkBaseOutfit()
if (baseoutfit_id.isNull()) if (baseoutfit_id.isNull())
return; return;
}
mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId);
} mLastBaseOutfitName = getCategoryName(baseoutfit_id);
LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
// dirtiness state should be updated before sending signal // dirtiness state should be updated before sending signal
......
...@@ -68,6 +68,8 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingleton<LLOutfitO ...@@ -68,6 +68,8 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingleton<LLOutfitO
/** Get a version of an inventory category specified by its UUID */ /** Get a version of an inventory category specified by its UUID */
static S32 getCategoryVersion(const LLUUID& cat_id); static S32 getCategoryVersion(const LLUUID& cat_id);
static const std::string& getCategoryName(const LLUUID& cat_id);
bool checkCOF(); bool checkCOF();
void checkBaseOutfit(); void checkBaseOutfit();
...@@ -78,6 +80,7 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingleton<LLOutfitO ...@@ -78,6 +80,7 @@ class LLOutfitObserver: public LLInventoryObserver, public LLSingleton<LLOutfitO
LLUUID mBaseOutfitId; LLUUID mBaseOutfitId;
S32 mBaseOutfitLastVersion; S32 mBaseOutfitLastVersion;
std::string mLastBaseOutfitName;
bool mLastOutfitDirtiness; bool mLastOutfitDirtiness;
......
...@@ -707,6 +707,7 @@ void LLPanelOutfitEdit::updateVerbs() ...@@ -707,6 +707,7 @@ void LLPanelOutfitEdit::updateVerbs()
mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing"));
updateCurrentOutfitName();
} }
bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel) bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment