diff options
Diffstat (limited to 'indra/newview/lloutfitgallery.cpp')
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index de6a36ce2f..eeeb7e5c25 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -106,7 +106,8 @@ BOOL LLOutfitGallery::postBuild() { BOOL rv = LLOutfitListBase::postBuild(); mScrollPanel = getChild<LLScrollContainer>("gallery_scroll_panel"); - mGalleryPanel = getChild<LLPanel>("gallery_panel"); + LLPanel::Params params = LLPanel::getDefaultParams(); // Don't parse XML when creating dummy LLPanel + mGalleryPanel = LLUICtrlFactory::create<LLPanel>(params); mMessageTextBox = getChild<LLTextBox>("no_outfits_txt"); mOutfitGalleryMenu = new LLOutfitGalleryContextMenu(this); return rv; @@ -234,6 +235,7 @@ void LLOutfitGallery::removeLastRow() { mRowCount--; mGalleryPanel->removeChild(mLastRowPanel); + mUnusedRowPanels.push_back(mLastRowPanel); mRowPanels.pop_back(); mLastRowPanel = mRowPanels.back(); } @@ -335,6 +337,7 @@ void LLOutfitGallery::removeFromLastRow(LLOutfitGalleryItem* item) { mItemPanels.back()->removeChild(item); mLastRowPanel->removeChild(mItemPanels.back()); + mUnusedItemPanels.push_back(mItemPanels.back()); mItemPanels.pop_back(); } @@ -374,7 +377,16 @@ LLPanel* LLOutfitGallery::buildItemPanel(int left) { LLPanel::Params lpparams; int top = 0; - LLPanel* lpanel = LLUICtrlFactory::create<LLPanel>(lpparams); + LLPanel* lpanel = NULL; + if(mUnusedItemPanels.empty()) + { + lpanel = LLUICtrlFactory::create<LLPanel>(lpparams); + } + else + { + lpanel = mUnusedItemPanels.back(); + mUnusedItemPanels.pop_back(); + } LLRect rect = LLRect(left, top + mItemHeight, left + mItemWidth + mItemHorizontalGap, top); lpanel->setRect(rect); lpanel->reshape(mItemWidth + mItemHorizontalGap, mItemHeight); @@ -387,7 +399,16 @@ LLPanel* LLOutfitGallery::buildItemPanel(int left) LLPanel* LLOutfitGallery::buildRowPanel(int left, int bottom) { LLPanel::Params sparams; - LLPanel* stack = LLUICtrlFactory::create<LLPanel>(sparams); + LLPanel* stack = NULL; + if(mUnusedRowPanels.empty()) + { + stack = LLUICtrlFactory::create<LLPanel>(sparams); + } + else + { + stack = mUnusedRowPanels.back(); + mUnusedRowPanels.pop_back(); + } moveRowPanel(stack, left, bottom); return stack; } @@ -417,6 +438,19 @@ LLOutfitGallery::~LLOutfitGallery() gInventory.removeObserver(mOutfitsObserver); } delete mOutfitsObserver; + + while (!mUnusedRowPanels.empty()) + { + LLPanel* panelp = mUnusedRowPanels.back(); + mUnusedRowPanels.pop_back(); + panelp->die(); + } + while (!mUnusedItemPanels.empty()) + { + LLPanel* panelp = mUnusedItemPanels.back(); + mUnusedItemPanels.pop_back(); + panelp->die(); + } } void LLOutfitGallery::setFilterSubString(const std::string& string) @@ -497,7 +531,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) // Start observing changes in "My Outfits" category. mOutfitsObserver->addCategory(cat_id, - boost::bind(&LLOutfitGallery::refreshOutfit, this, cat_id)); + boost::bind(&LLOutfitGallery::refreshOutfit, this, cat_id), true); outfit_category->fetch(); refreshOutfit(cat_id); @@ -640,7 +674,6 @@ BOOL LLOutfitGalleryItem::postBuild() mOutfitNameText = getChild<LLTextBox>("outfit_name"); mOutfitWornText = getChild<LLTextBox>("outfit_worn_text"); - mFotoBgPanel = getChild<LLPanel>("foto_bg_panel"); mTextBgPanel = getChild<LLPanel>("text_bg_panel"); setOutfitWorn(false); mHidden = false; @@ -1093,7 +1126,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) return; } - S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). + S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). void *nruserdata = NULL; nruserdata = (void *)&outfit_id; @@ -1161,7 +1194,7 @@ void LLOutfitGallery::onTexturePickerCommit(LLTextureCtrl::ETexturePickOp op, LL } else { - image_item_id = floaterp->findItemID(floaterp->getAssetID(), FALSE); + image_item_id = floaterp->findItemID(floaterp->getAssetID(), FALSE, TRUE); if (image_item_id.isNull()) { LL_WARNS() << "id or image_item_id is NULL!" << LL_ENDL; |