void LLFloaterPostcard::missingSubjMsgAlertCallback(S32 option, void* data) { if(data) { LLFloaterPostcard* self = static_cast<LLFloaterPostcard*>(data); if(0 == option) { // User clicked OK if((self->childGetValue("subject_form").asString()).empty()) { // Stuff the subject back into the form. self->childSetValue("subject_form", self->childGetText("default_subject")); } if(!self->mHasFirstMsgFocus) { // The user never switched focus to the messagee window. // Using the default string. self->childSetValue("msg_form", self->childGetText("default_message")); } self->sendPostcard(); } } }
// static void LLFloaterPostcard::updateUserInfo(const std::string& email) { for (instance_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter) { LLFloaterPostcard *instance = *iter; const std::string& text = instance->childGetValue("from_form").asString(); if (text.empty()) { // there's no text in this field yet, pre-populate instance->childSetValue("from_form", LLSD(email)); } } }
// static void LLFloaterPostcard::updateUserInfo(const char *email) { LLFloaterPostcard *instance; sInstances.resetList(); while ((instance = sInstances.getNextData())) { const LLString& text = instance->childGetValue("from_form").asString(); if (text.empty()) { // there's no text in this field yet, pre-populate instance->childSetValue("from_form", LLSD(email)); } } }