From 8740c54fb074b8ab2349dc5a3317e1578de3d812 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 7 Mar 2019 15:26:01 -0800 Subject: SL-10700: If a track is empty show the name of the track used below it. If all tracks are empty for a parcel are empty report thath it uses region settings. --- indra/newview/llpanelenvironment.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanelenvironment.cpp') diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index ca9c8bdffa..ef307ad079 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -55,6 +55,8 @@ namespace { const std::string FLOATER_DAY_CYCLE_EDIT("env_edit_extdaycycle"); + const std::string STRING_REGION_ENV("str_region_env"); + const std::string STRING_EMPTY_NAME("str_empty"); inline bool ends_with(std::string const & value, std::string const & ending) { @@ -86,7 +88,6 @@ const std::string LLPanelEnvironmentInfo::SDT_DROP_TARGET("sdt_drop_target"); const std::string LLPanelEnvironmentInfo::STR_LABEL_USEDEFAULT("str_label_use_default"); const std::string LLPanelEnvironmentInfo::STR_LABEL_USEREGION("str_label_use_region"); -const std::string LLPanelEnvironmentInfo::STR_LABEL_UNKNOWNINV("str_unknow_inventory"); const std::string LLPanelEnvironmentInfo::STR_ALTITUDE_DESCRIPTION("str_altitude_desription"); const std::string LLPanelEnvironmentInfo::STR_NO_PARCEL("str_no_parcel"); const std::string LLPanelEnvironmentInfo::STR_CROSS_REGION("str_cross_region"); @@ -332,33 +333,32 @@ void LLPanelEnvironmentInfo::refreshFromEstate() refresh(); } -std::string LLPanelEnvironmentInfo::getInventoryNameForAssetId(LLUUID asset_id) -{ - std::string name(LLFloaterSettingsPicker::findItemName(asset_id, false, false)); - - if (name.empty()) - return getString(STR_LABEL_UNKNOWNINV); - return name; -} - - std::string LLPanelEnvironmentInfo::getNameForTrackIndex(S32 index) { + std::string invname; if (mCurrentEnvironment->mDayCycleName.empty()) { invname = mCurrentEnvironment->mNameList[index]; - if (!isRegion() && invname.empty()) - invname = getString("str_region_env"); + if (invname.empty()) + { + if (index <= LLSettingsDay::TRACK_GROUND_LEVEL) + invname = getString(isRegion() ? STRING_EMPTY_NAME : STRING_REGION_ENV); + } } else if (!mCurrentEnvironment->mDayCycle->isTrackEmpty(index)) { invname = mCurrentEnvironment->mDayCycleName; } + if (invname.empty()) - invname = getString("str_empty"); + { + invname = getNameForTrackIndex(index - 1); + if (invname[0] != '(') + invname = "(" + invname + ")"; + } return invname; } -- cgit v1.2.3