From e10ae3ba960cf030582378c454937dd326fcd436 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 13 Mar 2014 15:10:51 -0700 Subject: Added a Report Abuse button to the experience profile --- indra/newview/llfloaterexperienceprofile.cpp | 18 ++++++++--- indra/newview/llfloaterexperienceprofile.h | 3 +- indra/newview/llfloaterreporter.cpp | 37 ++++++++++++++++++++++ indra/newview/llfloaterreporter.h | 3 ++ .../default/xui/en/floater_experienceprofile.xml | 35 +++++++++++++------- 5 files changed, 78 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index 1c01a4bb9f..f8b4978a3d 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -50,6 +50,7 @@ #include "llevents.h" #include "llfloatergroups.h" #include "llnotifications.h" +#include "llfloaterreporter.h" #define XML_PANEL_EXPERIENCE_PROFILE "floater_experienceprofile.xml" #define TF_NAME "experience_title" @@ -73,17 +74,18 @@ #define PNL_GROUP "group_panel" #define PNL_PERMS "perm panel" -#define BTN_EDIT "edit_btn" #define BTN_ALLOW "allow_btn" -#define BTN_FORGET "forget_btn" #define BTN_BLOCK "block_btn" #define BTN_CANCEL "cancel_btn" -#define BTN_SAVE "save_btn" +#define BTN_CLEAR_LOCATION "clear_btn" +#define BTN_EDIT "edit_btn" #define BTN_ENABLE "enable_btn" +#define BTN_FORGET "forget_btn" #define BTN_PRIVATE "private_btn" -#define BTN_SET_LOCATION "location_btn" -#define BTN_CLEAR_LOCATION "clear_btn" +#define BTN_REPORT "report_btn" +#define BTN_SAVE "save_btn" #define BTN_SET_GROUP "Group_btn" +#define BTN_SET_LOCATION "location_btn" class LLExperienceHandler : public LLCommandHandler @@ -310,6 +312,7 @@ BOOL LLFloaterExperienceProfile::postBuild() childSetAction(BTN_SET_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickLocation, this)); childSetAction(BTN_CLEAR_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickClear, this)); childSetAction(BTN_SET_GROUP, boost::bind(&LLFloaterExperienceProfile::onPickGroup, this)); + childSetAction(BTN_REPORT, boost::bind(&LLFloaterExperienceProfile::onReportExperience, this)); getChild(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild(EDIT TF_MATURITY)->setCommitCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); @@ -982,3 +985,8 @@ void LLFloaterExperienceProfile::setEditGroup( LLUUID group_id ) mPackage[LLExperienceCache::GROUP_ID] = group_id; onFieldChanged(); } + +void LLFloaterExperienceProfile::onReportExperience() +{ + LLFloaterReporter::showFromExperience(mExperienceId); +} diff --git a/indra/newview/llfloaterexperienceprofile.h b/indra/newview/llfloaterexperienceprofile.h index 5e9fd8f03a..b66df49a8a 100644 --- a/indra/newview/llfloaterexperienceprofile.h +++ b/indra/newview/llfloaterexperienceprofile.h @@ -70,7 +70,8 @@ protected: void onClickLocation(); void onClickClear(); void onPickGroup(); - void onFieldChanged(); + void onFieldChanged(); + void onReportExperience(); void setEditGroup(LLUUID group_id); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 35b63c5480..1b9fc8c6d0 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -81,6 +81,7 @@ #include "llagentui.h" #include "lltrans.h" +#include "llexperiencecache.h" const U32 INCLUDE_SCREENSHOT = 0x01 << 0; @@ -227,6 +228,28 @@ void LLFloaterReporter::enableControls(BOOL enable) getChildView("cancel_btn")->setEnabled(enable); } +void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) +{ + mExperienceID = experience_id; + + if (LLUUID::null != mExperienceID) + { + LLSD experience; + stringstream desc; + if(LLExperienceCache::get(mExperienceID, experience)){ + setFromAvatarID(experience[LLExperienceCache::AGENT_ID]); + desc << "\nExperience id: " << mExperienceID; + } + else + { + desc << "Unable to retrieve details for id: "<< mExperienceID; + } + + LLUICtrl* details = getChild("details_edit"); + details->setValue(desc.str()); + } +} + void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) { // TODO -- @@ -493,6 +516,19 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ } + +void LLFloaterReporter::showFromExperience( const LLUUID& experience_id ) +{ + LLFloaterReporter* f = LLFloaterReg::showTypedInstance("reporter"); + f->getExperienceInfo(experience_id); + + // Need to deselect on close + f->mDeselectOnClose = TRUE; + + f->openFloater(); +} + + // static void LLFloaterReporter::showFromObject(const LLUUID& object_id) { @@ -854,6 +890,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) getChild("pos_field")->setValue(pos_string); } + // void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) // { // LLFloaterReporter *self = LLFloaterReg::findTypedInstance("reporter"); diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index d54e7f6ab0..de3aa9ca5e 100755 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -90,6 +90,7 @@ public: static void showFromObject(const LLUUID& object_id); static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name); + static void showFromExperience(const LLUUID& experience_id); static void onClickSend (void *userdata); static void onClickCancel (void *userdata); @@ -118,6 +119,7 @@ private: void sendReportViaCaps(std::string url, std::string sshot_url, const LLSD & report); void setPosBox(const LLVector3d &pos); void enableControls(BOOL own_avatar); + void getExperienceInfo(const LLUUID& object_id); void getObjectInfo(const LLUUID& object_id); void callbackAvatarID(const uuid_vec_t& ids, const std::vector names); void setFromAvatarID(const LLUUID& avatar_id); @@ -128,6 +130,7 @@ private: LLUUID mObjectID; LLUUID mScreenID; LLUUID mAbuserID; + LLUUID mExperienceID; // Store the real name, not the link, for upstream reporting std::string mOwnerName; BOOL mDeselectOnClose; diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml index fa4e6c02db..67a7d5dad0 100644 --- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml +++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml @@ -10,7 +10,7 @@ min_width="325" min_height="325" width="358" - height="660"> + height="650"> (none) @@ -42,7 +42,7 @@ @@ -352,7 +353,7 @@ @@ -376,7 +377,7 @@ label="Forget" layout="topleft" name="forget_btn" - width="80" + width="94" top_pad="-23" left_pad="3" enabled="false"/> @@ -386,23 +387,33 @@ label="Block" layout="topleft" name="block_btn" - width="80" + width="94" top_pad="-23" left_pad="3" enabled="false"/> + width="288"> This experience is enabled for all residents. +