From 052c0bc37883ee3e4695eb2d67ef823e7ed6ab6f Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Tue, 29 Jun 2010 22:07:52 +0300 Subject: EXT-7648 FIXED Added handler for "PreferredMaturity" property which updates visibility and values for mature/adults check_box/icon/label. Reviewed by Sergey Litovchuk and Mike Antipov at https://codereview.productengine.com/secondlife/r/633/ --HG-- branch : product-engine --- indra/newview/llfloaterworldmap.cpp | 47 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'indra/newview/llfloaterworldmap.cpp') 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); + } +} -- cgit v1.3