summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitsinventory.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-07-23 07:10:26 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-07-23 07:10:26 +0300
commit638fe8757694b4039e8b88d83fb8b7b7cfafb1a4 (patch)
tree2c4fb2a4d4db5022c395bafde44e01666d08a868 /indra/newview/llpaneloutfitsinventory.cpp
parent7587f0dd88526e61a4741ad8e2d9894027de1ffb (diff)
parentbe6066eae218856f7fd74b98968a75e5062fa830 (diff)
Merge branch 'master' into DRTVWR-483
# Conflicts: # indra/newview/llpanelpicks.cpp # indra/newview/llpanelpicks.h # indra/newview/llviewerfloaterreg.cpp
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 8fff52ca4e..531073526b 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<LLPanelOutfitsInventory> 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<LLButton>(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, false));
+ getChild<LLButton>(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::saveOutfit, this, true));
return TRUE;
}
@@ -246,6 +249,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance()
return dynamic_cast<LLPanelOutfitsInventory*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory"));
}
+void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name)
+{
+ if (!mAppearanceTabs) return;
+ mAppearanceTabs->selectTabByName(tab_name);
+}
+
//////////////////////////////////////////////////////////////////////////////////
// List Commands //
@@ -269,7 +278,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<LLButton>(SAVE_BTN)->setEnabled(make_outfit_enabled);
wear_btn->setToolTip(getString((!isOutfitsGalleryPanelActive() && mMyOutfitsPanel->hasItemSelected()) ? "wear_items_tooltip" : "wear_outfit_tooltip"));
}
@@ -368,3 +377,15 @@ LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP()
dynamic_cast<LLSidepanelAppearance*>(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();
+}