From c393383f4463f40e4574968c0b440c51022be7b9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 4 Jun 2010 13:22:00 -0700 Subject: EXT-7502 Save as option while modifiying a body part doesn't prompt for name, and just saves changes. reviewed by Nyx --- indra/newview/llpaneleditwearable.cpp | 24 ++++++++++++++++++++++ indra/newview/llpaneleditwearable.h | 2 ++ .../newview/skins/default/xui/en/notifications.xml | 23 +++++++++++++++++++++ 3 files changed, 49 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 36f2d05fab..527a432a80 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -51,6 +51,7 @@ #include "llagentwearables.h" #include "llscrollingpanelparam.h" #include "llradiogroup.h" +#include "llnotificationsutil.h" #include "llcolorswatch.h" #include "lltexturectrl.h" @@ -623,6 +624,7 @@ BOOL LLPanelEditWearable::postBuild() mDescTitle = getChild("description_text"); getChild("sex_radio")->setCommitCallback(boost::bind(&LLPanelEditWearable::onCommitSexChange, this)); + getChild("save_as_button")->setCommitCallback(boost::bind(&LLPanelEditWearable::onSaveAsButtonClicked, this)); // The following panels will be shown/hidden based on what wearable we're editing // body parts @@ -701,6 +703,28 @@ void LLPanelEditWearable::onRevertButtonClicked(void* userdata) panel->revertChanges(); } +void LLPanelEditWearable::onSaveAsButtonClicked() +{ + LLSD args; + args["DESC"] = mTextEditor->getText(); + + LLNotificationsUtil::add("SaveWearableAs", args, LLSD(), boost::bind(&LLPanelEditWearable::saveAsCallback, this, _1, _2)); +} + +void LLPanelEditWearable::saveAsCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::string wearable_name = response["message"].asString(); + LLStringUtil::trim(wearable_name); + if( !wearable_name.empty() ) + { + mTextEditor->setText(wearable_name); + saveChanges(); + } + } +} void LLPanelEditWearable::onCommitSexChange() { diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index b6b8c0c781..00883f65eb 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -72,6 +72,8 @@ public: static void onRevertButtonClicked(void* userdata); void onCommitSexChange(); + void onSaveAsButtonClicked(); + void saveAsCallback(const LLSD& notification, const LLSD& response); private: diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5ead756d20..9af358eff3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2068,6 +2068,29 @@ Would you be my friend? + + Save item to my inventory as: +
+ + [DESC] (new) + +