Skip to content
Snippets Groups Projects
Commit db955093 authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

STORM-1691 WIP Visual fixes in the Postcard panel.

parent 438e0f02
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,7 @@ class LLPanelSnapshotPostcard ...@@ -75,6 +75,7 @@ class LLPanelSnapshotPostcard
void onSend(); void onSend();
bool mHasFirstMsgFocus; bool mHasFirstMsgFocus;
std::string mAgentEmail;
}; };
static LLRegisterPanelClassWrapper<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard"); static LLRegisterPanelClassWrapper<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard");
...@@ -95,8 +96,6 @@ BOOL LLPanelSnapshotPostcard::postBuild() ...@@ -95,8 +96,6 @@ BOOL LLPanelSnapshotPostcard::postBuild()
// pick up the user's up-to-date email address // pick up the user's up-to-date email address
gAgent.sendAgentUserInfoRequest(); gAgent.sendAgentUserInfoRequest();
getChildView("from_form")->setEnabled(FALSE);
std::string name_string; std::string name_string;
LLAgentUI::buildFullname(name_string); LLAgentUI::buildFullname(name_string);
getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string));
...@@ -128,12 +127,9 @@ S32 LLPanelSnapshotPostcard::notify(const LLSD& info) ...@@ -128,12 +127,9 @@ S32 LLPanelSnapshotPostcard::notify(const LLSD& info)
return 0; return 0;
} }
LLUICtrl* from_input = getChild<LLUICtrl>("from_form"); if (mAgentEmail.empty())
const std::string& text = from_input->getValue().asString();
if (text.empty())
{ {
// there's no text in this field yet, pre-populate mAgentEmail = info["agent-email"].asString();
from_input->setValue(info["agent-email"]);
} }
return 1; return 1;
...@@ -176,14 +172,13 @@ bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notificati ...@@ -176,14 +172,13 @@ bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notificati
void LLPanelSnapshotPostcard::sendPostcard() void LLPanelSnapshotPostcard::sendPostcard()
{ {
std::string from(getChild<LLUICtrl>("from_form")->getValue().asString());
std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); std::string to(getChild<LLUICtrl>("to_form")->getValue().asString());
std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString());
LLSD postcard = LLSD::emptyMap(); LLSD postcard = LLSD::emptyMap();
postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue(); postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue();
postcard["to"] = to; postcard["to"] = to;
postcard["from"] = from; postcard["from"] = mAgentEmail;
postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString(); postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString();
postcard["subject"] = subject; postcard["subject"] = subject;
postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString();
...@@ -246,7 +241,6 @@ void LLPanelSnapshotPostcard::onTabButtonPress(S32 btn_idx) ...@@ -246,7 +241,6 @@ void LLPanelSnapshotPostcard::onTabButtonPress(S32 btn_idx)
void LLPanelSnapshotPostcard::onSend() void LLPanelSnapshotPostcard::onSend()
{ {
// Validate input. // Validate input.
std::string from(getChild<LLUICtrl>("from_form")->getValue().asString());
std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); 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,})*"); 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,})*");
...@@ -257,7 +251,7 @@ void LLPanelSnapshotPostcard::onSend() ...@@ -257,7 +251,7 @@ void LLPanelSnapshotPostcard::onSend()
return; return;
} }
if (from.empty() || !boost::regex_match(from, email_format)) if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format))
{ {
LLNotificationsUtil::add("PromptSelfEmail"); LLNotificationsUtil::add("PromptSelfEmail");
return; return;
......
...@@ -116,13 +116,8 @@ LLPostCard::result_callback_t LLPostCard::mResultCallback; ...@@ -116,13 +116,8 @@ LLPostCard::result_callback_t LLPostCard::mResultCallback;
// static // static
void LLPostCard::send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data) void LLPostCard::send(LLPointer<LLImageFormatted> image, const LLSD& postcard_data)
{ {
#if 0
static LLTransactionID transaction_id;
static LLAssetID asset_id;
#else
LLTransactionID transaction_id; LLTransactionID transaction_id;
LLAssetID asset_id; LLAssetID asset_id;
#endif
transaction_id.generate(); transaction_id.generate();
asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID()); asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID());
......
...@@ -10,18 +10,20 @@ ...@@ -10,18 +10,20 @@
bottom="35" bottom="35"
follows="top|left" follows="top|left"
font="SansSerif" font="SansSerif"
height="16"
layout="topleft" layout="topleft"
left="12" left="12"
name="to_label" name="to_label"
top="10"> top="10"
Recipient&apos;s Email: width="60">
To:
</text> </text>
<line_editor <line_editor
control_name="LastPostcardRecipient" control_name="LastPostcardRecipient"
follows="left|top|right" follows="left|top|right"
height="20" height="20"
layout="topleft" layout="topleft"
left_delta="148" left_pad="10"
name="to_form" name="to_form"
right="-10" right="-10"
top_delta="-4" /> top_delta="-4" />
...@@ -31,35 +33,18 @@ ...@@ -31,35 +33,18 @@
bottom_delta="23" bottom_delta="23"
follows="top|left" follows="top|left"
font="SansSerif" font="SansSerif"
height="16"
layout="topleft" layout="topleft"
left="12" left="12"
name="from_label"> name="name_label"
Your Email: width="60">
From:
</text> </text>
<line_editor <line_editor
follows="left|top|right" follows="left|top|right"
height="20" height="20"
layout="topleft" layout="topleft"
left_delta="148" left_pad="10"
name="from_form"
right="-10"
top_delta="-4" />
<text
type="string"
length="1"
bottom_delta="23"
follows="top|left"
font="SansSerif"
layout="topleft"
left="12"
name="name_label">
Your Name:
</text>
<line_editor
follows="left|top|right"
height="20"
layout="topleft"
left_delta="148"
max_length_bytes="100" max_length_bytes="100"
name="name_form" name="name_form"
right="-10" right="-10"
...@@ -70,9 +55,11 @@ ...@@ -70,9 +55,11 @@
bottom_delta="23" bottom_delta="23"
follows="top|left" follows="top|left"
font="SansSerif" font="SansSerif"
height="16"
layout="topleft" layout="topleft"
left="12" left="12"
name="subject_label"> name="subject_label"
width="60">
Subject: Subject:
</text> </text>
<line_editor <line_editor
...@@ -80,7 +67,7 @@ ...@@ -80,7 +67,7 @@
height="20" height="20"
label="Type your subject here." label="Type your subject here."
layout="topleft" layout="topleft"
left_delta="148" left_pad="10"
max_length_bytes="100" max_length_bytes="100"
name="subject_form" name="subject_form"
right="-10" right="-10"
...@@ -89,11 +76,12 @@ ...@@ -89,11 +76,12 @@
type="string" type="string"
length="1" length="1"
bottom_delta="23" bottom_delta="23"
follows="top|left" follows="top|left|right"
font="SansSerif" font="SansSerif"
layout="topleft" layout="topleft"
left="12" left="12"
name="msg_label"> name="msg_label"
right="-10">
Message: Message:
</text> </text>
<text_editor <text_editor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment