From 2afc64e6fa8aa0ee41290c8232733881026cab10 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 13:08:02 +0200 Subject: Fixed Normal bug EXT-1959 - [BSI] emotes difficult to see in IM/Group chat --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2ccd6b7d35..056f2ee333 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -370,8 +370,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty appendWidget(p, view_text, false); //Append the text message - std::string message = chat.mText + '\n'; - appendText(message, FALSE, style_params); + appendText(chat.mText, FALSE, style_params); mLastFromName = chat.mFromName; blockUndo(); -- cgit v1.2.3 From 249af0bf9d24da0f6dc3fb1348c12fcbe543ca87 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 15:08:49 +0200 Subject: Fixed normal bug EXT-2131-[BSI] Copy/pasted text chat logs are now much harder to read or post-process --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 056f2ee333..289c8cca5a 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -47,7 +47,6 @@ #include "llmutelist.h" static LLDefaultChildRegistry::Register r("chat_history"); -static const std::string MESSAGE_USERNAME_DATE_SEPARATOR(" ----- "); std::string formatCurrentTime() { @@ -333,7 +332,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat) void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; - std::string view_text; + std::string view_text = '[' + formatCurrentTime() + "]:[" + chat.mFromName + "] ";; LLInlineViewSegment::Params p; p.force_newline = true; @@ -343,14 +342,12 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty if (mLastFromName == chat.mFromName) { view = getSeparator(); - view_text = "\n"; p.top_pad = mTopSeparatorPad; p.bottom_pad = mBottomSeparatorPad; } else { view = getHeader(chat); - view_text = chat.mFromName + MESSAGE_USERNAME_DATE_SEPARATOR + formatCurrentTime() + '\n'; if (getText().size() == 0) p.top_pad = 0; else -- cgit v1.2.3 From 7123f0d447c39c0f81936eef8867b8ff3cc9cda8 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 15:27:42 +0200 Subject: Additional fix for normal bug EXT-2131-[BSI] Copy/pasted text chat logs are now much harder to read or post-process --HG-- branch : product-engine --- 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 289c8cca5a..3b893aa529 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -332,7 +332,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat) void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; - std::string view_text = '[' + formatCurrentTime() + "]:[" + chat.mFromName + "] ";; + std::string view_text = "\n[" + formatCurrentTime() + "]:[" + chat.mFromName + "] ";; LLInlineViewSegment::Params p; p.force_newline = true; -- cgit v1.2.3 From 5ca8c5f61d3ee507955924e45a0201c70d9ab58b Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 15:48:55 +0200 Subject: Fixed normal bug EXT-2166-[BSI] Nearby Chat floater always jumps to most recent chat --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3b893aa529..6cdec469dc 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -371,5 +371,4 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty mLastFromName = chat.mFromName; blockUndo(); - setCursorAndScrollToEnd(); } -- cgit v1.2.3 From 8523d2d5b641cb5b0e4557237700065bd24daf83 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Wed, 11 Nov 2009 17:05:36 +0200 Subject: fix for normal bug EXT-2303 Distinguish Object-generated Nearby Chat from other Nearby Chat --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 3b893aa529..b452f5bc1a 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -174,7 +174,7 @@ public: const std::string& getFirstName() const { return mFirstName; } const std::string& getLastName () const { return mLastName; } - void setup(const LLChat& chat) + void setup(const LLChat& chat,const LLStyle::Params& style_params) { mAvatarID = chat.mFromID; mSourceType = chat.mSourceType; @@ -184,8 +184,11 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextBox* userName = getChild("user_name"); + + LLUIColor color = style_params.color; + userName->setReadOnlyColor(color); + userName->setColor(color); if(!chat.mFromName.empty()) { @@ -197,6 +200,7 @@ public: std::string SL = LLTrans::getString("SECOND_LIFE"); userName->setValue(SL); } + LLTextBox* timeBox = getChild("time_box"); timeBox->setValue(formatCurrentTime()); @@ -322,10 +326,10 @@ LLView* LLChatHistory::getSeparator() return separator; } -LLView* LLChatHistory::getHeader(const LLChat& chat) +LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params) { LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename); - header->setup(chat); + header->setup(chat,style_params); return header; } @@ -347,7 +351,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty } else { - view = getHeader(chat); + view = getHeader(chat,style_params); if (getText().size() == 0) p.top_pad = 0; else -- cgit v1.2.3 From 196e350629fb258acb8c0d784fdcfd50866b92ef Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 11 Nov 2009 19:26:19 +0200 Subject: Additional fix for EXT-2137-[BSI] Copy/pasted text chat logs are now much harder to read or post-process. --HG-- branch : product-engine --- 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 b7cd41cf6c..d1922cfd6e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -336,7 +336,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; - std::string view_text = "\n[" + formatCurrentTime() + "]:[" + chat.mFromName + "] ";; + std::string view_text = "\n[" + formatCurrentTime() + "] " + chat.mFromName + ": "; LLInlineViewSegment::Params p; p.force_newline = true; -- cgit v1.2.3 From 11fc2da6fa5fba0bb659dd97f8533e4529aece06 Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 12 Nov 2009 21:20:18 +0800 Subject: make color and font affecting both nearby chat and toasts --- indra/newview/llchathistory.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2ccd6b7d35..cc014e3c28 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -330,7 +330,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat) return header; } -void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) +void LLChatHistory::appendWidgetMessage(const LLChat& chat) { LLView* view = NULL; std::string view_text; @@ -370,7 +370,17 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty appendWidget(p, view_text, false); //Append the text message + + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + std::string message = chat.mText + '\n'; + + LLStyle::Params style_params; + style_params.color(txt_color); + style_params.font(fontp); + appendText(message, FALSE, style_params); mLastFromName = chat.mFromName; -- cgit v1.2.3 From b4a3b65a602ad56baf761a8426093eda585bc572 Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 12 Nov 2009 23:02:41 +0800 Subject: fix merge error --- indra/newview/llchathistory.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 6d8d11ad2b..2b050f3eb5 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -338,11 +338,22 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) LLView* view = NULL; std::string view_text = "\n[" + formatCurrentTime() + "] " + chat.mFromName + ": "; + LLInlineViewSegment::Params p; p.force_newline = true; p.left_pad = mLeftWidgetPad; p.right_pad = mRightWidgetPad; + + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + + LLStyle::Params style_params; + style_params.color(txt_color); + style_params.font(fontp); + + if (mLastFromName == chat.mFromName) { view = getSeparator(); @@ -357,6 +368,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) else p.top_pad = mTopHeaderPad; p.bottom_pad = mBottomHeaderPad; + } p.view = view; @@ -371,18 +383,8 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) appendWidget(p, view_text, false); //Append the text message - - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - - std::string message = chat.mText + '\n'; - - LLStyle::Params style_params; - style_params.color(txt_color); - style_params.font(fontp); - appendText(message, FALSE, style_params); + appendText(chat.mText, FALSE, style_params); mLastFromName = chat.mFromName; blockUndo(); -- cgit v1.2.3 From eddda09e1da61a5958edd7af42a931f7ffb26e4b Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Thu, 12 Nov 2009 17:54:22 +0200 Subject: Fixed Major sub-task EXT-2398-Mini inspector should be opened by DOUBLE-click on the IM message header not by single-click --HG-- branch : product-engine --- 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 d1922cfd6e..43a1aeaefb 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -131,7 +131,7 @@ public: menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleObject = menu->getHandle(); - setMouseDownCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); + setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); return LLPanel::postBuild(); } -- cgit v1.2.3 From 74d5a6605bac7ae76889ce3697fc8f59d982d675 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 12 Nov 2009 20:23:43 +0200 Subject: Fixed normal bug EXT-2375 (Nearby Chat: Click on object name spawns Person Inspector instead of Object Inspector) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 43a1aeaefb..046e1d92dc 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -167,7 +167,15 @@ public: void onHeaderPanelClick(S32 x, S32 y, MASK mask) { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + if (mSourceType == CHAT_SOURCE_OBJECT) + { + LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", mAvatarID)); + } + else if (mSourceType == CHAT_SOURCE_AGENT) + { + LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + } + //if chat source is system, you may add "else" here to define behaviour. } const LLUUID& getAvatarId () const { return mAvatarID;} -- cgit v1.2.3 From 01f1eaf7e0faaa3ecde36ac28a346fed53a571fd Mon Sep 17 00:00:00 2001 From: angela Date: Fri, 13 Nov 2009 15:19:37 +0800 Subject: fix style readonlycolor overwriting color --- 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 2b050f3eb5..69e1f8d428 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -351,6 +351,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) LLStyle::Params style_params; style_params.color(txt_color); + style_params.readonly_color(txt_color); style_params.font(fontp); @@ -383,7 +384,6 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) appendWidget(p, view_text, false); //Append the text message - appendText(chat.mText, FALSE, style_params); mLastFromName = chat.mFromName; -- cgit v1.2.3 From d116185bfd1d64c7108e75ea1a7745f08cb2a3d0 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 13 Nov 2009 12:26:57 +0200 Subject: Fixed Low bug EXT-2404-Nearby Chat: There is redundant semicolon in the log for system messages --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 046e1d92dc..5efecfa78f 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -53,7 +53,7 @@ std::string formatCurrentTime() time_t utc_time; utc_time = time_corrected(); std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; + +LLTrans::getString("TimeMin")+"]"; LLSD substitution; @@ -344,7 +344,9 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; - std::string view_text = "\n[" + formatCurrentTime() + "] " + chat.mFromName + ": "; + std::string view_text = "\n[" + formatCurrentTime() + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + view_text += chat.mFromName + ": "; LLInlineViewSegment::Params p; p.force_newline = true; -- cgit v1.2.3 From 0c7a4b6a7d2675a916efacfb9f2f1a6098c027dd Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 13 Nov 2009 13:49:14 +0200 Subject: EXT-2342 Script : Fails to work in Alpha 6 ok toast for objects are back... also add object inspector to nearby chat object context menu --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5efecfa78f..f228373063 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -84,6 +84,10 @@ public: if (level == "profile") { + LLSD params; + params["object_id"] = getAvatarId(); + + LLFloaterReg::showInstance("inspect_object", params); } else if (level == "block") { -- cgit v1.2.3 From 1baf1d218644ac5dc00d9b41119a1ef168c709a2 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 16 Nov 2009 20:46:40 +0800 Subject: fix chat format for /me --- indra/newview/llchathistory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 028bb7a384..bec8eb2666 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -345,7 +345,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style return header; } -void LLChatHistory::appendWidgetMessage(const LLChat& chat) +void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params) { LLView* view = NULL; std::string view_text = "\n[" + formatCurrentTime() + "] "; @@ -367,7 +367,9 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat) style_params.color(txt_color); style_params.readonly_color(txt_color); style_params.font(fontp); - + style_params.italic = input_append_params.italic; + style_params.underline = input_append_params.underline; + style_params.bold = input_append_params.bold; if (mLastFromName == chat.mFromName) { -- cgit v1.2.3 From 0098bf40ea73078e2164ae55a8fa2f9049d0d4e9 Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 17 Nov 2009 16:33:49 +0800 Subject: undo the changes for LLStyle params; add sizeFromFont in LLFontGL ; use font.style, font.name and font.size params for font creating --- 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 bec8eb2666..f9c4a23f12 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -361,15 +361,17 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Param LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - + 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(fontp); - style_params.italic = input_append_params.italic; - style_params.underline = input_append_params.underline; - style_params.bold = input_append_params.bold; + style_params.font.name(font_name); + style_params.font.size(font_size); + style_params.font.style(input_append_params.font.style); + + if (mLastFromName == chat.mFromName) { -- cgit v1.2.3 From 53be27e742b642c1642c3289e3e11b300a14d360 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Tue, 17 Nov 2009 14:40:02 +0200 Subject: fox4 low task EXT-2480 Open Blocked List panel when blocking an object from nearby chat console --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 028bb7a384..9916175775 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -46,6 +46,8 @@ #include "llfloaterreg.h" #include "llmutelist.h" +#include "llsidetray.h"//for blocked objects panel + static LLDefaultChildRegistry::Register r("chat_history"); std::string formatCurrentTime() @@ -92,6 +94,8 @@ public: else if (level == "block") { LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); + + LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert("blocked_to_select", getAvatarId())); } } -- cgit v1.2.3 From b3cb61a26a0e4c7bfc3c18fd2705325a795684b8 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 18 Nov 2009 17:57:47 +0200 Subject: Fixed major bug EXT-2532-IM timestamp is when message is viewed, not when it was sent and received. Time str from the arriving message used now instead of constructing it dynamicly. --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cd5c5edac0..4ce3b50ed5 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -50,21 +50,6 @@ static LLDefaultChildRegistry::Register r("chat_history"); -std::string formatCurrentTime() -{ - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"]"; - - LLSD substitution; - - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - - return timeStr; -} - class LLChatHistoryHeader: public LLPanel { public: @@ -219,7 +204,7 @@ public: LLTextBox* timeBox = getChild("time_box"); - timeBox->setValue(formatCurrentTime()); + timeBox->setValue(chat.mTimeStr); LLAvatarIconCtrl* icon = getChild("avatar_icon"); @@ -352,7 +337,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params) { LLView* view = NULL; - std::string view_text = "\n[" + formatCurrentTime() + "] "; + std::string view_text = "\n[" + chat.mTimeStr + "] "; if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) view_text += chat.mFromName + ": "; -- cgit v1.2.3 From dd9b1f819de025f1a6caa37cfbd4fd3394f9fa9e Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 23 Nov 2009 17:33:03 +0800 Subject: EXT-2297 Functionality Loss - Ability to copy (control+c) residents name from their profile & local chat --- 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 4ce3b50ed5..a95234099c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -34,6 +34,7 @@ #include "llchathistory.h" #include "llpanel.h" #include "lltextbox.h" +#include "lltexteditor.h" #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" @@ -185,7 +186,7 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextBox* userName = getChild("user_name"); + LLTextEditor* userName = getChild("user_name"); LLUIColor color = style_params.color; userName->setReadOnlyColor(color); -- cgit v1.2.3 From 9e403da7b0fd013371e73820b8aa70820f4f620b Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Mon, 23 Nov 2009 20:34:06 +0200 Subject: Implemented major sub-task EXT-2517 (Add support for the viewer 1.23 chat history style (widget-less)) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 94 ++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 38 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 4ce3b50ed5..422aae3c25 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -334,20 +334,14 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style return header; } -void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params) +void LLChatHistory::clear() { - LLView* view = NULL; - std::string view_text = "\n[" + chat.mTimeStr + "] "; - if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - view_text += chat.mFromName + ": "; - - - LLInlineViewSegment::Params p; - p.force_newline = true; - p.left_pad = mLeftWidgetPad; - p.right_pad = mRightWidgetPad; + mLastFromName.clear(); + LLTextEditor::clear(); +} - +void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_chat_history, const LLStyle::Params& input_append_params) +{ LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); @@ -360,39 +354,63 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Param style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); - + std::string header_text = "[" + chat.mTimeStr + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + header_text += chat.mFromName + ": "; - if (mLastFromName == chat.mFromName) + if (use_plain_text_chat_history) { - view = getSeparator(); - p.top_pad = mTopSeparatorPad; - p.bottom_pad = mBottomSeparatorPad; + appendText(header_text, getText().size() != 0, style_params); } else { - view = getHeader(chat,style_params); - if (getText().size() == 0) - p.top_pad = 0; + LLView* view = NULL; + LLInlineViewSegment::Params p; + p.force_newline = true; + p.left_pad = mLeftWidgetPad; + p.right_pad = mRightWidgetPad; + + if (mLastFromName == chat.mFromName) + { + view = getSeparator(); + p.top_pad = mTopSeparatorPad; + p.bottom_pad = mBottomSeparatorPad; + } else - p.top_pad = mTopHeaderPad; - p.bottom_pad = mBottomHeaderPad; - + { + view = getHeader(chat, style_params); + if (getText().size() == 0) + p.top_pad = 0; + else + p.top_pad = mTopHeaderPad; + p.bottom_pad = mBottomHeaderPad; + + } + p.view = view; + + //Prepare the rect for the view + LLRect target_rect = getDocumentView()->getRect(); + // squeeze down the widget by subtracting padding off left and right + target_rect.mLeft += mLeftWidgetPad + mHPad; + target_rect.mRight -= mRightWidgetPad; + view->reshape(target_rect.getWidth(), view->getRect().getHeight()); + view->setOrigin(target_rect.mLeft, view->getRect().mBottom); + + appendWidget(p, header_text, false); + mLastFromName = chat.mFromName; } - p.view = view; - - //Prepare the rect for the view - LLRect target_rect = getDocumentView()->getRect(); - // squeeze down the widget by subtracting padding off left and right - target_rect.mLeft += mLeftWidgetPad + mHPad; - target_rect.mRight -= mRightWidgetPad; - view->reshape(target_rect.getWidth(), view->getRect().getHeight()); - view->setOrigin(target_rect.mLeft, view->getRect().mBottom); - - appendWidget(p, view_text, false); - - //Append the text message - appendText(chat.mText, FALSE, style_params); + //Handle IRC styled /me messages. + std::string prefix = chat.mText.substr(0, 4); + if (prefix == "/me " || prefix == "/me'") + { + style_params.font.style = "ITALIC"; - mLastFromName = chat.mFromName; + if (chat.mFromName.size() > 0) + appendText(chat.mFromName + " ", TRUE, style_params); + appendText(chat.mText.substr(4), FALSE, style_params); + } + else + appendText(chat.mText, FALSE, style_params); blockUndo(); } + -- cgit v1.2.3 From cfccf4d5145274f7bfe1c88b7e51c000461226e8 Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 24 Nov 2009 11:54:33 +0800 Subject: EXT-2780 allow_scroll = false in LLTextEditor will crash the viewer --- indra/newview/llchathistory.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a95234099c..24fa28c6cd 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -33,12 +33,10 @@ #include "llviewerprecompiledheaders.h" #include "llchathistory.h" #include "llpanel.h" -#include "lltextbox.h" -#include "lltexteditor.h" #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" - +#include "lltexteditor.h" #include "llimview.h" #include "llcallingcard.h" //for LLAvatarTracker #include "llagentdata.h" @@ -188,9 +186,8 @@ public: LLTextEditor* userName = getChild("user_name"); - LLUIColor color = style_params.color; - userName->setReadOnlyColor(color); - userName->setColor(color); + userName->setReadOnlyColor(style_params.readonly_color()); + userName->setColor(style_params.color()); if(!chat.mFromName.empty()) { @@ -204,7 +201,7 @@ public: } - LLTextBox* timeBox = getChild("time_box"); + LLUICtrl* timeBox = getChild("time_box"); timeBox->setValue(chat.mTimeStr); LLAvatarIconCtrl* icon = getChild("avatar_icon"); -- cgit v1.2.3 From d93cece450b0f3897fa472d86db837274d35643b Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 24 Nov 2009 15:01:51 +0800 Subject: fix crash error for missing string RegisterDateFormat in panel_profile_user.xml --- indra/newview/llchathistory.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 24fa28c6cd..1d4878dc50 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -36,7 +36,6 @@ #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" -#include "lltexteditor.h" #include "llimview.h" #include "llcallingcard.h" //for LLAvatarTracker #include "llagentdata.h" -- cgit v1.2.3 From 67ef3059b5a0084c6e501ae088cedf79d97f4277 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 24 Nov 2009 13:20:31 +0200 Subject: Work on critical sub-task EXT-2615 (IM Chat History is severely broken) -- Implemented fitting of the timestamp in Chat History header panel depend on time string width --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 422aae3c25..dbb8e0fef4 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -202,10 +202,8 @@ public: userName->setValue(SL); } + setTimeField(chat.mTimeStr); - LLTextBox* timeBox = getChild("time_box"); - timeBox->setValue(chat.mTimeStr); - LLAvatarIconCtrl* icon = getChild("avatar_icon"); if(mSourceType != CHAT_SOURCE_AGENT) @@ -271,7 +269,29 @@ protected: } } - +private: + void setTimeField(const std::string& time_value) + { + LLTextBox* time_box = getChild("time_box"); + + LLRect rect_before = time_box->getRect(); + time_box->setValue(time_value); + + // set necessary textbox width to fit all text + time_box->reshapeToFitText(); + LLRect rect_after = time_box->getRect(); + + // move rect to the left to correct position... + llinfos << "WWW: " << rect_before << rect_after << llendl; + S32 delta_pos_x = rect_before.getWidth() - rect_after.getWidth(); + S32 delta_pos_y = rect_before.getHeight() - rect_after.getHeight(); + time_box->translate(delta_pos_x, delta_pos_y); + + //... & change width of the name control + LLTextBox* user_name = getChild("user_name"); + const LLRect& user_rect = user_name->getRect(); + user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight()); + } protected: LLHandle mPopupMenuHandleAvatar; -- cgit v1.2.3 From 96199e2d90eb5c8c5da04ab40b3c41ca3fd5eddc Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 24 Nov 2009 13:22:56 +0200 Subject: Remove unnecessary log message --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index dbb8e0fef4..533940943e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -282,7 +282,6 @@ private: LLRect rect_after = time_box->getRect(); // move rect to the left to correct position... - llinfos << "WWW: " << rect_before << rect_after << llendl; S32 delta_pos_x = rect_before.getWidth() - rect_after.getWidth(); S32 delta_pos_y = rect_before.getHeight() - rect_after.getHeight(); time_box->translate(delta_pos_x, delta_pos_y); -- cgit v1.2.3