summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterworldmap.cpp')
-rw-r--r--indra/newview/llfloaterworldmap.cpp47
1 files changed, 30 insertions, 17 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);
+ }
+}