From 88b53a26ce633bfc07f9990e9dc1e9c85dd31414 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 7 Mar 2019 20:26:15 +0200 Subject: SL-10635 Better handlling for unexpected situations --- indra/newview/llfloatereditextdaycycle.cpp | 9 +-------- indra/newview/llsettingspicker.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index f05f0fb021..235a9b4d53 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -738,14 +738,7 @@ void LLFloaterEditExtDayCycle::onButtonImport() void LLFloaterEditExtDayCycle::onButtonLoadFrame() { - LLUUID curitemId = mInventoryId; - - if (mCurrentEdit && curitemId.notNull()) - { - curitemId = LLFloaterSettingsPicker::findItemID(mCurrentEdit->getAssetId(), false, false); - } - - doOpenInventoryFloater((mCurrentTrack == LLSettingsDay::TRACK_WATER) ? LLSettingsType::ST_WATER : LLSettingsType::ST_SKY, curitemId); + doOpenInventoryFloater((mCurrentTrack == LLSettingsDay::TRACK_WATER) ? LLSettingsType::ST_WATER : LLSettingsType::ST_SKY, LLUUID::null); } void LLFloaterEditExtDayCycle::onAddFrame() diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp index fcc615db6e..b47821ddf2 100644 --- a/indra/newview/llsettingspicker.cpp +++ b/indra/newview/llsettingspicker.cpp @@ -151,6 +151,8 @@ void LLFloaterSettingsPicker::onClose(bool app_quitting) { owner->setFocus(TRUE); } + mSettingItemID.setNull(); + mInventoryPanel->getRootFolder()->clearSelection(); } void LLFloaterSettingsPicker::setValue(const LLSD& value) @@ -302,8 +304,19 @@ void LLFloaterSettingsPicker::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr LLComboBox* track_selection = getChild(CMB_TRACK_SELECTION); track_selection->clear(); track_selection->removeall(); + if (!settings) + { + LL_WARNS() << "Failed to load asset " << asset_id << LL_ENDL; + return; + } LLSettingsDay::ptr_t pday = std::dynamic_pointer_cast(settings); + if (!pday) + { + LL_WARNS() << "Wrong asset type received by id " << asset_id << LL_ENDL; + return; + } + if (mTrackMode == TRACK_WATER) { track_selection->add(getString(STR_TRACK_WATER), LLSD::Integer(LLSettingsDay::TRACK_WATER), ADD_TOP, true); -- cgit v1.2.3 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 +++++++++++----------- indra/newview/llpanelenvironment.h | 3 --- .../default/xui/en/panel_region_environment.xml | 1 - 3 files changed, 14 insertions(+), 18 deletions(-) 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; } diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index 87ce0772b2..9eb4040758 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -85,7 +85,6 @@ protected: static const std::string STR_LABEL_USEDEFAULT; static const std::string STR_LABEL_USEREGION; - static const std::string STR_LABEL_UNKNOWNINV; static const std::string STR_ALTITUDE_DESCRIPTION; static const std::string STR_NO_PARCEL; static const std::string STR_CROSS_REGION; @@ -135,8 +134,6 @@ protected: virtual bool isLargeEnough() = 0; virtual void refreshFromSource() = 0; - std::string getInventoryNameForAssetId(LLUUID asset_id); - std::string getNameForTrackIndex(S32 index); LLFloaterSettingsPicker * getSettingsPicker(bool create = true); diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml index 77858ecbc4..bac27f7457 100644 --- a/indra/newview/skins/default/xui/en/panel_region_environment.xml +++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml @@ -11,7 +11,6 @@ width="530"> Use Default Settings Use Region Settings - Unknown Sky [INDEX]([ALTITUDE]m) No parcel is selected. Environmental settings are disabled. Environmental settings are not available across region boundries. -- cgit v1.2.3