diff options
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index fd5ce7a46d..cf903958ee 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -61,6 +61,9 @@ #include "llviewercontrol.h" +static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; +static const std::string COF_TAB_NAME = "cof_tab"; + static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory"); bool LLPanelOutfitsInventory::sShowDebugEditor = false; @@ -267,7 +270,7 @@ void LLPanelOutfitsInventory::onSaveCommit(const std::string& outfit_name) if (mAppearanceTabs) { - mAppearanceTabs->selectTabByName("outfitslist_tab"); + mAppearanceTabs->selectTabByName(OUTFITS_TAB_NAME); } } @@ -503,8 +506,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) if (command_name == "wear") { - const BOOL is_my_outfits = (mActivePanel->getName() == "outfitslist_tab"); - if (!is_my_outfits) + if (isCOFPanelActive()) { return FALSE; } @@ -558,17 +560,15 @@ bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropTy void LLPanelOutfitsInventory::initTabPanels() { - mTabPanels.resize(2); - - LLInventoryPanel *cof_panel = getChild<LLInventoryPanel>("cof_tab"); + LLInventoryPanel *cof_panel = getChild<LLInventoryPanel>(COF_TAB_NAME); cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mTabPanels[0] = cof_panel; - - LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>("outfitslist_tab"); + mTabPanels.push_back(cof_panel); + + LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>(OUTFITS_TAB_NAME); myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mTabPanels[1] = myoutfits_panel; - + mTabPanels.push_back(myoutfits_panel); + for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); iter != mTabPanels.end(); ++iter) @@ -615,19 +615,19 @@ void LLPanelOutfitsInventory::onTabChange() updateVerbs(); } -LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel() -{ - return mActivePanel; -} - -bool LLPanelOutfitsInventory::isTabPanel(LLInventoryPanel *panel) +BOOL LLPanelOutfitsInventory::isTabPanel(LLInventoryPanel *panel) const { - for(tabpanels_vec_t::iterator it = mTabPanels.begin(); + for(tabpanels_vec_t::const_iterator it = mTabPanels.begin(); it != mTabPanels.end(); ++it) { if (*it == panel) - return true; + return TRUE; } - return false; + return FALSE; +} + +BOOL LLPanelOutfitsInventory::isCOFPanelActive() const +{ + return (getActivePanel()->getName() == COF_TAB_NAME); } |