summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-07 21:54:09 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-07 21:54:09 +0300
commit7b8251fd2f169136fc45e4c17104da676f75727b (patch)
tree89898a727d8e892be05383a6a9f19c36ce04dc76 /indra
parent79928c65329146920558d9bc286f643ccf8dca7f (diff)
CHUI-103 WIP Added settings for switching text view mode
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml23
-rw-r--r--indra/newview/llchathistory.cpp24
-rw-r--r--indra/newview/llchathistory.h4
-rw-r--r--indra/newview/llimfloater.cpp3
4 files changed, 41 insertions, 13 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ee8c15752b..e6d0ed7dfa 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2,6 +2,29 @@
<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="llsd.xsd">
<map>
+ <key>IMShowTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable(disable) timestamp showing in the chat.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>IMShowNamesForP2PConv</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable(disable) showing of a names in the chat.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+
<key>CrashHostUrl</key>
<map>
<key>Comment</key>
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("<nolink>" + chat.mFromName + "</nolink>" + 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();
diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h
index 4cd9c75e1c..28344e6a10 100644
--- a/indra/newview/llchathistory.h
+++ b/indra/newview/llchathistory.h
@@ -138,10 +138,6 @@ class LLChatHistory : public LLUICtrl
S32 mTopHeaderPad;
S32 mBottomHeaderPad;
- S32 mPrependNewLineState;
-
- bool isNeedPrependNewline() {return (mPrependNewLineState-- > 0);}
-
class LLLayoutPanel* mMoreChatPanel;
LLTextBox* mMoreChatText;
LLTextEditor* mEditor;
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index f67464078b..f743b5e2bf 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -630,6 +630,9 @@ void LLIMFloater::updateMessages()
{
LLSD chat_args;
chat_args["use_plain_text_chat_history"] = use_plain_text_chat_history;
+ chat_args["show_time"] = gSavedSettings.getBOOL("IMShowTime");
+ chat_args["show_names_for_p2p_conv"] =
+ gSavedSettings.getBOOL("IMShowNamesForP2PConv");
std::ostringstream message;
std::list<LLSD>::const_reverse_iterator iter = messages.rbegin();