diff options
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index eb3dbdbd2e..c618483fc4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -39,6 +39,7 @@ #include "llfloaterreg.h" #include "llfloaterworldmap.h" #include "llfolderviewmodel.h" +#include "llloadingindicator.h" #include "lloutfitobserver.h" #include "llpaneleditwearable.h" #include "llpaneloutfitsinventory.h" @@ -92,7 +93,7 @@ LLSidepanelAppearance::~LLSidepanelAppearance() } // virtual -BOOL LLSidepanelAppearance::postBuild() +bool LLSidepanelAppearance::postBuild() { mOpenOutfitBtn = getChild<LLButton>("openoutfit_btn"); mOpenOutfitBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onOpenOutfitButtonClicked, this)); @@ -137,12 +138,14 @@ BOOL LLSidepanelAppearance::postBuild() mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook"); + mWearableLoadingIndicator = getChild<LLLoadingIndicator>("wearables_loading_indicator"); + mEditOutfitBtn = getChild<LLButton>("edit_outfit_btn"); setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChanged,this,_2)); setWearablesLoading(gAgentWearables.isCOFChangeInProgress()); - return TRUE; + return true; } // virtual @@ -195,8 +198,8 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) { if (new_visibility["visible"].asBoolean()) { - const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); - const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); + const bool is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); + const bool is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); if (is_outfit_edit_visible || is_wearable_edit_visible) { @@ -262,7 +265,7 @@ void LLSidepanelAppearance::onOpenOutfitButtonClicked() LLAccordionCtrlTab* tab_outfits = mPanelOutfitsInventory->findChild<LLAccordionCtrlTab>("tab_outfits"); if (tab_outfits) { - tab_outfits->changeOpenClose(FALSE); + tab_outfits->changeOpenClose(false); LLInventoryPanel *inventory_panel = tab_outfits->findChild<LLInventoryPanel>("outfitslist_tab"); if (inventory_panel) { @@ -271,7 +274,7 @@ void LLSidepanelAppearance::onOpenOutfitButtonClicked() if (outfit_folder) { outfit_folder->setOpen(!outfit_folder->isOpen()); - root->setSelection(outfit_folder,TRUE); + root->setSelection(outfit_folder,true); root->scrollToShowSelection(); } } @@ -289,16 +292,16 @@ void LLSidepanelAppearance::onEditAppearanceButtonClicked() void LLSidepanelAppearance::showOutfitsInventoryPanel() { - toggleWearableEditPanel(FALSE); - toggleOutfitEditPanel(FALSE); - toggleMyOutfitsPanel(TRUE, ""); + toggleWearableEditPanel(false); + toggleOutfitEditPanel(false); + toggleMyOutfitsPanel(true, ""); } void LLSidepanelAppearance::showOutfitsInventoryPanel(const std::string &tab_name) { - toggleWearableEditPanel(FALSE); - toggleOutfitEditPanel(FALSE); - toggleMyOutfitsPanel(TRUE, tab_name); + toggleWearableEditPanel(false); + toggleOutfitEditPanel(false); + toggleMyOutfitsPanel(true, tab_name); } void LLSidepanelAppearance::showOutfitEditPanel() @@ -308,7 +311,7 @@ void LLSidepanelAppearance::showOutfitEditPanel() // Accordion's state must be reset in all cases except the one when user // is returning back to the mOutfitEdit panel from the mEditWearable panel. // The simplest way to control this is to check the visibility state of the mEditWearable - // BEFORE it is changed by the call to the toggleWearableEditPanel(FALSE, NULL, TRUE). + // BEFORE it is changed by the call to the toggleWearableEditPanel(false, NULL, true). if (mEditWearable != NULL && !mEditWearable->getVisible() && mOutfitEdit != NULL) { mOutfitEdit->resetAccordionState(); @@ -323,19 +326,19 @@ void LLSidepanelAppearance::showOutfitEditPanel() return; } - toggleMyOutfitsPanel(FALSE, ""); - toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode - toggleOutfitEditPanel(TRUE); + toggleMyOutfitsPanel(false, ""); + toggleWearableEditPanel(false, NULL, true); // don't switch out of edit appearance mode + toggleOutfitEditPanel(true); } -void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, BOOL disable_camera_switch) +void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, bool disable_camera_switch) { - toggleMyOutfitsPanel(FALSE, ""); - toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode - toggleWearableEditPanel(TRUE, wearable, disable_camera_switch); + toggleMyOutfitsPanel(false, ""); + toggleOutfitEditPanel(false, true); // don't switch out of edit appearance mode + toggleWearableEditPanel(true, wearable, disable_camera_switch); } -void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name) +void LLSidepanelAppearance::toggleMyOutfitsPanel(bool visible, const std::string& tab_name) { if (!mPanelOutfitsInventory || (mPanelOutfitsInventory->getVisible() == visible && tab_name.empty())) @@ -370,7 +373,7 @@ bool LLSidepanelAppearance::isCOFPanelVisible() return false; } -void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch) +void LLSidepanelAppearance::toggleOutfitEditPanel(bool visible, bool disable_camera_switch) { if (!mOutfitEdit || mOutfitEdit->getVisible() == visible) { @@ -395,7 +398,7 @@ void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_cam } } -void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearable *wearable, BOOL disable_camera_switch) +void LLSidepanelAppearance::toggleWearableEditPanel(bool visible, LLViewerWearable *wearable, bool disable_camera_switch) { if (!mEditWearable) { @@ -411,7 +414,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab // If we're just switching between outfit and wearable editing or updating item, // don't end customization and don't switch camera // Don't end customization and don't switch camera without visibility change - BOOL change_state = !disable_camera_switch && mEditWearable->getVisible() != visible; + bool change_state = !disable_camera_switch && mEditWearable->getVisible() != visible; if (!wearable) { @@ -462,18 +465,18 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit"; mCurrentLookName->setText(getString(string_name)); - mOpenOutfitBtn->setEnabled(FALSE); + mOpenOutfitBtn->setEnabled(false); } else { mCurrentLookName->setText(name); // Can't just call update verbs since the folder link may not have been created yet. - mOpenOutfitBtn->setEnabled(TRUE); + mOpenOutfitBtn->setEnabled(true); } } //static -void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *data, BOOL disable_camera_switch) +void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *data, bool disable_camera_switch) { LLFloaterSidePanelContainer::showPanel("appearance", LLSD()); LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); @@ -541,8 +544,8 @@ void LLSidepanelAppearance::inventoryFetched() void LLSidepanelAppearance::setWearablesLoading(bool val) { - getChildView("wearables_loading_indicator")->setVisible( val); - getChildView("edit_outfit_btn")->setVisible( !val); + mWearableLoadingIndicator->setVisible(val); + mEditOutfitBtn->setVisible(!val); if (!val) { |