summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-05-12 13:47:14 +0300
committerIgor Borovkov <iborovkov@productengine.com>2010-05-12 13:47:14 +0300
commit36e84baea4510369e1f947c46368d93995a1f9fb (patch)
treeb6bd58c85b7ddf2765e136fd9a46d5b8a6249a7a /indra/newview/llpaneloutfitedit.cpp
parent9ab4d2ca8be2edcafa6cdfc3bd774ebaed444dc8 (diff)
EXT-7204 FIXED added updating verbs and status (panel edit outfit) on base oufit changes
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp72
1 files changed, 63 insertions, 9 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 43c2f01da5..008661221a 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -98,26 +98,75 @@ public:
{
if (!gInventory.isInventoryUsable()) return;
- LLUUID cof = LLAppearanceMgr::getInstance()->getCOF();
- if (cof.isNull()) return;
+ bool panel_updated = checkCOF();
+
+ if (!panel_updated)
+ {
+ checkBaseOutfit();
+ }
+ }
+
+protected:
+
+ /** Get a version of an inventory category specified by its UUID */
+ static S32 getCategoryVersion(const LLUUID& cat_id)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+ if (!cat) return LLViewerInventoryCategory::VERSION_UNKNOWN;
- LLViewerInventoryCategory* cat = gInventory.getCategory(cof);
- if (!cat) return;
+ return cat->getVersion();
+ }
- S32 cof_version = cat->getVersion();
+ bool checkCOF()
+ {
+ LLUUID cof = LLAppearanceMgr::getInstance()->getCOF();
+ if (cof.isNull()) return false;
- if (cof_version == mCOFLastVersion) return;
+ S32 cof_version = getCategoryVersion(cof);
+ if (cof_version == mCOFLastVersion) return false;
+
mCOFLastVersion = cof_version;
mPanel->update();
+
+ return true;
}
-protected:
+ void checkBaseOutfit()
+ {
+ LLUUID baseoutfit_id = LLAppearanceMgr::getInstance()->getBaseOutfitUUID();
+
+ if (baseoutfit_id == mBaseOutfitId)
+ {
+ if (baseoutfit_id.isNull()) return;
+
+ const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id);
+
+ if (baseoutfit_ver == mBaseOutfitLastVersion) return;
+ }
+ else
+ {
+ mBaseOutfitId = baseoutfit_id;
+ if (baseoutfit_id.isNull()) return;
+
+ mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId);
+ }
+
+ mPanel->updateVerbs();
+ }
+
+
+
+
LLPanelOutfitEdit *mPanel;
//last version number of a COF category
S32 mCOFLastVersion;
+
+ LLUUID mBaseOutfitId;
+
+ S32 mBaseOutfitLastVersion;
};
@@ -159,6 +208,7 @@ BOOL LLPanelOutfitEdit::postBuild()
mLookItemTypes[LIT_ATTACHMENT] = LLLookItemType(getString("Filter.Objects"), ATTACHMENT_MASK);
mCurrentOutfitName = getChild<LLTextBox>("curr_outfit_name");
+ mStatus = getChild<LLTextBox>("status");
childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredWearablesPanel, this), NULL);
@@ -479,11 +529,15 @@ void LLPanelOutfitEdit::updateVerbs()
LLAppearanceMgr::getInstance()->updateIsDirty();
bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
-
+ bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull();
+
childSetEnabled(SAVE_BTN, outfit_is_dirty);
- childSetEnabled(REVERT_BTN, outfit_is_dirty);
+ childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit);
mSaveMenu->setItemEnabled("save_outfit", outfit_is_dirty);
+
+ mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing"));
+
}
// EOF