本文整理汇总了C++中LLFloaterPostcard类的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterPostcard类的具体用法?C++ LLFloaterPostcard怎么用?C++ LLFloaterPostcard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLFloaterPostcard类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: from
// static
void LLFloaterPostcard::onClickSend(void* data)
{
if (data)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)data;
std::string from(self->childGetValue("from_form").asString());
std::string to(self->childGetValue("to_form").asString());
boost::regex emailFormat("[A-Za-z0-9.%+-_][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
if (to.empty() || !boost::regex_match(to, emailFormat))
{
LLNotificationsUtil::add("PromptRecipientEmail");
return;
}
if (from.empty() || !boost::regex_match(from, emailFormat))
{
LLNotificationsUtil::add("PromptSelfEmail");
return;
}
std::string subject(self->childGetValue("subject_form").asString());
if(subject.empty() || !self->mHasFirstMsgFocus)
{
LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2));
return;
}
if (self->mJPEGImage.notNull())
{
self->sendPostcard();
}
else
{
LLNotificationsUtil::add("ErrorProcessingSnapshot");
}
}
}
示例2: onClickSend
// static
void LLFloaterPostcard::onClickSend(void* data)
{
if (data)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)data;
LLString from(self->childGetValue("from_form").asString().c_str());
LLString to(self->childGetValue("to_form").asString().c_str());
if (to.empty() || to.find('@') == std::string::npos)
{
gViewerWindow->alertXml("PromptRecipientEmail");
return;
}
if (from.empty() || from.find('@') == std::string::npos)
{
gViewerWindow->alertXml("PromptSelfEmail");
return;
}
LLString subject(self->childGetValue("subject_form").asString().c_str());
if(subject.empty() || !self->mHasFirstMsgFocus)
{
gViewerWindow->alertXml("PromptMissingSubjMsg", missingSubjMsgAlertCallback, self);
return;
}
if (self->mJPEGImage.notNull())
{
self->sendPostcard();
}
else
{
gViewerWindow->alertXml("ErrorProcessingSnapshot");
}
}
}
示例3: callback
// static
void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)user_data;
LLUploadDialog::modalUploadFinished();
if (result)
{
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
LLNotificationsUtil::add("ErrorUploadingPostcard", args);
}
else
{
// only create the postcard once the upload succeeds
// request the postcard
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SendPostcard");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addUUID("AssetID", self->mAssetID);
msg->addVector3d("PosGlobal", self->mPosTakenGlobal);
msg->addString("To", self->getChild<LLUICtrl>("to_form")->getValue().asString());
msg->addString("From", self->getChild<LLUICtrl>("from_form")->getValue().asString());
msg->addString("Name", self->getChild<LLUICtrl>("name_form")->getValue().asString());
msg->addString("Subject", self->getChild<LLUICtrl>("subject_form")->getValue().asString());
msg->addString("Msg", self->getChild<LLUICtrl>("msg_form")->getValue().asString());
msg->addBOOL("AllowPublish", FALSE);
msg->addBOOL("MaturePublish", FALSE);
gAgent.sendReliableMessage();
}
self->closeFloater();
}
示例4: callback
// static
void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLFloaterPostcard *self = (LLFloaterPostcard *)user_data;
LLUploadDialog::modalUploadFinished();
if (result)
{
LLStringBase<char>::format_map_t args;
args["[REASON]"] = std::string(LLAssetStorage::getErrorString(result));
gViewerWindow->alertXml("ErrorUploadingPostcard", args);
}
else
{
// only create the postcard once the upload succeeds
// request the postcard
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SendPostcard");
msg->nextBlock("AgentData");
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->addUUID("AssetID", self->mAssetID);
msg->addVector3d("PosGlobal", self->mPosTakenGlobal);
msg->addString("To", self->childGetValue("to_form").asString());
msg->addString("From", self->childGetValue("from_form").asString());
msg->addString("Name", self->childGetValue("name_form").asString());
msg->addString("Subject", self->childGetValue("subject_form").asString());
msg->addString("Msg", self->childGetValue("msg_form").asString());
msg->addBOOL("AllowPublish", self->childGetValue("allow_publish_check").asBoolean());
msg->addBOOL("MaturePublish", self->childGetValue("mature_check").asBoolean());
gAgent.sendReliableMessage();
}
self->close();
}