Added a Report Abuse button to the experience profile

master
dolphin 2014-03-13 15:10:51 -07:00
parent a0b8c3e029
commit e10ae3ba96
5 changed files with 79 additions and 19 deletions

View File

@ -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_ENABLE "enable_btn"
#define BTN_PRIVATE "private_btn"
#define BTN_SET_LOCATION "location_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_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<LLTextEditor>(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this));
getChild<LLUICtrl>(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);
}

View File

@ -70,7 +70,8 @@ protected:
void onClickLocation();
void onClickClear();
void onPickGroup();
void onFieldChanged();
void onFieldChanged();
void onReportExperience();
void setEditGroup(LLUUID group_id);

View File

@ -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<LLUICtrl>("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<LLFloaterReporter>("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<LLUICtrl>("pos_field")->setValue(pos_string);
}
// void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd)
// {
// LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter");

View File

@ -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<LLAvatarName> 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;

View File

@ -10,7 +10,7 @@
min_width="325"
min_height="325"
width="358"
height="660">
height="650">
<floater.string
name="empty_slurl">
(none)
@ -42,7 +42,7 @@
<tab_container
hide_tabs="true"
follows="all"
height="620"
height="615"
layout="topleft"
left="5"
min_height="250"
@ -52,7 +52,7 @@
<panel
background_visible="true"
follows="all"
height="550"
height="540"
layout="topleft"
left="0"
min_height="250"
@ -62,7 +62,7 @@
<scroll_container
color="DkGray2"
follows="all"
height="532"
height="520"
layout="topleft"
left="9"
name="xp_scroll"
@ -72,7 +72,7 @@
<panel
bg_alpha_color="DkGray2"
follows="top|left|right"
height="510"
height="550"
layout="topleft"
left="0"
name="scrolling_panel"
@ -81,9 +81,10 @@
min_width="315">
<layout_stack
follows="all"
height="510"
height="550"
layout="topleft"
left="0"
animate="false"
top="0"
orientation="vertical"
width="315">
@ -352,7 +353,7 @@
</layout_panel>
<layout_panel
follows="all"
height="49"
height="75"
layout="topleft"
left="0"
top="5"
@ -366,7 +367,7 @@
label="Allow"
layout="topleft"
name="allow_btn"
width="80"
width="94"
top_pad="3"
left="10"
enabled="false"/>
@ -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"/>
<text
type="string"
halign="center"
length="1"
follows="left|top|right"
height="16"
layout="topleft"
left="10"
name="privileged"
use_ellipses="true"
visible="false"
right ="-10">
width="288">
This experience is enabled for all residents.
</text>
<button
follows="bottom|left"
height="23"
label="Report Abuse"
layout="topleft"
name="report_btn"
width="288"
top_pad="3"
left="10"
enabled="true"/>
</layout_panel>
</layout_stack>
</panel>