Merge remote-tracking branch 'Liru/master'

This commit is contained in:
Damian Zhaoying
2013-09-20 14:19:58 -03:00
8 changed files with 30 additions and 12 deletions

View File

@@ -35,7 +35,7 @@
const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 8; const S32 LL_VERSION_MINOR = 8;
const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_PATCH = 3;
const S32 LL_VERSION_BUILD = ${vBUILD}; const S32 LL_VERSION_BUILD = ${vBUILD};
const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; const char * const LL_CHANNEL = "${VIEWER_CHANNEL}";

View File

@@ -438,13 +438,14 @@ void LLScrollListCheck::setEnabled(BOOL enable)
LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p) LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p)
: LLScrollListText(p), : LLScrollListText(p),
mFormat(p.format),
mDate(p.value().asDate()) mDate(p.value().asDate())
{} {}
void LLScrollListDate::setValue(const LLSD& value) void LLScrollListDate::setValue(const LLSD& value)
{ {
mDate = value.asDate(); mDate = value.asDate();
LLScrollListText::setValue(mDate.asRFC1123()); LLScrollListText::setValue(mFormat.empty() ? mDate.asRFC1123() : mDate.toHTTPDateString(mFormat));
} }
const LLSD LLScrollListDate::getValue() const const LLSD LLScrollListDate::getValue() const

View File

@@ -61,6 +61,7 @@ public:
Optional<void*> userdata; Optional<void*> userdata;
Optional<LLSD> value; Optional<LLSD> value;
Optional<std::string> tool_tip; Optional<std::string> tool_tip;
Optional<std::string> format;
Optional<std::string> font; Optional<std::string> font;
Optional<LLColor4> font_color; Optional<LLColor4> font_color;
@@ -77,6 +78,7 @@ public:
visible("visible", true), visible("visible", true),
value("value"), value("value"),
tool_tip("tool_tip", ""), tool_tip("tool_tip", ""),
format("format", ""),
font("font"/*, LLFontGL::getFontSansSerifSmall()*/), font("font"/*, LLFontGL::getFontSansSerifSmall()*/),
font_color("font_color", LLColor4::black), font_color("font_color", LLColor4::black),
font_style("font-style"), font_style("font-style"),
@@ -230,6 +232,7 @@ public:
virtual const LLSD getValue() const; virtual const LLSD getValue() const;
private: private:
std::string mFormat;
LLDate mDate; LLDate mDate;
}; };

View File

@@ -926,13 +926,18 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id)
// so that the sorter can sort by year before month before day. // so that the sorter can sort by year before month before day.
static void formatDateString(std::string &date_string) static void formatDateString(std::string &date_string)
{ {
tm t; using namespace boost;
if (sscanf(date_string.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900) cmatch result;
const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})");
if (regex_match(date_string.c_str(), result, expression))
{ {
t.tm_year -= 1900; // convert matches to integers so that we can pad them with zeroes on Linux
t.tm_mon--; S32 year = boost::lexical_cast<S32>(result[3]);
t.tm_hour = t.tm_min = t.tm_sec = 0; S32 month = boost::lexical_cast<S32>(result[1]);
timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), date_string); S32 day = boost::lexical_cast<S32>(result[2]);
// ISO 8601 date format
date_string = llformat("%04d-%02d-%02dT00:00:00Z", year, month, day);
} }
} }

View File

@@ -844,7 +844,11 @@ void LLPanelGroupGeneral::addMember(LLGroupMemberData* member)
item_params.columns.add().column("title").value(member->getTitle()).font/*.name*/("SANSSERIF_SMALL").font_style(style); item_params.columns.add().column("title").value(member->getTitle()).font/*.name*/("SANSSERIF_SMALL").font_style(style);
item_params.columns.add().column("online").value(member->getOnlineStatus()).font/*.name*/("SANSSERIF_SMALL").font_style(style); static const LLCachedControl<std::string> format(gSavedSettings, "ShortDateFormat");
static const std::string online(LLTrans::getString("group_member_status_online"));
item_params.columns.add().column("online").value(member->getOnlineStatus())
.format(format).type(member->getOnlineStatus() == online ? "text" : "date")
.font/*.name*/("SANSSERIF_SMALL").font_style(style);
/*LLScrollListItem* member_row =*/ mListVisibleMembers->addNameItemRow(item_params); /*LLScrollListItem* member_row =*/ mListVisibleMembers->addNameItemRow(item_params);
} }

View File

@@ -455,7 +455,6 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
msg->getBOOL("Data","HasAttachment",has_attachment,i); msg->getBOOL("Data","HasAttachment",has_attachment,i);
msg->getU8("Data","AssetType",asset_type,i); msg->getU8("Data","AssetType",asset_type,i);
msg->getU32("Data","Timestamp",timestamp,i); msg->getU32("Data","Timestamp",timestamp,i);
time_t t = timestamp;
LLSD row; LLSD row;
row["id"] = id; row["id"] = id;
@@ -480,9 +479,10 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
std::string format(gSavedSettings.getString("ShortDateFormat")); std::string format(gSavedSettings.getString("ShortDateFormat"));
if (gSavedSettings.getBOOL("LiruGroupNoticeTimes")) if (gSavedSettings.getBOOL("LiruGroupNoticeTimes"))
format += " " + gSavedSettings.getString("ShortTimeFormat"); format += " " + gSavedSettings.getString("ShortTimeFormat");
timeToFormattedString(t, format, buffer); row["columns"][3]["type"] = "date";
row["columns"][3]["format"] = format;
row["columns"][3]["column"] = "date"; row["columns"][3]["column"] = "date";
row["columns"][3]["value"] = buffer; row["columns"][3]["value"] = LLDate(timestamp);
buffer = llformat( "%u", timestamp); buffer = llformat( "%u", timestamp);
row["columns"][4]["column"] = "sort"; row["columns"][4]["column"] = "sort";

View File

@@ -50,6 +50,7 @@
#include "lltabcontainer.h" #include "lltabcontainer.h"
#include "lltextbox.h" #include "lltextbox.h"
#include "lltexteditor.h" #include "lltexteditor.h"
#include "lltrans.h"
#include "llviewertexturelist.h" #include "llviewertexturelist.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
@@ -1536,7 +1537,10 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
item_params.columns.add().column("donated").value(donated.getString()) item_params.columns.add().column("donated").value(donated.getString())
.font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/; .font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/;
static const LLCachedControl<std::string> format(gSavedSettings, "ShortDateFormat");
static const std::string online(LLTrans::getString("group_member_status_online"));
item_params.columns.add().column("online").value(data->getOnlineStatus()) item_params.columns.add().column("online").value(data->getOnlineStatus())
.format(format).type(data->getOnlineStatus() == online ? "text" : "date")
.font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/; .font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/;
mMembersList->addNameItemRow(item_params); mMembersList->addNameItemRow(item_params);

View File

@@ -1038,6 +1038,7 @@ void LLPanelLogin::onLocationSLURL()
{ {
LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo"); LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
std::string location = location_combo->getValue().asString(); std::string location = location_combo->getValue().asString();
LLStringUtil::trim(location);
LL_DEBUGS("AppInit")<<location<<LL_ENDL; LL_DEBUGS("AppInit")<<location<<LL_ENDL;
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above