本文整理汇总了C++中LLFloaterReporter类的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterReporter类的具体用法?C++ LLFloaterReporter怎么用?C++ LLFloaterReporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLFloaterReporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickObjPicker
// static
void LLFloaterReporter::onClickObjPicker(void *userdata)
{
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self);
LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance());
self->mPicking = TRUE;
self->childSetText("object_name", LLStringUtil::null);
self->childSetText("owner_name", LLStringUtil::null);
LLButton* pick_btn = self->getChild<LLButton>("pick_btn");
if (pick_btn) pick_btn->setToggleState(TRUE);
}
示例2: closePickTool
// static
void LLFloaterReporter::closePickTool(void *userdata)
{
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
LLUUID object_id = LLToolObjPicker::getInstance()->getObjectID();
self->getObjectInfo(object_id);
LLToolMgr::getInstance()->clearTransientTool();
self->mPicking = FALSE;
LLButton* pick_btn = self->getChild<LLButton>("pick_btn");
if (pick_btn) pick_btn->setToggleState(FALSE);
}
示例3: onClickCancel
// static
void LLFloaterReporter::onClickCancel(void *userdata)
{
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
// reset flag in case the next report also contains this text
self->mCopyrightWarningSeen = FALSE;
if (self->mPicking)
{
closePickTool(self);
}
self->close();
}
示例4: getInstance
// static
void LLFloaterReporter::showFromMenu(EReportType report_type)
{
if (COMPLAINT_REPORT != report_type)
{
llwarns << "Unknown LLViewerReporter type : " << report_type << llendl;
return;
}
LLFloaterReporter* f = getInstance();
if (f)
{
f->setReportType(report_type);
}
}
示例5: setDescription
void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd)
{
LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT];
if (self)
{
self->childSetText("details_edit", description);
for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer());
self->mMCDList.clear();
if (mcd)
{
self->mMCDList.push_back(new LLMeanCollisionData(mcd));
}
}
}
示例6: callbackAvatarID
// static
void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
{
LLFloaterReporter* self = (LLFloaterReporter*) data;
if (ids.empty() || names.empty()) return;
// this should never be called in a bug report but here for safety.
if ( self->mReportType != BUG_REPORT )
{
self->childSetText("abuser_name_edit", names[0] );
self->mAbuserID = ids[0];
self->refresh();
};
}
示例7: LL_WARNS
// static
void LLFloaterReporter::showFromMenu(EReportType report_type)
{
if (COMPLAINT_REPORT != report_type)
{
LL_WARNS() << "Unknown LLViewerReporter type : " << report_type << LL_ENDL;
return;
}
// Prevent menu from appearing in screen shot.
LLMenuGL::sMenuContainer->hideMenus();
LLFloaterReporter* f = getInstance();
if (f)
{
f->setReportType(report_type);
}
}
示例8: show
// static
void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name)
{
LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter");
if (avatar_name.empty())
{
// Request info for this object
f->getObjectInfo(object_id);
}
else
{
f->setFromAvatarID(object_id);
}
// Need to deselect on close
f->mDeselectOnClose = TRUE;
f->openFloater();
}
示例9: if
// static
void LLFloaterReporter::showFromMenu(EReportType report_type)
{
if (gReporterInstances.checkData(report_type))
{
// ...bring that window to front
LLFloaterReporter *f = gReporterInstances.getData(report_type);
f->open(); /* Flawfinder: ignore */
}
else
{
LLFloaterReporter *f;
if (BUG_REPORT == report_type)
{
f = LLFloaterReporter::createNewBugReporter();
}
else if (COMPLAINT_REPORT == report_type)
{
f = LLFloaterReporter::createNewAbuseReporter();
}
else
{
llwarns << "Unknown LLViewerReporter type : " << report_type << llendl;
return;
}
f->center();
if (report_type == BUG_REPORT)
{
LLNotifications::instance().add("HelpReportBug");
}
else
{
// popup for abuse reports is triggered elsewhere
}
// grab the user's name
std::string fullname;
gAgent.buildFullname(fullname);
f->childSetText("reporter_field", fullname);
}
}
示例10: callback
// static
void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLUploadDialog::modalUploadFinished();
LLResourceData* data = (LLResourceData*)user_data;
if(result < 0)
{
LLStringUtil::format_map_t args;
std::string reason = std::string(LLAssetStorage::getErrorString(result));
args["[REASON]"] = reason;
gViewerWindow->alertXml("ErrorUploadingReportScreenshot", args);
std::string err_msg("There was a problem uploading a report screenshot");
err_msg += " due to the following reason: " + reason;
llwarns << err_msg << llendl;
return;
}
EReportType report_type = UNKNOWN_REPORT;
if (data->mPreferredLocation == -1)
{
report_type = BUG_REPORT;
}
else if (data->mPreferredLocation == -2)
{
report_type = COMPLAINT_REPORT;
}
else
{
llwarns << "Unknown report type : " << data->mPreferredLocation << llendl;
}
LLFloaterReporter *self = getReporter(report_type);
if (self)
{
self->mScreenID = uuid;
llinfos << "Got screen shot " << uuid << llendl;
self->sendReportViaLegacy(self->gatherReport());
self->close();
}
}
示例11: show
// static
void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name)
{
LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter");
// grab the user's name
std::string fullname;
LLAgentUI::buildFullname(fullname);
f->getChild<LLUICtrl>("reporter_field")->setValue(fullname);
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;
f->openFloater();
}
示例12: createNewAbuseReporter
// static
//void LLFloaterReporter::showFromObject(const LLUUID& object_id)
LLFloaterReporter* LLFloaterReporter::showFromObject(const LLUUID& object_id, bool show)
{
LLFloaterReporter* f = createNewAbuseReporter();
f->center();
f->setFocus(TRUE);
// grab the user's name
std::string fullname;
gAgent.buildFullname(fullname);
f->childSetText("reporter_field", fullname);
// Request info for this object
f->getObjectInfo(object_id);
// Need to deselect on close
f->mDeselectOnClose = TRUE;
//f->open(); /* Flawfinder: ignore */
if ( show )
{
f->open(); /* Flawfinder: ignore */
}
else
{
gDialogVisible = FALSE;
}
return f;
}
示例13: callback
// static
void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLUploadDialog::modalUploadFinished();
LLResourceData* data = (LLResourceData*)user_data;
if(result < 0)
{
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotificationsUtil::add("ErrorUploadingReportScreenshot", args);
std::string err_msg("There was a problem uploading a report screenshot");
err_msg += " due to the following reason: " + args["REASON"].asString();
llwarns << err_msg << llendl;
return;
}
EReportType report_type = UNKNOWN_REPORT;
if (data->mPreferredLocation == LLResourceData::INVALID_LOCATION)
{
report_type = COMPLAINT_REPORT;
}
else
{
llwarns << "Unknown report type : " << data->mPreferredLocation << llendl;
}
LLFloaterReporter *self = getInstance();
if (self)
{
self->mScreenID = uuid;
llinfos << "Got screen shot " << uuid << llendl;
self->sendReportViaLegacy(self->gatherReport());
self->close();
}
}
示例14: onClickSend
// static
void LLFloaterReporter::onClickSend(void *userdata)
{
LLFloaterReporter *self = (LLFloaterReporter *)userdata;
if (self->mPicking)
{
closePickTool(self);
}
if(self->validateReport())
{
// only show copyright alert for abuse reports
if ( self->mReportType != BUG_REPORT )
{
if ( ! self->mCopyrightWarningSeen )
{
std::string details_lc = self->childGetText("details_edit");
LLStringUtil::toLower( details_lc );
std::string summary_lc = self->childGetText("summary_edit");
LLStringUtil::toLower( summary_lc );
if ( details_lc.find( "copyright" ) != std::string::npos ||
summary_lc.find( "copyright" ) != std::string::npos )
{
gViewerWindow->alertXml("HelpReportAbuseContainsCopyright");
self->mCopyrightWarningSeen = TRUE;
return;
};
};
};
LLUploadDialog::modalUploadDialog("Uploading...\n\nReport");
// *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");
if(!url.empty() || !sshot_url.empty())
{
self->sendReportViaCaps(url, sshot_url, self->gatherReport());
self->close();
}
else
{
if(self->childGetValue("screen_check"))
{
self->childDisable("send_btn");
self->childDisable("cancel_btn");
// the callback from uploading the image calls sendReportViaLegacy()
self->uploadImage();
}
else
{
self->sendReportViaLegacy(self->gatherReport());
LLUploadDialog::modalUploadFinished();
self->close();
}
}
}
}
示例15: processObjectPropertiesFamily
// static
void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data)
{
LLUUID id;
U32 request_flags;
LLUUID creator_id;
LLUUID owner_id;
LLUUID group_id;
LLUUID extra_id;
U32 base_mask, owner_mask, group_mask, everyone_mask, next_owner_mask;
LLSaleInfo sale_info;
LLCategory category;
msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_RequestFlags, request_flags );
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ObjectID, id );
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id );
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, group_id );
msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_BaseMask, base_mask );
msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_OwnerMask, owner_mask );
msg->getU32Fast(_PREHASH_ObjectData,_PREHASH_GroupMask, group_mask );
msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_EveryoneMask, everyone_mask );
msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_NextOwnerMask, next_owner_mask);
sale_info.unpackMessage(msg, _PREHASH_ObjectData);
category.unpackMessage(msg, _PREHASH_ObjectData);
LLUUID last_owner_id;
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id );
// unpack name & desc
std::string name;
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, name);
std::string desc;
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc);
// the reporter widget askes the server for info about picked objects
if (request_flags & (COMPLAINT_REPORT_REQUEST | BUG_REPORT_REQUEST))
{
EReportType report_type = (COMPLAINT_REPORT_REQUEST & request_flags) ? COMPLAINT_REPORT : BUG_REPORT;
LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type);
if (reporterp)
{
std::string fullname;
gCacheName->getFullName(owner_id, fullname);
reporterp->setPickedObjectProperties(name, fullname, owner_id);
}
}
else if (request_flags & OBJECT_PAY_REQUEST)
{
// check if the owner of the paid object is muted
LLMuteList::getInstance()->autoRemove(owner_id, LLMuteList::AR_MONEY);
}
// Now look through all of the hovered nodes
struct f : public LLSelectedNodeFunctor
{
LLUUID mID;
f(const LLUUID& id) : mID(id) {}
virtual bool apply(LLSelectNode* node)
{
return (node->getObject() && node->getObject()->mID == mID);
}
} func(id);
LLSelectNode* node = LLSelectMgr::getInstance()->getHoverObjects()->getFirstNode(&func);
if (node)
{
node->mValid = TRUE;
node->mPermissions->init(LLUUID::null, owner_id,
last_owner_id, group_id);
node->mPermissions->initMasks(base_mask, owner_mask, everyone_mask, group_mask, next_owner_mask);
node->mSaleInfo = sale_info;
node->mCategory = category;
node->mName.assign(name);
node->mDescription.assign(desc);
}
dialog_refresh_all();
}