diff options
Diffstat (limited to 'indra/newview/llfloaterreporter.cpp')
-rw-r--r-- | indra/newview/llfloaterreporter.cpp | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index e0f2fca580..b42b34835d 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -84,6 +84,8 @@ #include "llassetuploadresponders.h" #include "llagentui.h" +#include "lltrans.h" + const U32 INCLUDE_SCREENSHOT = 0x01 << 0; //----------------------------------------------------------------------------- @@ -248,6 +250,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) if ( objectp->isAttachment() ) { objectp = (LLViewerObject*)objectp->getRoot(); + mObjectID = objectp->getID(); } // correct the region and position information @@ -277,13 +280,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) { object_owner.append("Unknown"); } - childSetText("object_name", object_owner); - std::string owner_link = - LLSLURL::buildCommand("agent", mObjectID, "inspect"); - childSetText("owner_name", owner_link); - childSetText("abuser_name_edit", object_owner); - mAbuserID = object_id; - mOwnerName = object_owner; + + setFromAvatar(mObjectID, object_owner); } else { @@ -305,13 +303,12 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) } } - void LLFloaterReporter::onClickSelectAbuser() { gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); } -void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) +void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) { if (ids.empty() || names.empty()) return; @@ -323,6 +320,17 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, } +void LLFloaterReporter::setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name) +{ + mAbuserID = mObjectID = avatar_id; + mOwnerName = avatar_name; + + std::string avatar_link = LLSLURL::buildCommand("agent", mObjectID, "inspect"); + childSetText("owner_name", avatar_link); + childSetText("object_name", avatar_name); + childSetText("abuser_name_edit", avatar_name); +} + // static void LLFloaterReporter::onClickSend(void *userdata) { @@ -366,8 +374,7 @@ void LLFloaterReporter::onClickSend(void *userdata) return; } - - LLUploadDialog::modalUploadDialog("Uploading...\n\nReport"); + LLUploadDialog::modalUploadDialog(LLTrans::getString("uploading_abuse_report")); // *TODO don't upload image if checkbox isn't checked std::string url = gAgent.getRegion()->getCapability("SendUserReport"); std::string sshot_url = gAgent.getRegion()->getCapability("SendUserReportWithScreenshot"); @@ -458,9 +465,8 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) } } - // static -void LLFloaterReporter::showFromObject(const LLUUID& object_id) +void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name) { LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter"); @@ -469,8 +475,11 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) LLAgentUI::buildFullname(fullname); f->childSetText("reporter_field", fullname); - // Request info for this object - f->getObjectInfo(object_id); + if (avatar_name.empty()) + // Request info for this object + f->getObjectInfo(object_id); + else + f->setFromAvatar(object_id, avatar_name); // Need to deselect on close f->mDeselectOnClose = TRUE; @@ -479,6 +488,18 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) } +// static +void LLFloaterReporter::showFromObject(const LLUUID& object_id) +{ + show(object_id); +} + +// static +void LLFloaterReporter::showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name) +{ + show(avatar_id, avatar_name); +} + void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) { childSetText("object_name", object_name); |