From 80b4fe6613cebcf606852121f891c38fa60f2fd7 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 5 Dec 2014 18:39:05 -0500 Subject: [PATCH] Solve Issue 1755: Change Appearance Save button to a flyout option, and move File->Update Outfit Update Outfit is now at the bottom of the inventory's File menu. --- indra/newview/llfloatercustomize.cpp | 27 ++++++++++--------- indra/newview/llfloatercustomize.h | 4 +-- .../default/xui/de/floater_customize.xml | 3 +-- .../default/xui/de/floater_inventory.xml | 2 +- .../default/xui/en-us/floater_customize.xml | 5 ++-- .../default/xui/en-us/floater_inventory.xml | 6 ++--- .../default/xui/es/floater_customize.xml | 3 +-- .../default/xui/es/floater_inventory.xml | 2 +- .../default/xui/fr/floater_customize.xml | 3 +-- .../default/xui/it/floater_customize.xml | 2 +- .../default/xui/pt/floater_customize.xml | 2 +- 11 files changed, 28 insertions(+), 31 deletions(-) diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index 30cf75dc9..6a319c568 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -38,6 +38,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llflyoutbutton.h" #include "llmakeoutfitdialog.h" #include "llmorphview.h" #include "llnotificationsutil.h" @@ -154,11 +155,9 @@ LLFloaterCustomize::~LLFloaterCustomize() // virtual BOOL LLFloaterCustomize::postBuild() { - mMakeOutfitBtn = getChild("Make Outfit"); - getChild("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this)); - mSaveOutfitBtn = getChild("Save Outfit"); - mSaveOutfitBtn->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance())); - refreshCurrentOutfitName(); // Initialize tooltip for save outfit button + mMakeOutfitBtn = getChild("Make Outfit"); + mMakeOutfitBtn->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this, _2)); + refreshCurrentOutfitName(); // Initialize flyout list entry for save outfit getChild("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this)); getChild("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); @@ -201,11 +200,11 @@ BOOL LLFloaterCustomize::postBuild() void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) { // Set current outfit status (wearing/unsaved). - bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + //bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); //std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing"); //mOutfitStatus->setText(cof_status_str); - mSaveOutfitBtn->setEnabled(dirty); // No use saving unless dirty + mMakeOutfitBtn->remove(0); if (name.empty()) { std::string outfit_name; @@ -214,22 +213,21 @@ void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) //mCurrentLookName->setText(outfit_name); LLStringUtil::format_map_t args; args["[OUTFIT]"] = outfit_name; - mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); + mMakeOutfitBtn->add(getString("Save changes to", args), true); return; } std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit"; //mCurrentLookName->setText(getString(string_name)); - mSaveOutfitBtn->setToolTip(getString(string_name)); + mMakeOutfitBtn->add(getString(string_name), false); //mOpenOutfitBtn->setEnabled(FALSE); - mSaveOutfitBtn->setEnabled(false); // Can't save right now } else { //mCurrentLookName->setText(name); LLStringUtil::format_map_t args; args["[OUTFIT]"] = name; - mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); + mMakeOutfitBtn->add(getString("Save changes to", args), true); // Can't just call update verbs since the folder link may not have been created yet. //mOpenOutfitBtn->setEnabled(TRUE); } @@ -539,9 +537,12 @@ void LLFloaterCustomize::onBtnOk() close(false); } -void LLFloaterCustomize::onBtnMakeOutfit() +void LLFloaterCustomize::onBtnMakeOutfit(const LLSD& val) { - new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. + if (val && LLAppearanceMgr::instance().isOutfitDirty()) // No use saving unless dirty + LLAppearanceMgr::instance().updateBaseOutfit(); + else + new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. } //////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloatercustomize.h b/indra/newview/llfloatercustomize.h index c7246e5fc..dfe669470 100644 --- a/indra/newview/llfloatercustomize.h +++ b/indra/newview/llfloatercustomize.h @@ -99,7 +99,7 @@ public: private: // Callbacks void onBtnOk(); - void onBtnMakeOutfit(); + void onBtnMakeOutfit(const LLSD& val); void onBtnImport(); void onBtnImport_continued(AIFilePicker* filepicker); void onBtnExport(); @@ -120,7 +120,7 @@ private: LLScrollingPanelList* mScrollingPanelList; LLScrollContainer* mScrollContainer; LLView *mMetricHeight, *mImperialHeight; - LLUICtrl *mMakeOutfitBtn, *mSaveOutfitBtn; + class LLFlyoutButton* mMakeOutfitBtn; LLTabContainer* mTabContainer; LLPointer mResetParams; diff --git a/indra/newview/skins/default/xui/de/floater_customize.xml b/indra/newview/skins/default/xui/de/floater_customize.xml index 31300981a..1c5316b1f 100644 --- a/indra/newview/skins/default/xui/de/floater_customize.xml +++ b/indra/newview/skins/default/xui/de/floater_customize.xml @@ -398,8 +398,7 @@ und dieses anziehen.