From 569ad2d248cd1297b937e2c003399937114d06b9 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 29 Mar 2021 19:54:24 +0300 Subject: Separate "Save changes" and "Save as..." in Outfits floater --- indra/newview/llpaneloutfitsinventory.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 8fff52ca4e..baacdd65b5 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -40,7 +40,6 @@ #include "lloutfitgallery.h" #include "lloutfitslist.h" #include "llpanelwearing.h" -#include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" #include "llviewercontrol.h" #include "llviewerfoldertype.h" @@ -49,6 +48,9 @@ static const std::string OUTFITS_TAB_NAME = "outfitslist_tab"; static const std::string OUTFIT_GALLERY_TAB_NAME = "outfit_gallery_tab"; static const std::string COF_TAB_NAME = "cof_tab"; +static const std::string SAVE_AS_BTN("save_as_btn"); +static const std::string SAVE_BTN("save_btn"); + static LLPanelInjector t_inventory("panel_outfits_inventory"); LLPanelOutfitsInventory::LLPanelOutfitsInventory() : @@ -90,8 +92,9 @@ BOOL LLPanelOutfitsInventory::postBuild() { LLInventoryModelBackgroundFetch::instance().start(outfits_cat); } - - mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this, true)); + + getChild(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, false)); + getChild(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, true)); return TRUE; } @@ -269,7 +272,7 @@ void LLPanelOutfitsInventory::updateListCommands() mOutfitGalleryPanel->childSetEnabled("trash_btn", trash_enabled); wear_btn->setEnabled(wear_enabled); wear_btn->setVisible(wear_visible); - mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); + getChild(SAVE_BTN)->setEnabled(make_outfit_enabled); wear_btn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip")); } @@ -368,3 +371,15 @@ LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance")); return panel_appearance; } + +void LLPanelOutfitsInventory::saveOutfit(bool as_new) +{ + if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit()) + { + // we don't need to ask for an outfit name, and updateBaseOutfit() successfully saved. + // If updateBaseOutfit fails, ask for an outfit name anyways + return; + } + + onSave(); +} -- cgit v1.2.3 From 309fb9e892beb724a442c85bcfd07d6f3f7c9c07 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 29 Mar 2021 23:36:55 +0300 Subject: SL-15034 Revisions to dedicated Avatar menus --- indra/newview/llpaneloutfitsinventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llpaneloutfitsinventory.cpp') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index baacdd65b5..531073526b 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -249,6 +249,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance() return dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory")); } +void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name) +{ + if (!mAppearanceTabs) return; + mAppearanceTabs->selectTabByName(tab_name); +} + ////////////////////////////////////////////////////////////////////////////////// // List Commands // -- cgit v1.2.3