diff options
author | Graham Linden <graham@lindenlab.com> | 2019-03-08 09:17:14 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-03-08 09:17:14 -0800 |
commit | 0d32b5bf20990a6afa1697469c1f301b902258ad (patch) | |
tree | 2fc9fb4eb7a94df739e40bf1c1c886ec11fe59c1 | |
parent | 53f3755a4629206754a5695de233d88062a54d3d (diff) | |
parent | a237325ad64d0930340e2a6f82d4042797ed8e68 (diff) |
Merge
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.h | 3 | ||||
-rw-r--r-- | indra/newview/llsettingspicker.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_environment.xml | 1 |
5 files changed, 28 insertions, 26 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/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/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<LLComboBox>(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<LLSettingsDay>(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); 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"> <string name="str_label_use_default">Use Default Settings</string> <string name="str_label_use_region">Use Region Settings</string> - <string name="str_unknow_inventory">Unknown</string> <string name="str_altitude_desription">Sky [INDEX]([ALTITUDE]m)</string> <string name="str_no_parcel">No parcel is selected. Environmental settings are disabled.</string> <string name="str_cross_region">Environmental settings are not available across region boundries.</string> |