bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { // User clicked OK if((childGetValue("subject_form").asString()).empty()) { // Stuff the subject back into the form. LLStringUtil::format_map_t targs; targs["[SECOND_LIFE]"] = LLTrans::getString("SECOND_LIFE"); std::string subj = getString("default_subject"); LLStringUtil::format(subj, targs); childSetValue("subject_form", subj); } if(!mHasFirstMsgFocus) { // The user never switched focus to the messagee window. // Using the default string. childSetValue("msg_form", getString("default_message")); } sendPostcard(); } return false; }
void LLPanelSnapshotPostcard::onSend() { // Validate input. std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); if (to.empty() || !boost::regex_match(to, email_format)) { LLNotificationsUtil::add("PromptRecipientEmail"); return; } if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format)) { LLNotificationsUtil::add("PromptSelfEmail"); return; } std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); if(subject.empty() || !mHasFirstMsgFocus) { LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2)); return; } // Send postcard. sendPostcard(); }
bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(0 == option) { // User clicked OK if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty()) { // Stuff the subject back into the form. getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject")); } if(!mHasFirstMsgFocus) { // The user never switched focus to the messagee window. // Using the default string. getChild<LLUICtrl>("msg_form")->setValue(getString("default_message")); } sendPostcard(); } return false; }