diff options
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index ea75c16c56..0760c57f8e 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -73,7 +73,8 @@ static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_o LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), - mParent(NULL) + mParent(NULL), + mInitialized(false) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -106,6 +107,18 @@ BOOL LLPanelOutfitsInventory::postBuild() // virtual void LLPanelOutfitsInventory::onOpen(const LLSD& key) { + if (!mInitialized) + { + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); + if (panel_appearance) + { + // *TODO: move these methods to LLPanelOutfitsInventory? + panel_appearance->fetchInventory(); + panel_appearance->refreshCurrentOutfitName(); + } + mInitialized = true; + } + // Make sure we know which tab is selected, update the filter, // and update verbs. onTabChange(); @@ -249,8 +262,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& { LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name); - LLSidepanelAppearance* panel_appearance = - dynamic_cast<LLSidepanelAppearance *>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + LLSidepanelAppearance* panel_appearance = getAppearanceSP(); if (panel_appearance) { panel_appearance->showOutfitsInventoryPanel(); @@ -661,3 +673,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded() { setWearablesLoading(false); } + +LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() +{ + static LLSidepanelAppearance* panel_appearance = + dynamic_cast<LLSidepanelAppearance*> + (LLSideTray::getInstance()->getPanel("sidepanel_appearance")); + return panel_appearance; +} |