diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-01-22 14:44:32 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-01-22 14:44:32 -0500 |
commit | 0283837e56e69c8a6757d8366b82065e04ae966b (patch) | |
tree | 51cab887adca8ddf16ef1e87ab3979de1e9fdcff /indra/newview/llpaneloutfitsinventory.cpp | |
parent | c64638dc2114a91b8efb17c1e37481ce34df84d5 (diff) |
EXT-4492 : Deleting gestures from the wearing tab causes the viewer to crash
EXT-4660 : Can delete a bodypart from the COF through inventory view or WEARING tab delete key
EXT-4662 : remove leading separator from COF right-click menu
EXT-4633 : AppearanceSP trash button doesn't update enabled state correctly
Bunch of UI fixes related to the trash/delete functionality in InventoryFloater/SP and AppearanceSP "WEARING" tab. The main idea is that we don't want to allow deletion of bodyparts and folder links from the COF by the user.
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); } |