summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2013-10-25 09:48:41 -0700
committerdolphin <dolphin@lindenlab.com>2013-10-25 09:48:41 -0700
commita6faeac94530e59d2c2a56df63a1d78e00fb0247 (patch)
tree90bb06d785b4337b5a793f2d0e4734e8ea9a5ac3 /indra
parent1385a53e3388ed5ed94887d9ad65c134c65b56ec (diff)
Fixed the unintentional removal of experiences from teh list floater.
Added a message to the UI for privileged experiences.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterexperienceprofile.cpp63
-rw-r--r--indra/newview/skins/default/xui/en/floater_experienceprofile.xml18
2 files changed, 67 insertions, 14 deletions
diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp
index 25dde49b8e..2a81c6cdec 100644
--- a/indra/newview/llfloaterexperienceprofile.cpp
+++ b/indra/newview/llfloaterexperienceprofile.cpp
@@ -58,6 +58,7 @@
#define TF_OWNER "OwnerText"
#define TF_GROUP "GroupText"
#define TF_GRID_WIDE "grid_wide"
+#define TF_PRIVILEGED "privileged"
#define EDIT "edit_"
#define IMG_LOGO "logo"
@@ -161,14 +162,45 @@ public:
class ExperiencePreferencesResponder : public LLHTTPClient::Responder
{
public:
- ExperiencePreferencesResponder()
+ ExperiencePreferencesResponder(bool single):mSingle(single)
{
}
+ void sendSingle(const LLSD& content, const LLSD& permission, const char* name)
+ {
+ if(!content.has(name))
+ return;
+
+ LLEventPump& pump = LLEventPumps::instance().obtain("experience_permission");
+ const LLSD& list = content[name];
+ LLSD::array_const_iterator it = list.beginArray();
+ while(it != list.endArray())
+ {
+ LLSD message;
+ message[it->asString()] = permission;
+ pump.post(message);
+ ++it;
+ }
+ }
+
virtual void result(const LLSD& content)
{
+ if(mSingle)
+ {
+ LLSD experience;
+ experience["permission"]="Allow";
+
+ sendSingle(content, experience, "experiences");
+
+ experience["permission"]="Block";
+ sendSingle(content, experience, "blocked");
+
+ return;
+ }
LLEventPumps::instance().obtain("experience_permission").post(content);
}
+private:
+ bool mSingle;
};
@@ -222,12 +254,6 @@ BOOL LLFloaterExperienceProfile::postBuild()
{
LLHTTPClient::get(lookup_url+"?experience_id="+mExperienceId.asString(), new IsAdminResponder(getDerivedHandle<LLFloaterExperienceProfile>()));
}
-
- lookup_url=region->getCapability("ExperiencePreferences");
- if(!lookup_url.empty())
- {
- LLHTTPClient::get(lookup_url+"?"+mExperienceId.asString(), new ExperiencePreferencesResponder());
- }
}
}
@@ -312,7 +338,7 @@ void LLFloaterExperienceProfile::onClickPermission(const char* perm)
permission["permission"]=perm;
data[mExperienceId.asString()]=permission;
- LLHTTPClient::put(lookup_url, data, new ExperiencePreferencesResponder());
+ LLHTTPClient::put(lookup_url, data, new ExperiencePreferencesResponder(false));
}
@@ -327,7 +353,7 @@ void LLFloaterExperienceProfile::onClickForget()
if(lookup_url.empty())
return;
- LLHTTPClient::del(lookup_url+"?"+mExperienceId.asString(), new ExperiencePreferencesResponder());
+ LLHTTPClient::del(lookup_url+"?"+mExperienceId.asString(), new ExperiencePreferencesResponder(false));
}
bool LLFloaterExperienceProfile::setMaturityString( U8 maturity, LLTextBox* child, LLComboBox* combo )
@@ -377,7 +403,6 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience )
LLLayoutPanel* locationPanel = getChild<LLLayoutPanel>(PNL_LOC);
LLLayoutPanel* marketplacePanel = getChild<LLLayoutPanel>(PNL_MRKT);
LLLayoutPanel* topPanel = getChild<LLLayoutPanel>(PNL_TOP);
- LLLayoutPanel* permPanel = getChild<LLLayoutPanel>(PNL_PERMS);
imagePanel->setVisible(FALSE);
@@ -449,7 +474,23 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience )
}
- permPanel->setVisible((properties & LLExperienceCache::PROPERTY_PRIVILEGED) == 0);
+ if(properties & LLExperienceCache::PROPERTY_PRIVILEGED)
+ {
+ child = getChild<LLTextBox>(TF_PRIVILEGED);
+ child->setVisible(TRUE);
+ }
+ else
+ {
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ std::string lookup_url=region->getCapability("ExperiencePreferences");
+ if(!lookup_url.empty())
+ {
+ LLHTTPClient::get(lookup_url+"?"+mExperienceId.asString(), new ExperiencePreferencesResponder(true));
+ }
+ }
+ }
value=experience[LLExperienceCache::METADATA].asString();
if(value.empty())
diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
index 2b936b79c9..b823b338ad 100644
--- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
+++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
@@ -353,13 +353,13 @@
</layout_panel>
<layout_panel
follows="all"
- height="33"
+ height="49"
layout="topleft"
left="0"
top="5"
width="313"
auto_resize="false"
- visible="false"
+ visible="true"
name="perm panel">
<button
follows="bottom|left"
@@ -391,7 +391,19 @@
top_pad="-23"
left_pad="3"
enabled="false"/>
-
+ <text
+ type="string"
+ length="1"
+ follows="left|top|right"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="privileged"
+ use_ellipses="true"
+ visible="false"
+ right ="-10">
+ This experience is enabled for all residents.
+ </text>
</layout_panel>
</layout_stack>
</panel>