diff options
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ce545ae21d..4cd4afaa5a 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -434,6 +434,8 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit() delete mCOFDragAndDropObserver; + delete mWearableListViewItemsComparator; + while (!mListViewItemTypes.empty()) { delete mListViewItemTypes.back(); mListViewItemTypes.pop_back(); @@ -476,8 +478,10 @@ bool LLPanelOutfitEdit::postBuild() mFolderViewBtn = getChild<LLButton>("folder_view_btn"); mListViewBtn = getChild<LLButton>("list_view_btn"); + mFilterPanel = getChild<LLView>("filter_panel"); + mFilterBtn = getChild<LLButton>("filter_button"); + mFilterBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this)); - childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); @@ -530,13 +534,17 @@ bool LLPanelOutfitEdit::postBuild() mSearchFilter = getChild<LLFilterEditor>("look_item_filter"); mSearchFilter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onSearchEdit, this, _2)); - childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); + mShowAddWearablesBtn = getChild<LLButton>("show_add_wearables_btn"); + mShowAddWearablesBtn->setClickedCallback(boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); mPlusBtn = getChild<LLButton>("plus_btn"); mPlusBtn->setClickedCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); + mNoAddWearablesButtonBar = getChild<LLUICtrl>("no_add_wearables_button_bar"); + mAddWearablesButtonBar = getChild<LLUICtrl>("add_wearables_button_bar"); + /* * By default AT_CLOTHING are sorted by (in in MY OUTFITS): * - by type (types order determined in LLWearableType::EType) @@ -567,7 +575,11 @@ bool LLPanelOutfitEdit::postBuild() getChild<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false)); getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true)); + mLoadingIndicator = getChild<LLLoadingIndicator>("edit_outfit_loading_indicator"); + mOutfitNameStatusPanel = getChild<LLPanel>("outfit_name_and_status"); + onOutfitChanging(gAgentWearables.isCOFChangeInProgress()); + return true; } @@ -603,15 +615,15 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) { mAddWearablesPanel->setVisible(show_add_wearables); - getChild<LLUICtrl>("show_add_wearables_btn")->setValue(show_add_wearables); + mShowAddWearablesBtn->setValue(show_add_wearables); updateFiltersVisibility(); - getChildView("filter_button")->setVisible( show_add_wearables); + mFilterBtn->setVisible( show_add_wearables); //search filter should be disabled if (!show_add_wearables) { - getChild<LLUICtrl>("filter_button")->setValue(false); + mFilterBtn->setValue(false); mFolderViewFilterCmbBox->setVisible(false); mListViewFilterCmbBox->setVisible(false); @@ -638,15 +650,15 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) } //switching button bars - getChildView("no_add_wearables_button_bar")->setVisible( !show_add_wearables); - getChildView("add_wearables_button_bar")->setVisible( show_add_wearables); + mNoAddWearablesButtonBar->setVisible( !show_add_wearables); + mAddWearablesButtonBar->setVisible( show_add_wearables); } void LLPanelOutfitEdit::showWearablesFilter() { - bool filter_visible = getChild<LLUICtrl>("filter_button")->getValue(); + bool filter_visible = mFilterBtn->getValue(); - getChildView("filter_panel")->setVisible( filter_visible); + mFilterPanel->setVisible(filter_visible); if(!filter_visible) { @@ -1309,19 +1321,17 @@ static void update_status_widget_rect(LLView * widget, S32 right_border) void LLPanelOutfitEdit::onOutfitChanging(bool started) { - static LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("edit_outfit_loading_indicator"); - static LLView* status_panel = getChild<LLView>("outfit_name_and_status"); - static S32 indicator_delta = status_panel->getRect().getWidth() - indicator->getRect().mLeft; + S32 indicator_delta = mOutfitNameStatusPanel->getRect().getWidth() - mLoadingIndicator->getRect().mLeft; S32 delta = started ? indicator_delta : 0; - S32 right_border = status_panel->getRect().getWidth() - delta; + S32 right_border = mOutfitNameStatusPanel->getRect().getWidth() - delta; if (mCurrentOutfitName) update_status_widget_rect(mCurrentOutfitName, right_border); if (mStatus) update_status_widget_rect(mStatus, right_border); - indicator->setVisible(started); + mLoadingIndicator->setVisible(started); } void LLPanelOutfitEdit::getCurrentItemUUID(LLUUID& selected_id) |