From 89884ed1465ed4baf811e05172dd13f9af97bcbb Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 2 May 2019 12:58:48 +0300 Subject: SL-11057 Revert SL-10893 change to restore "Show All Folders" --- indra/newview/llfloatermyenvironment.cpp | 16 ++++++++++++++++ indra/newview/llfloatermyenvironment.h | 2 ++ .../skins/default/xui/en/floater_my_environments.xml | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 8c2772a87d..af71329607 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -49,6 +49,7 @@ namespace const std::string CHECK_WATER("chk_water"); const std::string FLT_SEARCH("flt_search"); const std::string PANEL_SETTINGS("pnl_settings"); + const std::string CHECK_SHOWFOLDERS("chk_showfolders"); const std::string BUTTON_NEWSETTINGS("btn_gear"); const std::string BUTTON_GEAR("btn_newsettings"); const std::string BUTTON_DELETE("btn_del"); @@ -76,6 +77,7 @@ namespace LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) : LLFloater(key), mInventoryList(nullptr), + mShowFolders(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS), mTypeFilter((0x01 << static_cast(LLSettingsType::ST_DAYCYCLE)) | (0x01 << static_cast(LLSettingsType::ST_SKY)) | (0x01 << static_cast(LLSettingsType::ST_WATER))), mSelectedAsset() { @@ -107,12 +109,14 @@ BOOL LLFloaterMyEnvironment::postBuild() mInventoryList->setFilterTypes(filter_types); mInventoryList->setSelectCallback([this](const std::deque&, BOOL) { onSelectionChange(); }); + mInventoryList->setShowFolderState(mShowFolders); mInventoryList->setFilterSettingsTypes(mTypeFilter); } childSetCommitCallback(CHECK_DAYS, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr); childSetCommitCallback(CHECK_SKIES, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr); childSetCommitCallback(CHECK_WATER, [this](LLUICtrl*, void*) { onFilterCheckChange(); }, nullptr); + childSetCommitCallback(CHECK_SHOWFOLDERS, [this](LLUICtrl*, void*) { onShowFoldersChange(); }, nullptr); mFilterEdit = getChild(FLT_SEARCH); mFilterEdit->setCommitCallback([this](LLUICtrl*, const LLSD& param){ onFilterEdit(param.asString()); }); @@ -124,6 +128,8 @@ BOOL LLFloaterMyEnvironment::postBuild() void LLFloaterMyEnvironment::refresh() { + getChild(CHECK_SHOWFOLDERS)->setValue(LLSD::Boolean(mShowFolders == LLInventoryFilter::SHOW_ALL_FOLDERS)); + getChild(CHECK_DAYS)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast(LLSettingsType::ST_DAYCYCLE)))); getChild(CHECK_SKIES)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast(LLSettingsType::ST_SKY)))); getChild(CHECK_WATER)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast(LLSettingsType::ST_WATER)))); @@ -156,6 +162,16 @@ void LLFloaterMyEnvironment::onOpen(const LLSD& key) } //------------------------------------------------------------------------- +void LLFloaterMyEnvironment::onShowFoldersChange() +{ + bool show_check(getChild(CHECK_SHOWFOLDERS)->getValue().asBoolean()); + + mShowFolders = (show_check) ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS; + + if (mInventoryList) + mInventoryList->setShowFolderState(mShowFolders); +} + void LLFloaterMyEnvironment::onFilterCheckChange() { mTypeFilter = 0x0; diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 67e35343da..fea0981590 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -52,9 +52,11 @@ private: LLInventoryPanel * mInventoryList; LLFilterEditor * mFilterEdit; U64 mTypeFilter; + LLInventoryFilter::EFolderShow mShowFolders; LLUUID mSelectedAsset; LLSaveFolderState mSavedFolderState; + void onShowFoldersChange(); void onFilterCheckChange(); void onFilterEdit(const std::string& search_string); void onSelectionChange(); diff --git a/indra/newview/skins/default/xui/en/floater_my_environments.xml b/indra/newview/skins/default/xui/en/floater_my_environments.xml index 7e65e5d69c..46894ded80 100644 --- a/indra/newview/skins/default/xui/en/floater_my_environments.xml +++ b/indra/newview/skins/default/xui/en/floater_my_environments.xml @@ -123,6 +123,22 @@ + + +