summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpaneleditwearable.cpp42
-rw-r--r--indra/newview/llpaneleditwearable.h12
-rwxr-xr-xindra/newview/llviewerregion.cpp1
3 files changed, 51 insertions, 4 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 7832156a0e..9862c98cc8 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1028,6 +1028,46 @@ void LLPanelEditWearable::updatePanelPickerControls(LLWearableType::EType type)
}
}
+//static
+void LLPanelEditWearable::incrementCofVersion()
+{
+ // Create a response handler
+ LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this));
+
+ // Look up the capability to POST to.
+ std::string url = gAgent.getRegion()->getCapability("IncrementCofVersion");
+
+ // If we don't have a region, report it as an error
+ if (getRegion() == NULL)
+ {
+ responderPtr->error(0U, "region is not defined");
+ }
+ else
+ {
+ // Find the capability to send maturity preference
+ std::string url = getRegion()->getCapability("UpdateAgentInformation");
+
+ // If the capability is not defined, report it as an error
+ if (url.empty())
+ {
+ responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region");
+ }
+ else
+ {
+ // Set new access preference
+ LLSD access_prefs = LLSD::emptyMap();
+ access_prefs["max"] = LLViewerRegion::accessToShortString(pPreferredMaturity);
+
+ LLSD body = LLSD::emptyMap();
+ body["access_prefs"] = access_prefs;
+ llinfos << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity)
+ << "' via capability to: " << url << llendl;
+ LLSD headers;
+ LLHTTPClient::post(url, body, responderPtr, headers, 30.0f);
+ }
+ }
+}
+
void LLPanelEditWearable::saveChanges(bool force_save_as)
{
if (!mWearablePtr || !isDirty())
@@ -1050,6 +1090,8 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
{
gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name);
}
+
+ LLPanelEditWearable::incrementCofVersion();
}
void LLPanelEditWearable::revertChanges()
diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h
index 309d512e23..619486bb5b 100644
--- a/indra/newview/llpaneleditwearable.h
+++ b/indra/newview/llpaneleditwearable.h
@@ -31,6 +31,8 @@
#include "llscrollingpanellist.h"
#include "llmodaldialog.h"
#include "llavatarappearancedefines.h"
+#include "llagent.h"
+#include "llviewerregion.h"
#include "llwearabletype.h"
class LLAccordionCtrl;
@@ -94,7 +96,7 @@ private:
void toggleTypeSpecificControls(LLWearableType::EType type);
void updateTypeSpecificControls(LLWearableType::EType type);
- //alpha mask checkboxes
+ // alpha mask checkboxes
void configureAlphaCheckbox(LLAvatarAppearanceDefines::ETextureIndex te, const std::string& name);
void onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LLAvatarAppearanceDefines::ETextureIndex te);
void updateAlphaCheckboxes();
@@ -104,7 +106,7 @@ private:
// callback for HeightUnits parameter.
bool changeHeightUnits(const LLSD& new_value);
- // updates current metric and replacemet metric label text
+ // updates current metric and replacement metric label text
void updateMetricLayout(BOOL new_value);
// updates avatar height label
@@ -114,6 +116,8 @@ private:
void setWearablePanelVisibilityChangeCallback(LLPanel* bodypart_panel);
+ static void incrementCofVersion();
+
// the pointer to the wearable we're editing. NULL means we're not editing a wearable.
LLViewerWearable *mWearablePtr;
LLViewerInventoryItem* mWearableItem;
@@ -128,7 +132,7 @@ private:
LLTextBox *mTxtAvatarHeight;
- // localized and parametrized strings that used to build avatar_height_label
+ // localized and parameterized strings that used to build avatar_height_label
std::string mMeters;
std::string mFeet;
std::string mHeigth;
@@ -151,7 +155,7 @@ private:
LLPanel *mPanelEyes;
LLPanel *mPanelHair;
- //clothes
+ // clothes
LLPanel *mPanelShirt;
LLPanel *mPanelPants;
LLPanel *mPanelShoes;
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index f225a7640b..f5d2fc6888 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1541,6 +1541,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("FetchLibDescendents2");
capabilityNames.append("FetchInventory2");
capabilityNames.append("FetchInventoryDescendents2");
+ capabilityNames.append("IncrementCOFVersion");
}
capabilityNames.append("GetDisplayNames");