diff options
author | Eli Linden <eli@lindenlab.com> | 2010-06-04 14:00:44 -0700 |
---|---|---|
committer | Eli Linden <eli@lindenlab.com> | 2010-06-04 14:00:44 -0700 |
commit | ceb6647ac1d61b43f6beb130466a7cf7c4fa15ac (patch) | |
tree | 8fc4c5cd2bae04679b98f19dbbd106709c1e4e02 /indra/newview/llpaneleditwearable.cpp | |
parent | 591e309897704cdc9084c2f8613b6c74f5c8a4e6 (diff) | |
parent | b1b4e56bcec6718a971f01d51ffe4363e8fba9ac (diff) |
Merge
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 8d0e3d4647..6a84886e3b 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" @@ -624,6 +625,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 @@ -744,6 +746,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() { |