From 1ed3117a6d3d40788245d2b28f2ed7a82380b4bb Mon Sep 17 00:00:00 2001 From: Kent Quirk Date: Fri, 26 Mar 2010 11:38:42 -0400 Subject: Backed out changeset 686628355e4a as it caused a crash. --- indra/newview/llchathistory.cpp | 16 ++++++++++++++++ indra/newview/llchathistory.h | 9 +++++++++ .../skins/default/xui/en/widgets/chat_history.xml | 1 + 3 files changed, 26 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 000fb62431..efdfbb8d20 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -447,6 +447,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLUICtrl(p), mMessageHeaderFilename(p.message_header), mMessageSeparatorFilename(p.message_separator), + mMessagePlaintextSeparatorFilename(p.message_plaintext_separator), mLeftTextPad(p.left_text_pad), mRightTextPad(p.right_text_pad), mLeftWidgetPad(p.left_widget_pad), @@ -534,6 +535,12 @@ LLView* LLChatHistory::getSeparator() return separator; } +LLView* LLChatHistory::getPlaintextSeparator() +{ + LLPanel* separator = LLUICtrlFactory::getInstance()->createFromFile(mMessagePlaintextSeparatorFilename, NULL, LLPanel::child_registry_t::instance()); + return separator; +} + LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params) { LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename); @@ -632,6 +639,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (use_plain_text_chat_history) { + // append plaintext separator + LLView* separator = getPlaintextSeparator(); + LLInlineViewSegment::Params p; + p.force_newline = true; + p.left_pad = mLeftWidgetPad; + p.right_pad = mRightWidgetPad; + p.view = separator; + mEditor->appendWidget(p, "\n", false); + mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params); if (utf8str_trim(chat.mFromName).size() != 0) diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index 950b32861b..dfe5ea98e6 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -47,6 +47,8 @@ class LLChatHistory : public LLUICtrl Optional message_header; //Message separator filename Optional message_separator; + //Message plaintext separator filename + Optional message_plaintext_separator; //Text left padding from the scroll rect Optional left_text_pad; //Text right padding from the scroll rect @@ -69,6 +71,7 @@ class LLChatHistory : public LLUICtrl Params() : message_header("message_header"), message_separator("message_separator"), + message_plaintext_separator("message_plaintext_separator"), left_text_pad("left_text_pad"), right_text_pad("right_text_pad"), left_widget_pad("left_widget_pad"), @@ -96,6 +99,11 @@ class LLChatHistory : public LLUICtrl * @return pointer to LLView separator object. */ LLView* getSeparator(); + /** + * Builds a message plaintext separator. + * @return pointer to LLView separator object. + */ + LLView* getPlaintextSeparator(); /** * Builds a message header. * @return pointer to LLView header object. @@ -133,6 +141,7 @@ class LLChatHistory : public LLUICtrl std::string mMessageHeaderFilename; std::string mMessageSeparatorFilename; + std::string mMessagePlaintextSeparatorFilename; S32 mLeftTextPad; S32 mRightTextPad; diff --git a/indra/newview/skins/default/xui/en/widgets/chat_history.xml b/indra/newview/skins/default/xui/en/widgets/chat_history.xml index ef885e8045..aa3ea736b8 100644 --- a/indra/newview/skins/default/xui/en/widgets/chat_history.xml +++ b/indra/newview/skins/default/xui/en/widgets/chat_history.xml @@ -2,6 +2,7 @@