summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterworldmap.cpp47
-rw-r--r--indra/newview/llfloaterworldmap.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_world_map.xml8
3 files changed, 35 insertions, 22 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index fbe77047e3..983fd97b0b 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -216,6 +216,8 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mCommitCallbackRegistrar.add("WMap.ShowAgent", boost::bind(&LLFloaterWorldMap::onShowAgentBtn, this));
mCommitCallbackRegistrar.add("WMap.Clear", boost::bind(&LLFloaterWorldMap::onClearBtn, this));
mCommitCallbackRegistrar.add("WMap.CopySLURL", boost::bind(&LLFloaterWorldMap::onCopySLURL, this));
+
+ gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterWorldMap::onChangeMaturity, this));
}
// static
@@ -251,6 +253,8 @@ BOOL LLFloaterWorldMap::postBuild()
mZoomTimer.stop();
+ onChangeMaturity();
+
return TRUE;
}
@@ -378,21 +382,6 @@ void LLFloaterWorldMap::draw()
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);
- // Hide/Show Mature Events controls
- childSetVisible("events_mature_icon", gAgent.canAccessMature());
- childSetVisible("events_mature_label", gAgent.canAccessMature());
- childSetVisible("event_mature_chk", gAgent.canAccessMature());
-
- childSetVisible("events_adult_icon", gAgent.canAccessMature());
- childSetVisible("events_adult_label", gAgent.canAccessMature());
- childSetVisible("event_adult_chk", gAgent.canAccessMature());
- bool adult_enabled = gAgent.canAccessAdult();
- if (!adult_enabled)
- {
- childSetValue("event_adult_chk", FALSE);
- }
- childSetEnabled("event_adult_chk", adult_enabled);
-
// On orientation island, users don't have a home location yet, so don't
// let them teleport "home". It dumps them in an often-crowed welcome
// area (infohub) and they get confused. JC
@@ -480,8 +469,8 @@ void LLFloaterWorldMap::draw()
childSetEnabled("telehub_chk", enable);
childSetEnabled("land_for_sale_chk", enable);
childSetEnabled("event_chk", enable);
- childSetEnabled("event_mature_chk", enable);
- childSetEnabled("event_adult_chk", enable);
+ childSetEnabled("events_mature_chk", enable);
+ childSetEnabled("events_adult_chk", enable);
LLFloater::draw();
}
@@ -1480,3 +1469,27 @@ void LLFloaterWorldMap::onCommitSearchResult()
onShowTargetBtn();
}
+
+void LLFloaterWorldMap::onChangeMaturity()
+{
+ bool can_access_mature = gAgent.canAccessMature();
+ bool can_access_adult = gAgent.canAccessAdult();
+
+ childSetVisible("events_mature_icon", can_access_mature);
+ childSetVisible("events_mature_label", can_access_mature);
+ childSetVisible("events_mature_chk", can_access_mature);
+
+ childSetVisible("events_adult_icon", can_access_adult);
+ childSetVisible("events_adult_label", can_access_adult);
+ childSetVisible("events_adult_chk", can_access_adult);
+
+ // disable mature / adult events.
+ if (!can_access_mature)
+ {
+ gSavedSettings.setBOOL("ShowMatureEvents", FALSE);
+ }
+ if (!can_access_adult)
+ {
+ gSavedSettings.setBOOL("ShowAdultEvents", FALSE);
+ }
+}
diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h
index de515c689e..550b4ef689 100644
--- a/indra/newview/llfloaterworldmap.h
+++ b/indra/newview/llfloaterworldmap.h
@@ -112,7 +112,7 @@ public:
// teleport to the tracked item, if there is one
void teleport();
-
+ void onChangeMaturity();
protected:
void onGoHome();
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index ece406f9b1..a59db1420f 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -306,7 +306,7 @@
initial_value="true"
layout="topleft"
left="135"
- name="event_mature_chk"
+ name="events_mature_chk"
top_pad="3"
width="22" />
<icon
@@ -328,7 +328,7 @@
top_delta="2"
left_pad="3"
layout="topleft"
- name="mature_label"
+ name="events_mature_label"
width="66">
Moderate
</text>
@@ -339,7 +339,7 @@
height="16"
layout="topleft"
left="135"
- name="event_adult_chk"
+ name="events_adult_chk"
top_pad="3"
width="22" />
<icon
@@ -361,7 +361,7 @@
top_delta="2"
left_pad="3"
layout="topleft"
- name="adult_label"
+ name="events_adult_label"
width="66">
Adult
</text>