diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-09-07 22:55:07 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-09-07 22:55:07 +0000 |
commit | 79653dfed48105019b8ecca9cf4bfaa2a390e100 (patch) | |
tree | 455943795bf3371bbff0689604cf5eedd903fae4 /indra/newview/lltoastgroupnotifypanel.cpp | |
parent | a9b2296b2b5664cfc8d86c7f99c00c10268e250a (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1566 https://svn.aws.productengine.com/secondlife/pe/stable-2@1580 -> viewer-2.0.0-3
* Bugs: EXT-807 EXT-810 EXT-811 EXT-784 EXT-820 EXT-393 EXT-826 EXT-811 EXT-801 EXT-808 EXT-393 EXT-743 EXT-699 EXT-397 EXT-812 EXT-736 EXT-744 EXT-809 EXT-306 EXT-854 EXT-857 EXT-790
* New Dev: EXT-694 EXT-393 EXT-367 EXT-819 EXT-795 EXT-827 EXT-788
* EXT-272 - Draggable Landmarks
* EXT-715 - Block List Panel
* EXT-782 - Implement advanced place information accordions
Diffstat (limited to 'indra/newview/lltoastgroupnotifypanel.cpp')
-rw-r--r-- | indra/newview/lltoastgroupnotifypanel.cpp | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 6f26b4077c..6f373a74bd 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -40,7 +40,7 @@ #include "lliconctrl.h" #include "llnotify.h" #include "lltextbox.h" -#include "lltexteditor.h" + #include "lluiconstants.h" #include "llui.h" #include "llviewercontrol.h" @@ -53,6 +53,8 @@ #include "llfloaterinventory.h" #include "llinventorytype.h" +const S32 LLToastGroupNotifyPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 4; + LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification) : LLToastPanel(notification), mInventoryOffer(NULL) @@ -65,8 +67,6 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification llwarns << "Group notice for unkown group: " << payload["group_id"].asUUID() << llendl; } - static const LLUIColor textColor = LLUIColorTable::instance().getColor("GroupNotifyTextColor"); - //group icon LLIconCtrl* pGroupIcon = getChild<LLIconCtrl>("group_icon", TRUE); pGroupIcon->setValue(groupData.mInsigniaID); @@ -78,23 +78,16 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification LLTextBox* pTitleText = getChild<LLTextBox>("title"); pTitleText->setValue(from.str()); - //message body + //message subject const std::string& subject = payload["subject"].asString(); + //message body const std::string& message = payload["message"].asString(); - LLTextEditor* pMessageText = getChild<LLTextEditor>("message"); - pMessageText->setValue(""); - pMessageText->setEnabled(FALSE); - LLStyle::Params date_style; - date_style.color = textColor; - date_style.font.name = "SANSSERIF"; - - LLStyle::Params header_style_params; - header_style_params.color = textColor; - header_style_params.font = LLFontGL::getFontSansSerifBig(); - pMessageText->appendStyledText(subject + "\n",false,false,header_style_params); + LLTextBox* pSubjectText = getChild<LLTextBox>("subject"); + pSubjectText->setValue(subject); + LLTextBox* pDateTimeText = getChild<LLTextBox>("datetime"); std::string timeStr = "["+LLTrans::getString("UTCTimeWeek")+"],[" +LLTrans::getString("UTCTimeDay")+"] [" +LLTrans::getString("UTCTimeMth")+"] [" @@ -108,25 +101,38 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification LLSD substitution; substitution["datetime"] = (S32) notice_date.secondsSinceEpoch(); LLStringUtil::format(timeStr, substitution); - LLStyle::Params date_style_params; - date_style_params.color = textColor; - date_style_params.font = LLFontGL::getFontMonospace(); - pMessageText->appendStyledText(timeStr, false, false, date_style); - pMessageText->appendColoredText(std::string("\n\n") + message, false, - false, textColor); + pDateTimeText->setValue(timeStr); + + LLTextBox* pMessageText = getChild<LLTextBox>("message"); + + //If message is empty let it be invisible and not take place at the panel + if(message.size() != 0) + { + pMessageText->setVisible(TRUE); + pMessageText->setValue(message); + } + else + { + pMessageText->setVisible(FALSE); + } //attachment BOOL hasInventory = payload["inventory_offer"].isDefined(); + + //attachment text LLTextBox * pAttachLink = getChild<LLTextBox>("attachment"); + //attachment icon + LLIconCtrl* pAttachIcon = getChild<LLIconCtrl>("attachment_icon", TRUE); + + //If attachment is empty let it be invisible and not take place at the panel pAttachLink->setVisible(hasInventory); + pAttachIcon->setVisible(hasInventory); if (hasInventory) { pAttachLink->setValue(payload["inventory_name"]); mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]); childSetActionTextbox("attachment", boost::bind( &LLToastGroupNotifyPanel::onClickAttachment, this)); - //attachment icon - LLIconCtrl* pAttachIcon = getChild<LLIconCtrl>("attachment_icon", TRUE); LLUIImagePtr attachIconImg = get_item_icon(mInventoryOffer->mType, LLInventoryType::IT_TEXTURE, 0, FALSE); @@ -137,8 +143,15 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification LLButton* pOkBtn = getChild<LLButton>("btn_ok"); pOkBtn->setClickedCallback((boost::bind(&LLToastGroupNotifyPanel::onClickOk, this))); setDefaultBtn(pOkBtn); -} + S32 maxLinesCount; + std::istringstream ss( getString("message_max_lines_count") ); + if (!(ss >> maxLinesCount)) + { + maxLinesCount = DEFAULT_MESSAGE_MAX_LINE_COUNT; + } + snapToMessageHeight(pMessageText, maxLinesCount); +} // virtual LLToastGroupNotifyPanel::~LLToastGroupNotifyPanel() |