From 6354a053e366e1b6228c45a5dc9f92b262862dbe Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Jun 2022 01:41:25 +0300 Subject: SL-15312 Show user's sl birthday --- indra/newview/llpanelprofile.cpp | 18 ++++++++---- indra/newview/llpanelprofilepicks.cpp | 33 ++++++++++++++-------- .../default/xui/en/panel_profile_secondlife.xml | 19 +++++++++++-- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index f608712133..cb10dd75fb 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1238,12 +1238,20 @@ void LLPanelProfileSecondLife::fillRightsData() void LLPanelProfileSecondLife::fillNameAgeData(const LLAvatarName &av_name, const LLDate &born_on) { - LLStringUtil::format_map_t args; - args["[AGE]"] = LLDateUtil::ageFromDate(born_on, LLDate::now()); - args["[NAME]"] = av_name.getAccountName(); - std::string register_date = getString("NameAgeFormat", args); - getChild("user_name_age")->setValue(register_date); getChild("display_name")->setValue(av_name.getDisplayName()); + + std::string name_and_date = getString("name_date_format"); + LLSD args_name; + args_name["datetime"] = (S32)born_on.secondsSinceEpoch(); + args_name["[NAME]"] = av_name.getAccountName(); + LLStringUtil::format(name_and_date, args_name); + getChild("user_name_date")->setValue(name_and_date); + + std::string register_date = getString("age_format"); + LLSD args_age; + args_age["[AGE]"] = LLDateUtil::ageFromDate(born_on, LLDate::now()); + LLStringUtil::format(register_date, args_age); + getChild("user_age")->setValue(register_date); } void LLPanelProfileSecondLife::onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep) diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 7142051f17..69f6ac0407 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -152,16 +152,25 @@ void LLPanelProfilePicks::createPick(const LLPickData &data) { if (getIsLoaded()) { - mNoItemsLabel->setVisible(FALSE); - LLPanelProfilePick* pick_panel = LLPanelProfilePick::create(); - pick_panel->setAvatarId(getAvatarId()); - pick_panel->processProperties(&data); - mTabContainer->addTabPanel( - LLTabContainer::TabPanelParams(). - panel(pick_panel). - select_tab(true). - label(pick_panel->getPickName())); - updateButtons(); + if (canAddNewPick()) + { + mNoItemsLabel->setVisible(FALSE); + LLPanelProfilePick* pick_panel = LLPanelProfilePick::create(); + pick_panel->setAvatarId(getAvatarId()); + pick_panel->processProperties(&data); + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams(). + panel(pick_panel). + select_tab(true). + label(pick_panel->getPickName())); + updateButtons(); + } + else + { + // This means that something doesn't properly check limits + // before creating a pick + LL_WARNS() << "failed to add pick" << LL_ENDL; + } } else { @@ -313,7 +322,7 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks) } } - while (!mSheduledPickCreation.empty()) + while (!mSheduledPickCreation.empty() && canAddNewPick()) { const LLPickData data = mSheduledPickCreation.back(); @@ -331,6 +340,8 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks) has_selection = true; } + mSheduledPickCreation.clear(); + BOOL no_data = !mTabContainer->getTabCount(); mNoItemsLabel->setVisible(no_data); if (no_data) diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 7dd16de0ed..63136fd6a4 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -10,8 +10,11 @@ layout="topleft" > + name="name_date_format" + value="[NAME], [mth,datetime,slt] [day,datetime,slt], [year,datetime,slt]" /> + @@ -99,7 +102,17 @@ Account: [ACCTTYPE] layout="topleft"/> + +