summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpaneleditwearable.cpp24
-rw-r--r--indra/newview/llpaneleditwearable.h2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml23
3 files changed, 49 insertions, 0 deletions
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<LLTextBox>("description_text");
getChild<LLRadioGroup>("sex_radio")->setCommitCallback(boost::bind(&LLPanelEditWearable::onCommitSexChange, this));
+ getChild<LLButton>("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
@@ -2069,6 +2069,29 @@ Would you be my friend?
</notification>
<notification
+ icon="alertmodal.tga"
+ label="Save Wearable"
+ name="SaveWearableAs"
+ type="alertmodal">
+ Save item to my inventory as:
+ <form name="form">
+ <input name="message" type="text">
+ [DESC] (new)
+ </input>
+ <button
+ default="true"
+ index="0"
+ name="Offer"
+ text="OK"/>
+ <button
+ index="1"
+ name="Cancel"
+ text="Cancel"/>
+ </form>
+ </notification>
+
+
+ <notification
icon="alertmodal.tga"
label="Rename Outfit"
name="RenameOutfit"