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.
This commit is contained in:
Lirusaito
2012-12-31 04:54:59 -05:00
parent 469f76e690
commit f94f4a1191
5 changed files with 24 additions and 2 deletions

View File

@@ -5835,6 +5835,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>SecondsInLog</key>
<map>
<key>Comment</key>
<string>TRUE to add seconds to timestamps for Log</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FloaterAboutRect</key> <key>FloaterAboutRect</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -335,6 +335,7 @@ void LLPrefsAscentChat::refreshValues()
mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC"); mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC");
mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects");
mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs");
mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog");
std::string format = gSavedSettings.getString("ShortTimeFormat"); std::string format = gSavedSettings.getString("ShortTimeFormat");
if (format.find("%p") == -1) if (format.find("%p") == -1)
@@ -540,6 +541,7 @@ void LLPrefsAscentChat::cancel()
gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose); gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose);
gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects); gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects);
gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs); gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs);
gSavedSettings.setBOOL("SecondsInLog", mSecondsInLog);
std::string short_date, long_date, short_time, long_time, timestamp; std::string short_date, long_date, short_time, long_time, timestamp;

View File

@@ -76,6 +76,7 @@ protected:
U32 tempTimeFormat; U32 tempTimeFormat;
U32 tempDateFormat; U32 tempDateFormat;
BOOL mSecondsInChatAndIMs; BOOL mSecondsInChatAndIMs;
BOOL mSecondsInLog;
BOOL mIMResponseAnyone; BOOL mIMResponseAnyone;
BOOL mIMResponseFriends; BOOL mIMResponseFriends;

View File

@@ -88,11 +88,18 @@ std::string LLLogChat::timestamp(bool withdate)
// it's daylight savings time there. // it's daylight savings time there.
timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);
static LLCachedControl<bool> withseconds("SecondsInLog");
std::string text; std::string text;
if (withdate) 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 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; return text;
} }

View File

@@ -44,6 +44,7 @@
<combo_item name="day_first" value="default">DD/MM/YYYY</combo_item> <combo_item name="day_first" value="default">DD/MM/YYYY</combo_item>
<combo_item name="month_first" value="default">MM/DD/YYYY</combo_item> <combo_item name="month_first" value="default">MM/DD/YYYY</combo_item>
</combo_box> </combo_box>
<check_box bottom_delta="0" left="240" follows="top" control_name="SecondsInLog" label="Seconds in Log timestamps" name="seconds_in_log"/>
<!-- Auto-responder --> <!-- Auto-responder -->
<view_border bottom="-420" left="5" height="190" bevel_style="none" border_thickness="1" name="GraphicsBorder" width="485"/> <view_border bottom="-420" left="5" height="190" bevel_style="none" border_thickness="1" name="GraphicsBorder" width="485"/>
<check_box bottom_delta="168" left="10" follows="top" initial_value="false" label="Enable Autoresponse" <check_box bottom_delta="168" left="10" follows="top" initial_value="false" label="Enable Autoresponse"