diff options
author | Oz Linden <oz@lindenlab.com> | 2011-07-22 09:06:42 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-07-22 09:06:42 -0400 |
commit | ebbadcf7720cfcbdf5da99ad219de4e7edcf0c6f (patch) | |
tree | b7782e3c46284e99c3bb9ef081ce4cc8f04d292a /indra/newview | |
parent | d26356d7e16191da90cae23d3871d4e7289e175f (diff) | |
parent | f45747e52401569c0ee489d7f408cf00f4c58149 (diff) |
merge changes from snowstorm team review build
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/lldateutil.cpp | 27 | ||||
-rw-r--r-- | indra/newview/lldateutil.h | 14 | ||||
-rwxr-xr-x | indra/newview/llfloaterworldmap.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelgrouplandmoney.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 37 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_search.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 2 |
9 files changed, 128 insertions, 7 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 58b0879fde..9bb320d882 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3848,7 +3848,7 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>https://www.xstreetsl.com/modules.php?name=Marketplace&CategoryID=233</string> + <string>https://marketplace.secondlife.com/products/search?search[category_id]=200&search[maturity][]=General&search[page]=1&search[per_page]=12</string> </map> <key>GridCrossSections</key> <map> diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 18ae6107e7..c7fc45f61e 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -27,10 +27,16 @@ #include "lldateutil.h" +#include <boost/date_time/gregorian/gregorian.hpp> +#include <boost/date_time/posix_time/ptime.hpp> + // Linden libraries #include "lltrans.h" #include "llui.h" +using namespace boost::gregorian; +using namespace boost::posix_time; + static S32 DAYS_PER_MONTH_NOLEAP[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static S32 DAYS_PER_MONTH_LEAP[] = @@ -186,3 +192,24 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string) //{ // return ageFromDateISO(date_string, LLDate::now()); //} + +S32 LLDateUtil::secondsSinceEpochFromString(const std::string& format, const std::string& str) +{ + date_input_facet *facet = new date_input_facet(format); + + std::stringstream ss; + ss << str; + ss.imbue(std::locale(ss.getloc(), facet)); + + date d; + ss >> d; + + ptime time_t_date(d); + ptime time_t_epoch(date(1970,1,1)); + + // We assume that the date defined by str is in UTC, so the difference + // is calculated with no time zone corrections. + time_duration diff = time_t_date - time_t_epoch; + + return diff.total_seconds(); +} diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index 2843a357c9..f027d360f7 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -69,6 +69,20 @@ namespace LLDateUtil //std::string ageFromDateISO(const std::string& date_string); //std::string ageFromDate(S32 born_year, S32 born_month, S32 born_day, const LLDate& now); + + /** + * Convert a string of a specified date format into seconds since the Epoch. + * + * Many of the format flags are those used by strftime(...), but not all. + * For the full list of supported time format specifiers + * see http://www.boost.org/doc/libs/1_47_0/doc/html/date_time/date_time_io.html#date_time.format_flags + * + * @param format Format characters string. Example: "%A %b %d, %Y" + * @param str Date string containing the time in specified format. + * + * @return Number of seconds since 01/01/1970 UTC. + */ + S32 secondsSinceEpochFromString(const std::string& format, const std::string& str); } #endif diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index eb3c7ee469..d5f0648f3b 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -70,7 +70,7 @@ #include "llappviewer.h" #include "llmapimagetype.h" #include "llweb.h" -#include "llslider.h" +#include "llsliderctrl.h" #include "message.h" #include "llwindow.h" // copyTextToClipboard() #include <algorithm> @@ -1029,7 +1029,7 @@ void LLFloaterWorldMap::adjustZoomSliderBounds() F32 min_power = log(pixels_per_region/256.f)/log(2.f); - getChild<LLSlider>("zoom slider")->setMinValue(min_power); + getChild<LLSliderCtrl>("zoom slider")->setMinValue(min_power); } diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 8d8d9bc1c4..eddd6e554d 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -35,6 +35,7 @@ #include "llqueryflags.h" #include "llagent.h" +#include "lldateutil.h" #include "lliconctrl.h" #include "llfloaterreg.h" #include "lllineeditor.h" @@ -1056,6 +1057,14 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_CurrentInterval, current_interval ); msg->getStringFast(_PREHASH_MoneyData, _PREHASH_StartDate, start_date); + std::string time_str = LLTrans::getString("GroupMoneyDate"); + LLSD substitution; + + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date); + LLStringUtil::format (time_str, substitution); + if ( interval_days != mImplementationp->mIntervalLength || current_interval != mImplementationp->mCurrentInterval ) { @@ -1064,7 +1073,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, return; } - std::string text = start_date; + std::string text = time_str; text.append("\n\n"); S32 total_amount = 0; @@ -1203,7 +1212,15 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, // Start with the date. if (text == mImplementationp->mLoadingText) { - text = start_date + "\n\n"; + std::string time_str = LLTrans::getString("GroupMoneyDate"); + LLSD substitution; + + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date); + LLStringUtil::format (time_str, substitution); + + text = time_str + "\n\n"; } S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData); @@ -1408,12 +1425,26 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, } text.append(LLTrans::getString("SummaryForTheWeek")); - text.append(start_date); + + std::string date_format_str = LLTrans::getString("GroupPlanningDate"); + std::string time_str = date_format_str; + LLSD substitution; + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", start_date); + LLStringUtil::format (time_str, substitution); + + text.append(time_str); if (current_interval == 0) { text.append(LLTrans::getString("NextStipendDay")); - text.append(next_stipend_date); + + time_str = date_format_str; + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", next_stipend_date); + LLStringUtil::format (time_str, substitution); + + text.append(time_str); text.append("\n\n"); text.append(llformat("%-24sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance )); text.append(1, '\n'); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a37f8ad0d8..f74bcafc5c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -44,6 +44,7 @@ #include "llbottomtray.h" #include "llcompilequeue.h" #include "llconsole.h" +#include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" #include "llfilepicker.h" @@ -100,6 +101,7 @@ #include "llworldmap.h" #include "pipeline.h" #include "llviewerjoystick.h" +#include "llwaterparammanager.h" #include "llwlanimator.h" #include "llwlparammanager.h" #include "llfloatercamera.h" @@ -7667,6 +7669,40 @@ class LLWorldEnvPreset : public view_listener_t } }; +class LLWorldEnableEnvPreset : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string item = userdata.asString(); + + if (item == "delete_water") + { + LLWaterParamManager::preset_name_list_t user_waters; + LLWaterParamManager::instance().getUserPresetNames(user_waters); + return !user_waters.empty(); + } + else if (item == "delete_sky") + { + LLWLParamManager::preset_name_list_t user_skies; + LLWLParamManager::instance().getUserPresetNames(user_skies); + return !user_skies.empty(); + } + else if (item == "delete_day_cycle") + { + LLDayCycleManager::preset_name_list_t user_days; + LLDayCycleManager::instance().getUserPresetNames(user_days); + return !user_days.empty(); + } + else + { + llwarns << "Unknown item" << llendl; + } + + return false; + } +}; + + /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { @@ -7906,6 +7942,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); + view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 8770ede7e9..c7b26c59c7 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -38,6 +38,7 @@ user_resize="false" width="630"> <web_browser + tab_stop="true" trusted_content="true" follows="left|right|top|bottom" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 317c6fe9ac..ab5c543376 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -557,6 +557,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_water"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_water"/> </menu_item_call> </menu> @@ -583,6 +586,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_sky"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_sky"/> </menu_item_call> </menu> @@ -609,6 +615,9 @@ <menu_item_call.on_click function="World.EnvPreset" parameter="delete_day_cycle"/> + <menu_item_call.on_enable + function="World.EnableEnvPreset" + parameter="delete_day_cycle"/> </menu_item_call> </menu> </menu> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index c1c1151eb9..ee6317f367 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2238,6 +2238,7 @@ Returns a string with the requested data about the region <string name="Unknown">(Unknown)</string> <string name="SummaryForTheWeek" value="Summary for this week, beginning on " /> <string name="NextStipendDay" value="The next stipend day is " /> + <string name="GroupPlanningDate">[mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc]</string> <string name="GroupIndividualShare" value=" Group Individual Share" /> <string name="GroupColumn" value=" Group" /> <string name="Balance">Balance</string> @@ -2394,6 +2395,7 @@ Returns a string with the requested data about the region <string name="GroupMoneyBalance">Balance</string> <string name="GroupMoneyCredits">Credits</string> <string name="GroupMoneyDebits">Debits</string> + <string name="GroupMoneyDate">[weekday,datetime,utc] [mth,datetime,utc] [day,datetime,utc], [year,datetime,utc]</string> <!-- viewer object --> <string name="ViewerObjectContents">Contents</string> |