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/llfloaterreporter.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'indra/newview/llfloaterreporter.cpp') 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"); -- cgit v1.2.3 From 2604b3419657cb3bb8bafb90b1d9e5e43f11db4d Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 17 Mar 2014 16:00:41 -0700 Subject: Updated experience cache to get a const reference to xp data --- indra/newview/llfloaterreporter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterreporter.cpp') diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1b9fc8c6d0..a58e2a4791 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -234,9 +234,11 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) if (LLUUID::null != mExperienceID) { - LLSD experience; - stringstream desc; - if(LLExperienceCache::get(mExperienceID, experience)){ + const LLSD& experience = LLExperienceCache::get(mExperienceID); + std::stringstream desc; + + if(experience.isDefined()) + { setFromAvatarID(experience[LLExperienceCache::AGENT_ID]); desc << "\nExperience id: " << mExperienceID; } -- cgit v1.2.3 From dba034ee100dae4b62ddf12523835a413a25f189 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 20 Mar 2014 16:32:31 -0700 Subject: Experience log panel --- indra/newview/llfloaterreporter.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterreporter.cpp') diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index a58e2a4791..27e26d4fda 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -248,7 +248,7 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) } LLUICtrl* details = getChild("details_edit"); - details->setValue(desc.str()); + details->setValue(details->getValue().asString()+desc.str()); } } @@ -497,7 +497,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) } // static -void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name) +void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name, const LLUUID& experience_id) { LLFloaterReporter* f = LLFloaterReg::showTypedInstance("reporter"); @@ -510,6 +510,10 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ { f->setFromAvatarID(object_id); } + if(experience_id.notNull()) + { + f->getExperienceInfo(experience_id); + } // Need to deselect on close f->mDeselectOnClose = TRUE; @@ -532,9 +536,9 @@ void LLFloaterReporter::showFromExperience( const LLUUID& experience_id ) // static -void LLFloaterReporter::showFromObject(const LLUUID& object_id) +void LLFloaterReporter::showFromObject(const LLUUID& object_id, const LLUUID& experience_id) { - show(object_id); + show(object_id, LLStringUtil::null, experience_id); } // static -- cgit v1.2.3 From 90a42d43b255eca082c283e5a0dfabd4ebfce508 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 23 Apr 2014 00:27:32 +0100 Subject: Clear abuse details before adding experience id for ACME-1421 --- indra/newview/llfloaterreporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterreporter.cpp') diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 27e26d4fda..6b4b584fa9 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -240,7 +240,7 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) if(experience.isDefined()) { setFromAvatarID(experience[LLExperienceCache::AGENT_ID]); - desc << "\nExperience id: " << mExperienceID; + desc << "Experience id: " << mExperienceID; } else { @@ -248,7 +248,7 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) } LLUICtrl* details = getChild("details_edit"); - details->setValue(details->getValue().asString()+desc.str()); + details->setValue(desc.str()); } } -- cgit v1.2.3