From d1e3785416c348f0e9d6de5232773777e90130b6 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 26 Feb 2010 15:17:12 -0800 Subject: EXT-5679 Event details shows maturity incorrectly. reviewed by Richard --- indra/newview/llfloaterevent.cpp | 53 ++++++++++++++++++---- indra/newview/llfloaterevent.h | 3 +- indra/newview/llworldmap.h | 1 + .../newview/skins/default/xui/en/floater_event.xml | 50 ++++++++++++++++---- 4 files changed, 88 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 64efa10ef9..97ebab3425 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -58,6 +58,7 @@ #include "llviewercontrol.h" #include "llweb.h" #include "llworldmap.h" +#include "llworldmapmessage.h" #include "lluictrlfactory.h" #include "lltrans.h" @@ -215,16 +216,15 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) std::string desc = floater->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z); floater->mTBLocation->setText(desc); - if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) - { - floater->childSetVisible("event_mature_yes", TRUE); - floater->childSetVisible("event_mature_no", FALSE); - } - else - { - floater->childSetVisible("event_mature_yes", FALSE); - floater->childSetVisible("event_mature_no", TRUE); - } + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("unknown")); + + //for some reason there's not adult flags for now, so see if region is adult and then + //set flags + LLWorldMapMessage::url_callback_t cb = boost::bind( ®ionInfoCallback, floater->mEventInfo.mID, _1); + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(floater->mEventInfo.mSimName, cb, std::string("unused"), false); if (floater->mEventInfo.mUnixTime < time_corrected()) { @@ -249,6 +249,39 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) } } +//static +void LLFloaterEvent::regionInfoCallback(U32 event_id, U64 region_handle) +{ + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromHandle(region_handle); + LLFloaterEvent* floater = LLFloaterReg::getTypedInstance("event"); + + if (sim_info && floater && (event_id == floater->getEventID())) + { + // update the event with the maturity info + if (sim_info->isAdult()) + { + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", TRUE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("adult")); + + } + else if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) + { + floater->childSetVisible("rating_icon_m", TRUE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", FALSE); + floater->childSetValue("rating_value", floater->getString("moderate")); + } + else + { + floater->childSetVisible("rating_icon_m", FALSE); + floater->childSetVisible("rating_icon_r", FALSE); + floater->childSetVisible("rating_icon_pg", TRUE); + floater->childSetValue("rating_value", floater->getString("general")); + } + } +} void LLFloaterEvent::draw() { diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h index 54aaaf6a0f..4126236964 100644 --- a/indra/newview/llfloaterevent.h +++ b/indra/newview/llfloaterevent.h @@ -70,7 +70,8 @@ protected: static void onClickNotify(void*); void onClickDeleteEvent(); -// static bool callbackCreateEventWebPage(const LLSD& notification, const LLSD& response); + static void regionInfoCallback(U32 event_id, U64 region_handle); + protected: U32 mEventID; diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 7e37727b86..e4e677eb64 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -123,6 +123,7 @@ public: bool isName(const std::string& name) const; bool isDown() { return (mAccess == SIM_ACCESS_DOWN); } bool isPG() { return (mAccess <= SIM_ACCESS_PG); } + bool isAdult() { return (mAccess == SIM_ACCESS_ADULT); } // Debug only void dump() const; // Print the region info to the standard output diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml index 50f0f0454c..c2fab900e3 100644 --- a/indra/newview/skins/default/xui/en/floater_event.xml +++ b/indra/newview/skins/default/xui/en/floater_event.xml @@ -20,6 +20,22 @@ name="dont_notify"> Don't Notify + + Moderate + + + Adult + + + General + + + Unknown + + width="310" /> + follows="top|left" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left="10" + name="rating_icon_pg" + width="18" /> + +