diff --git a/indra/newview/llfloatercreatelandmark.cpp b/indra/newview/llfloatercreatelandmark.cpp
index 821707d236..db84a2ac76 100644
--- a/indra/newview/llfloatercreatelandmark.cpp
+++ b/indra/newview/llfloatercreatelandmark.cpp
@@ -216,7 +216,7 @@ void LLFloaterCreateLandmark::onCreateFolderClicked()
if (!folder_name.empty())
{
inventory_func_type func = boost::bind(&LLFloaterCreateLandmark::folderCreatedCallback, this, _1);
- LLUUID test = gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, func);
+ gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, func);
gInventory.notifyObservers();
}
}
@@ -282,13 +282,8 @@ void LLFloaterCreateLandmark::onSaveClicked()
void LLFloaterCreateLandmark::onCancelClicked()
{
- // Don't create landmark on cancel
- if (mItem)
- {
- remove_inventory_item(mItem, nullptr, true);
- gInventory.notifyObservers();
- }
- //
+ LLUUID item_id = mItem->getUUID();
+ remove_inventory_item(item_id, NULL);
closeFloater();
}
diff --git a/indra/newview/llfloatercreatelandmark.h b/indra/newview/llfloatercreatelandmark.h
index d62ee01790..74ac5e651c 100644
--- a/indra/newview/llfloatercreatelandmark.h
+++ b/indra/newview/llfloatercreatelandmark.h
@@ -66,7 +66,6 @@ private:
LLLineEditor* mLandmarkTitleEditor;
LLTextEditor* mNotesEditor;
LLUUID mLandmarksID;
- LLUUID mItemID;
LLLandmarksInventoryObserver* mInventoryObserver;
LLPointer mItem;
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 532d24126c..57abb245c7 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -58,7 +58,6 @@
#include "llmenubutton.h"
#include "llpaneloutfitsinventory.h"
#include "lluiconstants.h"
-#include "llsaveoutfitcombobtn.h"
#include "llscrolllistctrl.h"
#include "lltextbox.h"
#include "lltoggleablemenu.h"
@@ -84,6 +83,8 @@ const U64 ATTACHMENT_MASK = (1LL << LLInventoryType::IT_ATTACHMENT) | (1LL << LL
const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK;
static const std::string REVERT_BTN("revert_btn");
+static const std::string SAVE_AS_BTN("save_as_btn");
+static const std::string SAVE_BTN("save_btn");
///////////////////////////////////////////////////////////////////////////////
@@ -569,12 +570,13 @@ BOOL LLPanelOutfitEdit::postBuild()
mGearMenu = LLPanelOutfitEditGearMenu::create();
mGearMenuBtn->setMenu(mGearMenu);
+ getChild(SAVE_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, false));
+ getChild(SAVE_AS_BTN)->setCommitCallback(boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
+
// Show avatar complexity in appearance floater
mAvatarComplexityLabel = getChild("avatar_complexity_label");
mAvatarComplexityAddingLabel = getChild("avatar_complexity_adding_label");
- mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this));
-
onOutfitChanging(gAgentWearables.isCOFChangeInProgress());
return TRUE;
}
@@ -1254,11 +1256,9 @@ void LLPanelOutfitEdit::updateVerbs()
bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked();
bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull();
- mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty);
+ getChildView(SAVE_BTN)->setEnabled(!outfit_locked && outfit_is_dirty);
getChildView(REVERT_BTN)->setEnabled(outfit_is_dirty && has_baseoutfit);
- mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty);
-
mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing"));
updateCurrentOutfitName();
@@ -1444,6 +1444,15 @@ void LLPanelOutfitEdit::saveListSelection()
}
}
+void LLPanelOutfitEdit::saveOutfit(bool as_new)
+{
+ LLPanelOutfitsInventory* panel_outfits_inventory = LLPanelOutfitsInventory::findInstance();
+ if (panel_outfits_inventory)
+ {
+ panel_outfits_inventory->saveOutfit(as_new);
+ }
+}
+
// Show avatar complexity in appearance floater
void LLPanelOutfitEdit::updateAvatarComplexity(U32 complexity)
{
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 2bfce93ee9..6920d41e2d 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -58,7 +58,6 @@ class LLMenuButton;
class LLMenuGL;
class LLFindNonLinksByMask;
class LLFindWearablesOfType;
-class LLSaveOutfitComboBtn;
class LLWearableItemTypeNameComparator;
class LLPanelOutfitEdit : public LLPanel
@@ -198,6 +197,7 @@ private:
void getSelectedItemsUUID(uuid_vec_t& uuid_list);
void getCurrentItemUUID(LLUUID& selected_id);
void onCOFChanged();
+ void saveOutfit(bool as_new = false);
/**
* Method preserves selection while switching between folder/list view modes
@@ -243,7 +243,6 @@ private:
LLToggleableMenu* mGearMenu;
LLToggleableMenu* mAddWearablesGearMenu;
bool mInitialized;
- std::auto_ptr mSaveComboBtn;
LLMenuButton* mWearablesGearMenuBtn;
LLMenuButton* mGearMenuBtn;
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index fe4fcacd37..1977a19cdc 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() :
@@ -101,8 +103,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;
}
@@ -309,7 +312,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"));
}
@@ -409,6 +412,18 @@ LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP()
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();
+}
+
// Show avatar complexity in appearance floater
void LLPanelOutfitsInventory::updateAvatarComplexity(U32 complexity, const std::map& item_complexity, const std::map& temp_item_complexity, U32 body_parts_complexity)
{
@@ -417,4 +432,3 @@ void LLPanelOutfitsInventory::updateAvatarComplexity(U32 complexity, const std::
mCurrentOutfitPanel->updateAvatarComplexity(complexity, item_complexity, temp_item_complexity, body_parts_complexity);
}
//
-
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index e8534311d8..e086fe7864 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -38,7 +38,6 @@ class LLPanelWearing;
class LLMenuGL;
class LLSidepanelAppearance;
class LLTabContainer;
-class LLSaveOutfitComboBtn;
class LLInventoryCategoriesObserver; // FIRE-17626: Attachment count in appearance floater
class LLPanelOutfitsInventory : public LLPanel
@@ -53,6 +52,7 @@ public:
void onSearchEdit(const std::string& string);
void onSave();
+ void saveOutfit(bool as_new = false);
bool onSaveCommit(const LLSD& notification, const LLSD& response);
@@ -75,7 +75,6 @@ protected:
private:
LLTabContainer* mAppearanceTabs;
std::string mFilterSubString;
- std::auto_ptr mSaveComboBtn;
// FIRE-17626: Attachment count in appearance floater
LLInventoryCategoriesObserver* mCategoriesObserver;
diff --git a/indra/newview/skins/ansastorm/xui/en/panel_outfit_edit.xml b/indra/newview/skins/ansastorm/xui/en/panel_outfit_edit.xml
index 26118f5292..1d81e80164 100644
--- a/indra/newview/skins/ansastorm/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/ansastorm/xui/en/panel_outfit_edit.xml
@@ -547,22 +547,26 @@ It is calculated as border_size + 2*UIResizeBarOverlap
layout="topleft"
name="save_btn"
top="0"
- width="155" />
-
+ right="-1" />
+
+
+
+ width="156">
+ right="-1" />
diff --git a/indra/newview/skins/ansastorm/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/ansastorm/xui/en/panel_outfits_inventory.xml
index a4c4656c48..aa8dbb34b4 100644
--- a/indra/newview/skins/ansastorm/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/ansastorm/xui/en/panel_outfits_inventory.xml
@@ -112,22 +112,27 @@
name="save_btn"
top="0"
right="-1" />
-
-
-
+
+
+
+
-
+
+
+
-
-
-
+
+
+
+