From f94f4a1191a12358edb412e663040c57ee1d594a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 31 Dec 2012 04:54:59 -0500 Subject: [PATCH] Satisfy Issue 100: When timestamp it set to include seconds, the seconds do not get included with IM & chat logs. Best viewed without space changes. SecondsInLog debug setting added. Seconds in Log timestamps checkbox added to Adv. Chat prefs. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/ascentprefschat.cpp | 2 ++ indra/newview/ascentprefschat.h | 1 + indra/newview/lllogchat.cpp | 11 +++++++++-- .../xui/en-us/panel_preferences_ascent_chat.xml | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e0a106ed3..b3bd8fb3a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5835,6 +5835,17 @@ This should be as low as possible, but too low may break functionality Value 0 + SecondsInLog + + Comment + TRUE to add seconds to timestamps for Log + Persist + 1 + Type + Boolean + Value + 0 + FloaterAboutRect Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index cb7b9e906..2cdfad841 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -335,6 +335,7 @@ void LLPrefsAscentChat::refreshValues() mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC"); mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); + mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog"); std::string format = gSavedSettings.getString("ShortTimeFormat"); if (format.find("%p") == -1) @@ -540,6 +541,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose); gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects); gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs); + gSavedSettings.setBOOL("SecondsInLog", mSecondsInLog); std::string short_date, long_date, short_time, long_time, timestamp; diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index cc335cf3e..ba6476d6e 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -76,6 +76,7 @@ protected: U32 tempTimeFormat; U32 tempDateFormat; BOOL mSecondsInChatAndIMs; + BOOL mSecondsInLog; BOOL mIMResponseAnyone; BOOL mIMResponseFriends; diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index e80032239..192c5f531 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -88,11 +88,18 @@ std::string LLLogChat::timestamp(bool withdate) // it's daylight savings time there. timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); + static LLCachedControl withseconds("SecondsInLog"); std::string text; if (withdate) - text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); + if (withseconds) + text = llformat("[%d-%02d-%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); + else + text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); else - text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min); + if (withseconds) + text = llformat("[%02d:%02d:%02d] ", timep->tm_hour, timep->tm_min, timep->tm_sec); + else + text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min); return text; } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 4517105a2..5bc7d73b2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -44,6 +44,7 @@ DD/MM/YYYY MM/DD/YYYY +