summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermyenvironment.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-05-02 12:58:48 +0300
committermaxim_productengine <mnikolenko@productengine.com>2019-05-02 12:58:48 +0300
commit89884ed1465ed4baf811e05172dd13f9af97bcbb (patch)
treebee6ca1126f196cbd1055cf356a80252a00fd678 /indra/newview/llfloatermyenvironment.cpp
parent7393c6f32886934dffd34c40c6e3f722f5dd721c (diff)
SL-11057 Revert SL-10893 change to restore "Show All Folders"
Diffstat (limited to 'indra/newview/llfloatermyenvironment.cpp')
-rw-r--r--indra/newview/llfloatermyenvironment.cpp16
1 files changed, 16 insertions, 0 deletions
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<U64>(LLSettingsType::ST_DAYCYCLE)) | (0x01 << static_cast<U64>(LLSettingsType::ST_SKY)) | (0x01 << static_cast<U64>(LLSettingsType::ST_WATER))),
mSelectedAsset()
{
@@ -107,12 +109,14 @@ BOOL LLFloaterMyEnvironment::postBuild()
mInventoryList->setFilterTypes(filter_types);
mInventoryList->setSelectCallback([this](const std::deque<LLFolderViewItem*>&, 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<LLFilterEditor>(FLT_SEARCH);
mFilterEdit->setCommitCallback([this](LLUICtrl*, const LLSD& param){ onFilterEdit(param.asString()); });
@@ -124,6 +128,8 @@ BOOL LLFloaterMyEnvironment::postBuild()
void LLFloaterMyEnvironment::refresh()
{
+ getChild<LLCheckBoxCtrl>(CHECK_SHOWFOLDERS)->setValue(LLSD::Boolean(mShowFolders == LLInventoryFilter::SHOW_ALL_FOLDERS));
+
getChild<LLCheckBoxCtrl>(CHECK_DAYS)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_DAYCYCLE))));
getChild<LLCheckBoxCtrl>(CHECK_SKIES)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_SKY))));
getChild<LLCheckBoxCtrl>(CHECK_WATER)->setValue(LLSD::Boolean(mTypeFilter & (0x01 << static_cast<U64>(LLSettingsType::ST_WATER))));
@@ -156,6 +162,16 @@ void LLFloaterMyEnvironment::onOpen(const LLSD& key)
}
//-------------------------------------------------------------------------
+void LLFloaterMyEnvironment::onShowFoldersChange()
+{
+ bool show_check(getChild<LLCheckBoxCtrl>(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;