summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitsinventory.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-05-19 14:03:29 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-05-19 14:03:29 +0300
commit9aacdbc155b894532a85b18912288691ecb3832c (patch)
treee225e4e9e76d668e999472811c5535d39c9076a7 /indra/newview/llpaneloutfitsinventory.cpp
parent2c817f0b40aa22209b498e5e42dca8eab6439f4e (diff)
EXT-7242 FIXED Added a new "Edit my Shape" link to avatar self-click context menu and made it open the shape editing panel.
Again, as in EXT-7241, I tried to improve the way the appearance panels (outfits / edit outfit / edit wearables) are switched, this time aiming to eliminate redundant time-consuming operations (fetches/updated/etc). I'm not particularly satisfied with the resulting code but it seems to work. A better solution might be to wrap the panels with LLSideTrayPanelContainer. Additional minor changes: - Fixed unsafe pointer cast in LLSidepanelAppearance::editWearable(). - Removed redundant onEditOutfitButtonClicked() and onEditWearBackClicked() methods from LLSidepanelAppearance. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/395/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp26
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;
+}