From 3fdcb8751a1f36dbce9d7a3fd1d785160d356d3a Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 13 Apr 2012 23:31:01 +0300 Subject: CHUI-91 FIXED Moved block list to a separate People floater tab. --- indra/newview/llchathistory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index f530d10ddc..5bdfb5adbc 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -143,7 +143,8 @@ public: { LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); - LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD().with("blocked_to_select", getAvatarId())); + LLFloaterSidePanelContainer::showPanel("people", "panel_people", + LLSD().with("people_panel_tab_name", "blocked_panel").with("blocked_to_select", getAvatarId())); } } -- cgit v1.2.3 From f948ba82a985c2fec5ed1e65a55bd68f6e811197 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 4 May 2012 22:08:13 +0300 Subject: CHUI-103 WIP Added support for showing/hiding timestamp and names, replacing own name with (You) --- indra/newview/llchathistory.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5bdfb5adbc..143d4ff4fe 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -778,15 +778,19 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (use_plain_text_chat_history) { LLStyle::Params timestamp_style(style_params); - if (!message_from_log) + + if (args["show_time"].asBoolean()) { - LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); - timestamp_style.color(timestamp_color); - timestamp_style.readonly_color(timestamp_color); + if (!message_from_log) + { + LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); + timestamp_style.color(timestamp_color); + timestamp_style.readonly_color(timestamp_color); + } + mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, timestamp_style); } - mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, timestamp_style); - if (utf8str_trim(chat.mFromName).size() != 0) + if (args["show_names_in_p2p_chat"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) @@ -806,13 +810,21 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->appendText(chat.mFromName + delimiter, false, link_params); } - else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) + else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); + if (gAgentID == chat.mFromID) + { std::string localized_name; + bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); + mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, false, link_params); + } + else + { + // Add link to avatar's inspector and delimiter to message. + mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); + } } else { -- cgit v1.2.3 From 79928c65329146920558d9bc286f643ccf8dca7f Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 7 May 2012 20:05:07 +0300 Subject: CHUI-103 Repair drawing messages with prepend new line --- indra/newview/llchathistory.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 143d4ff4fe..30b2839547 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -775,10 +775,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL style_params.readonly_color(LLColor4::grey); } + mPrependNewLineState = (mEditor->getText().size() != 0)? 1 : 0; + if (use_plain_text_chat_history) { LLStyle::Params timestamp_style(style_params); + // timestams showing if (args["show_time"].asBoolean()) { if (!message_from_log) @@ -787,9 +790,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL timestamp_style.color(timestamp_color); timestamp_style.readonly_color(timestamp_color); } - mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, timestamp_style); + mEditor->appendText("[" + chat.mTimeStr + "] ", isNeedPrependNewline(), timestamp_style); } + // names showing if (args["show_names_in_p2p_chat"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. @@ -807,8 +811,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL link_params.is_link = true; link_params.link_href = url; - mEditor->appendText(chat.mFromName + delimiter, - false, link_params); + mEditor->appendText(chat.mFromName + delimiter, isNeedPrependNewline(), link_params); } else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { @@ -818,22 +821,26 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (gAgentID == chat.mFromID) { std::string localized_name; bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); - mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, false, link_params); + mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, + isNeedPrependNewline(), link_params); } else { // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); + mEditor->appendText(std::string(link_params.link_href) + delimiter, + isNeedPrependNewline(), link_params); } } else { - mEditor->appendText("" + chat.mFromName + "" + delimiter, false, style_params); + mEditor->appendText("" + chat.mFromName + "" + delimiter, + isNeedPrependNewline(), style_params); } } } else { + mPrependNewLineState = 0; LLView* view = NULL; LLInlineViewSegment::Params p; p.force_newline = true; @@ -956,7 +963,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message = chat.mFromName + message; } - mEditor->appendText(message, FALSE, style_params); + mEditor->appendText(message, isNeedPrependNewline(), style_params); } mEditor->blockUndo(); -- cgit v1.2.3 From 7b8251fd2f169136fc45e4c17104da676f75727b Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 7 May 2012 21:54:09 +0300 Subject: CHUI-103 WIP Added settings for switching text view mode --- indra/newview/llchathistory.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 30b2839547..b70e98f22b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -775,7 +775,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL style_params.readonly_color(LLColor4::grey); } - mPrependNewLineState = (mEditor->getText().size() != 0)? 1 : 0; + bool prependNewLineState = mEditor->getText().size() != 0; if (use_plain_text_chat_history) { @@ -790,11 +790,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL timestamp_style.color(timestamp_color); timestamp_style.readonly_color(timestamp_color); } - mEditor->appendText("[" + chat.mTimeStr + "] ", isNeedPrependNewline(), timestamp_style); + mEditor->appendText("[" + chat.mTimeStr + "] ", prependNewLineState, timestamp_style); + prependNewLineState = false; } // names showing - if (args["show_names_in_p2p_chat"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) + if (args["show_names_for_p2p_conv"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) @@ -811,7 +812,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL link_params.is_link = true; link_params.link_href = url; - mEditor->appendText(chat.mFromName + delimiter, isNeedPrependNewline(), link_params); + mEditor->appendText(chat.mFromName + delimiter, prependNewLineState, link_params); + prependNewLineState = false; } else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { @@ -822,25 +824,28 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL { std::string localized_name; bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, - isNeedPrependNewline(), link_params); + prependNewLineState, link_params); + prependNewLineState = false; } else { // Add link to avatar's inspector and delimiter to message. mEditor->appendText(std::string(link_params.link_href) + delimiter, - isNeedPrependNewline(), link_params); + prependNewLineState, link_params); + prependNewLineState = false; } } else { mEditor->appendText("" + chat.mFromName + "" + delimiter, - isNeedPrependNewline(), style_params); + prependNewLineState, style_params); + prependNewLineState = false; } } } else { - mPrependNewLineState = 0; + prependNewLineState = 0; LLView* view = NULL; LLInlineViewSegment::Params p; p.force_newline = true; @@ -963,7 +968,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message = chat.mFromName + message; } - mEditor->appendText(message, isNeedPrependNewline(), style_params); + mEditor->appendText(message, prependNewLineState, style_params); + prependNewLineState = false; } mEditor->blockUndo(); -- cgit v1.2.3 From df58153514f6b361c65efc5dd6d31d39f68603c0 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 14 May 2012 15:44:57 +0300 Subject: CHUI-113 WIP all voice controls is moved from a IM-control panel to the IM floater; IMControlPanel is removed; simplified voice button's listener behavior --- indra/newview/llchathistory.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index b70e98f22b..3214c95600 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -700,9 +700,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL return; } + bool from_me = chat.mFromID == gAgent.getID(); mEditor->setPlainText(use_plain_text_chat_history); - if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty()) + if (!mEditor->scrolledToEnd() && !from_me && !chat.mFromName.empty()) { mUnreadChatSources.insert(chat.mFromName); mMoreChatPanel->setVisible(TRUE); @@ -777,6 +778,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL bool prependNewLineState = mEditor->getText().size() != 0; + // show timestamps and names in the compact mode if (use_plain_text_chat_history) { LLStyle::Params timestamp_style(style_params); @@ -820,7 +822,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - if (gAgentID == chat.mFromID) + if (from_me) { std::string localized_name; bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, @@ -843,9 +845,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } } } - else + else // showing timestamp and name in the expanded mode { - prependNewLineState = 0; + prependNewLineState = false; LLView* view = NULL; LLInlineViewSegment::Params p; p.force_newline = true; @@ -953,7 +955,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL //MESSAGE TEXT PROCESSING //*HACK getting rid of redundant sender names in system notifications sent using sender name (see EXT-5010) - if (use_plain_text_chat_history && gAgentID != chat.mFromID && chat.mFromID.notNull()) + if (use_plain_text_chat_history && !from_me && chat.mFromID.notNull()) { std::string slurl_about = SLURL_APP_AGENT + chat.mFromID.asString() + SLURL_ABOUT; if (message.length() > slurl_about.length() && @@ -975,7 +977,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->blockUndo(); // automatically scroll to end when receiving chat from myself - if (chat.mFromID == gAgentID) + if (from_me) { mEditor->setCursorAndScrollToEnd(); } -- cgit v1.2.3 From 296e55c1b323c05b6544b69ace04afe19102396b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 18 May 2012 13:20:32 -0700 Subject: CHUI-112 FIX Clicking Show or Discard in an inventory offer toast does not dismiss toast removed special case logic for dealing with user online/offline collisions added ability to cancel old duplicate notifications --- indra/newview/llchathistory.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5bdfb5adbc..3da868945b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -877,35 +877,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (notification != NULL) { LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( - notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history); - //we can't set follows in xml since it broke toasts behavior - notify_box->setFollowsLeft(); - notify_box->setFollowsRight(); - notify_box->setFollowsTop(); - - ctrl_list_t ctrls = notify_box->getControlPanel()->getCtrlList(); - S32 offset = 0; - // Children were added by addChild() which uses push_front to insert them into list, - // so to get buttons in correct order reverse iterator is used (EXT-5906) - for (ctrl_list_t::reverse_iterator it = ctrls.rbegin(); it != ctrls.rend(); it++) - { - LLButton * button = dynamic_cast (*it); - if (button != NULL) - { - button->setOrigin( offset, - button->getRect().mBottom); - button->setLeftHPad(2 * HPAD); - button->setRightHPad(2 * HPAD); - // set zero width before perform autoResize() - button->setRect(LLRect(button->getRect().mLeft, - button->getRect().mTop, button->getRect().mLeft, - button->getRect().mBottom)); - button->setAutoResize(true); - button->autoResize(); - offset += HPAD + button->getRect().getWidth(); - button->setFollowsNone(); - } - } + notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history, mEditor); //Prepare the rect for the view LLRect target_rect = mEditor->getDocumentView()->getRect(); -- cgit v1.2.3 From 164e1073952060cf88a163945d6745934db62620 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 5 Jun 2012 18:20:01 +0300 Subject: CHUI-103 Added square brackets to a messages from Second Life in the plain text mode; changed the default colors of user's messages --- indra/newview/llchathistory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index c514261b60..cfc70a1b0e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -693,6 +693,7 @@ void LLChatHistory::clear() void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params) { bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); + bool square_brackets = false; // square brackets necessary for a system messages llassert(mEditor); if (!mEditor) @@ -781,6 +782,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // show timestamps and names in the compact mode if (use_plain_text_chat_history) { + square_brackets = chat.mFromName == SYSTEM_FROM; + LLStyle::Params timestamp_style(style_params); // timestams showing @@ -942,6 +945,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message = chat.mFromName + message; } + if (square_brackets) + { + message = "[" + message + "]"; + } + mEditor->appendText(message, prependNewLineState, style_params); prependNewLineState = false; } -- cgit v1.2.3 From 33adfe09474c58075d58feff1fc34e24503d3e80 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 8 Jun 2012 19:51:56 +0300 Subject: CHUI-103 FIXED Added a square brackets to system messages; changed a default color for user messages --- indra/newview/llchathistory.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cfc70a1b0e..dcd6d25888 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -737,7 +737,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); + LLStyle::Params style_params; style_params.color(txt_color); style_params.readonly_color(txt_color); @@ -773,8 +774,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // We graying out chat history by graying out messages that contains full date in a time string if (message_from_log) { - style_params.color(LLColor4::grey); - style_params.readonly_color(LLColor4::grey); + txt_color = LLColor4::grey; + style_params.color(txt_color); + style_params.readonly_color(txt_color); } bool prependNewLineState = mEditor->getText().size() != 0; @@ -786,7 +788,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params timestamp_style(style_params); - // timestams showing + // out of the timestamp if (args["show_time"].asBoolean()) { if (!message_from_log) @@ -799,6 +801,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState = false; } + // out the opening square bracket (if need) + if (square_brackets) + { + mEditor->appendText("[", prependNewLineState, style_params); + prependNewLineState = false; + } + // names showing if (args["show_names_for_p2p_conv"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { @@ -947,7 +956,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (square_brackets) { - message = "[" + message + "]"; + message += "]"; } mEditor->appendText(message, prependNewLineState, style_params); -- cgit v1.2.3 From 38eb726ca8ecbc52f9afe2181474074a8bc59211 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 2 Jul 2012 15:27:19 +0300 Subject: CHUI-103 FIXED (Implement changes to compact chat view) Change coloration --- indra/newview/llchathistory.cpp | 47 ++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index dcd6d25888..80be753d9e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -734,17 +734,23 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLColor4 name_color(txt_color); + LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); std::string font_name = LLFontGL::nameFromFont(fontp); std::string font_size = LLFontGL::sizeFromFont(fontp); - LLStyle::Params style_params; - style_params.color(txt_color); - style_params.readonly_color(txt_color); - style_params.font.name(font_name); - style_params.font.size(font_size); - style_params.font.style(input_append_params.font.style); + LLStyle::Params body_message_params; + body_message_params.color(txt_color); + body_message_params.readonly_color(txt_color); + body_message_params.font.name(font_name); + body_message_params.font.size(font_size); + body_message_params.font.style(input_append_params.font.style); + + LLStyle::Params name_params(body_message_params); + name_params.color(name_color); + name_params.readonly_color(name_color); std::string prefix = chat.mText.substr(0, 4); @@ -767,7 +773,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) { delimiter = LLStringUtil::null; - style_params.font.style = "ITALIC"; + name_params.font.style = "ITALIC"; } bool message_from_log = chat.mChatStyle == CHAT_STYLE_HISTORY; @@ -775,18 +781,20 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (message_from_log) { txt_color = LLColor4::grey; - style_params.color(txt_color); - style_params.readonly_color(txt_color); + body_message_params.color(txt_color); + body_message_params.readonly_color(txt_color); + name_params.color(txt_color); + name_params.readonly_color(txt_color); } bool prependNewLineState = mEditor->getText().size() != 0; - // show timestamps and names in the compact mode + // compact mode: show a timestamp and name if (use_plain_text_chat_history) { square_brackets = chat.mFromName == SYSTEM_FROM; - LLStyle::Params timestamp_style(style_params); + LLStyle::Params timestamp_style(body_message_params); // out of the timestamp if (args["show_time"].asBoolean()) @@ -804,7 +812,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // out the opening square bracket (if need) if (square_brackets) { - mEditor->appendText("[", prependNewLineState, style_params); + mEditor->appendText("[", prependNewLineState, body_message_params); prependNewLineState = false; } @@ -819,7 +827,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // set the link for the object name to be the objectim SLapp // (don't let object names with hyperlinks override our objectim Url) - LLStyle::Params link_params(style_params); + LLStyle::Params link_params(body_message_params); LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); link_params.color = link_color; link_params.readonly_color = link_color; @@ -831,7 +839,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { - LLStyle::Params link_params(style_params); + LLStyle::Params link_params(body_message_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); if (from_me) @@ -852,7 +860,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL else { mEditor->appendText("" + chat.mFromName + "" + delimiter, - prependNewLineState, style_params); + prependNewLineState, body_message_params); prependNewLineState = false; } } @@ -880,7 +888,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } else { - view = getHeader(chat, style_params, args); + view = getHeader(chat, name_params, args); if (mEditor->getText().size() == 0) p.top_pad = 0; else @@ -909,6 +917,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mIsLastMessageFromLog = message_from_log; } + // body of the message processing + + // notify processing if (chat.mNotifId.notNull()) { LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); @@ -932,6 +943,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->appendWidget(params, "\n", false); } } + + // usual messages showing else { std::string message = irc_me ? chat.mText.substr(3) : chat.mText; @@ -959,7 +972,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message += "]"; } - mEditor->appendText(message, prependNewLineState, style_params); + mEditor->appendText(message, prependNewLineState, body_message_params); prependNewLineState = false; } -- cgit v1.2.3 From 1a913365b594de81de56896a9fbdfd6d8c4f21e0 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 6 Sep 2012 23:08:10 +0300 Subject: CHUI-319 FIXED ("User has said something new" text shown when navigating chat history with More History button) - Added flag to chat history whether to show notification about unread messages or not --- indra/newview/llchathistory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index e3d57ab7ae..3636f9e9d2 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -585,7 +585,8 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mBottomSeparatorPad(p.bottom_separator_pad), mTopHeaderPad(p.top_header_pad), mBottomHeaderPad(p.bottom_header_pad), - mIsLastMessageFromLog(false) + mIsLastMessageFromLog(false), + mNotifyAboutUnreadMsg(p.notify_unread_msg) { LLTextEditor::Params editor_params(p); editor_params.rect = getLocalRect(); @@ -707,7 +708,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL bool from_me = chat.mFromID == gAgent.getID(); mEditor->setPlainText(use_plain_text_chat_history); - if (!mEditor->scrolledToEnd() && !from_me && !chat.mFromName.empty()) + if (mNotifyAboutUnreadMsg && !mEditor->scrolledToEnd() && !from_me && !chat.mFromName.empty()) { mUnreadChatSources.insert(chat.mFromName); mMoreChatPanel->setVisible(TRUE); -- cgit v1.2.3 From 48c7e2cee70996048b0974c6cdda67cdea11a32c Mon Sep 17 00:00:00 2001 From: "Jeff (Gioffredo Linden)" Date: Fri, 12 Oct 2012 18:14:57 -0400 Subject: Expose Chat history to VITA by adding getValue method to llchathistory object --- indra/newview/llchathistory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3636f9e9d2..deb658c489 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -596,6 +596,14 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mEditor = LLUICtrlFactory::create(editor_params, this); } +LLSD LLChatHistory::getValue() +{ + LLSD* text=new LLSD(); + text->assign(mEditor->getText()); + return *text; + +} + LLChatHistory::~LLChatHistory() { this->clear(); -- cgit v1.2.3 From 337cd3aa9d8a8beaebd35ec6b53f09709e35a4d4 Mon Sep 17 00:00:00 2001 From: "Jeff (Gioffredo Linden)" Date: Tue, 16 Oct 2012 15:22:42 -0400 Subject: Make getValue const to fix Windows builds - and be more robust --- indra/newview/llchathistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index deb658c489..821d1f4685 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -596,7 +596,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mEditor = LLUICtrlFactory::create(editor_params, this); } -LLSD LLChatHistory::getValue() +const LLSD LLChatHistory::getValue() { LLSD* text=new LLSD(); text->assign(mEditor->getText()); -- cgit v1.2.3 From 86c3a45b6749387991064df6a42b1d046bd9d4d8 Mon Sep 17 00:00:00 2001 From: "Jeff (Gioffredo Linden)" Date: Tue, 16 Oct 2012 16:08:25 -0400 Subject: Move const kw location --- indra/newview/llchathistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 821d1f4685..c61a8c8562 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -596,7 +596,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) mEditor = LLUICtrlFactory::create(editor_params, this); } -const LLSD LLChatHistory::getValue() +LLSD LLChatHistory::getValue() const { LLSD* text=new LLSD(); text->assign(mEditor->getText()); -- cgit v1.2.3 From 6e2b3527cc95b92bf136b65fd2ee344d4c879faa Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Fri, 2 Nov 2012 13:22:48 -0700 Subject: CHUI-475: Ensuring that objects that query the avatar name cache with a callback store the connection and disconnect on object destruction. This should help resolve some of the heap corruption we are seeing. --- indra/newview/llchathistory.cpp | 80 ++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 28 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index c61a8c8562..605e3ece51 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -28,6 +28,8 @@ #include "llchathistory.h" +#include + #include "llavatarnamecache.h" #include "llinstantmessage.h" @@ -110,7 +112,8 @@ public: mFrom(), mSessionID(), mMinUserNameWidth(0), - mUserNameFont(NULL) + mUserNameFont(NULL), + mAvatarNameCacheConnection() {} static LLChatHistoryHeader* createInstance(const std::string& file_name) @@ -124,6 +127,11 @@ public: { // Detach the info button so that it doesn't get destroyed (EXT-8463). hideInfoCtrl(); + + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } } BOOL handleMouseUp(S32 x, S32 y, MASK mask) @@ -283,8 +291,7 @@ public: // Start with blank so sample data from XUI XML doesn't // flash on the screen user_name->setValue( LLSD() ); - LLAvatarNameCache::get(mAvatarID, - boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); + fetchAvatarName(); } else if (chat.mChatStyle == CHAT_STYLE_HISTORY || mSourceType == CHAT_SOURCE_AGENT) @@ -416,31 +423,6 @@ public: } } - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) - { - mFrom = av_name.mDisplayName; - - LLTextBox* user_name = getChild("user_name"); - user_name->setValue( LLSD(av_name.mDisplayName ) ); - user_name->setToolTip( av_name.mUsername ); - - if (gSavedSettings.getBOOL("NameTagShowUsernames") && - LLAvatarNameCache::useDisplayNames() && - !av_name.mIsDisplayNameDefault) - { - LLStyle::Params style_params_name; - LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); - style_params_name.color(userNameColor); - style_params_name.font.name("SansSerifSmall"); - style_params_name.font.style("NORMAL"); - style_params_name.readonly_color(userNameColor); - user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name); - } - setToolTip( av_name.mUsername ); - // name might have changed, update width - updateMinUserNameWidth(); - } - protected: static const S32 PADDING = 20; @@ -555,6 +537,45 @@ private: user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight()); } + void fetchAvatarName() + { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } + + if (mAvatarID.notNull()) + { + mAvatarNameCacheConnection = LLAvatarNameCache::get(mAvatarID, + boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); + } + } + + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) + { + mFrom = av_name.mDisplayName; + + LLTextBox* user_name = getChild("user_name"); + user_name->setValue( LLSD(av_name.mDisplayName ) ); + user_name->setToolTip( av_name.mUsername ); + + if (gSavedSettings.getBOOL("NameTagShowUsernames") && + LLAvatarNameCache::useDisplayNames() && + !av_name.mIsDisplayNameDefault) + { + LLStyle::Params style_params_name; + LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); + style_params_name.color(userNameColor); + style_params_name.font.name("SansSerifSmall"); + style_params_name.font.style("NORMAL"); + style_params_name.readonly_color(userNameColor); + user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name); + } + setToolTip( av_name.mUsername ); + // name might have changed, update width + updateMinUserNameWidth(); + } + protected: LLHandle mPopupMenuHandleAvatar; LLHandle mPopupMenuHandleObject; @@ -569,6 +590,9 @@ protected: S32 mMinUserNameWidth; const LLFontGL* mUserNameFont; + +private: + boost::signals2::connection mAvatarNameCacheConnection; }; LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; -- cgit v1.2.3 From 0cb67ec3762c1f1671fd01e331fe64a210098fd2 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 19 Nov 2012 07:42:39 +0200 Subject: CHUI-423 (User typing /me something in chat does not show correctly in italics on outgoing or incoming chat) --- indra/newview/llchathistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 605e3ece51..a33bd88273 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -809,7 +809,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) { delimiter = LLStringUtil::null; - name_params.font.style = "ITALIC"; + body_message_params.font.style = "ITALIC"; } bool message_from_log = chat.mChatStyle == CHAT_STYLE_HISTORY; -- cgit v1.2.3 From 3a49beed0e96a797a6d663bcae5e932437ca3661 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Dec 2012 20:25:46 -0800 Subject: CHUI-580 : WIP : Change the display name cache system, deprecating the old protocol and using the cap (People API) whenever available. Still has occurence of Resident as last name to clean up. --- indra/newview/llchathistory.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a33bd88273..3e25d9c457 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -553,15 +553,15 @@ private: void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { - mFrom = av_name.mDisplayName; + mFrom = av_name.getDisplayName(); LLTextBox* user_name = getChild("user_name"); - user_name->setValue( LLSD(av_name.mDisplayName ) ); - user_name->setToolTip( av_name.mUsername ); + user_name->setValue( LLSD(av_name.getDisplayName() ) ); + user_name->setToolTip( av_name.getUserName() ); if (gSavedSettings.getBOOL("NameTagShowUsernames") && - LLAvatarNameCache::useDisplayNames() && - !av_name.mIsDisplayNameDefault) + av_name.useDisplayNames() && + !av_name.isDisplayNameDefault()) { LLStyle::Params style_params_name; LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); @@ -569,9 +569,9 @@ private: style_params_name.font.name("SansSerifSmall"); style_params_name.font.style("NORMAL"); style_params_name.readonly_color(userNameColor); - user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name); + user_name->appendText(" - " + av_name.getUserName(), FALSE, style_params_name); } - setToolTip( av_name.mUsername ); + setToolTip( av_name.getUserName() ); // name might have changed, update width updateMinUserNameWidth(); } -- cgit v1.2.3 From 6fe7144104cd8b5bd9c7d215f76afdeafe13b7ee Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 17 Dec 2012 18:59:01 -0800 Subject: CHUI-580 : WIP : Protect callback connections passed to LLAvatarNameCache::get() where necessary --- indra/newview/llchathistory.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3e25d9c457..764ee4a8ea 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -539,13 +539,12 @@ private: void fetchAvatarName() { - if (mAvatarNameCacheConnection.connected()) - { - mAvatarNameCacheConnection.disconnect(); - } - if (mAvatarID.notNull()) { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } mAvatarNameCacheConnection = LLAvatarNameCache::get(mAvatarID, boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); } -- cgit v1.2.3 From c2d332a89cb29d54df40f1f120304d871278fb76 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 17 Dec 2012 20:16:33 -0800 Subject: CHUI-580 : WIP : Added disconnect of callbacks once they're called to prevent filling up the callback queue --- indra/newview/llchathistory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 764ee4a8ea..3f959c0510 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -552,6 +552,8 @@ private: void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { + mAvatarNameCacheConnection.disconnect(); + mFrom = av_name.getDisplayName(); LLTextBox* user_name = getChild("user_name"); -- cgit v1.2.3