diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 72 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.h | 4 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 23 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 6 |
4 files changed, 95 insertions, 10 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 diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 3cdfed14b9..04c94e553f 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -102,12 +102,14 @@ public: void update(); + void updateVerbs(); + private: - void updateVerbs(); LLTextBox* mCurrentOutfitName; + LLTextBox* mStatus; LLInventoryPanel* mInventoryItemsPanel; LLFilterEditor* mSearchFilter; LLSaveFolderState* mSavedFolderState; diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 29532a15c1..40773ed4dd 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -124,6 +124,29 @@ protected: /*virtual*/ void init(); }; + +class LLPanelDeletableWearableListItem : public LLPanelWearableListItem +{ + LOG_CLASS(LLPanelDeletableWearableListItem); +public: + + static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item); + + virtual ~LLPanelDeletableWearableListItem(); + + /*virtual*/ BOOL postBuild(); + + /** + * Make button visible during mouse over event. + */ + inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); } + +protected: + LLPanelDeletableWearableListItem(LLViewerInventoryItem* item); + + /*virtual*/ void init(); +}; + /** * @class LLPanelDummyClothingListItem * diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 6a212306d6..3200951253 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -15,6 +15,12 @@ <string name="No Outfit" value="No Outfit"/> + <string + name="unsaved_changes" + value="Unsaved Changes"/> + <string + name="now_editing" + value="Now Editing"/> <panel.string name="not_available"> |