summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-06-28 17:06:49 -0700
committerRider Linden <rider@lindenlab.com>2018-06-28 17:06:49 -0700
commit19069ce25c30f6744310e015dbf767954efbd8ae (patch)
tree99791a0d1345efa1faabc7aedcb3d96cab1e4202 /indra
parent1eda16b31989448a211808a8144f0a5ffb0bce49 (diff)
Creating settings objects in the correct folders. Correctly check if clouds paused.
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llfoldertype.cpp2
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp11
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp10
-rw-r--r--indra/newview/llinventorypanel.cpp1
-rw-r--r--indra/newview/llsettingsvo.cpp5
-rw-r--r--indra/newview/llsettingsvo.h2
-rw-r--r--indra/newview/llviewerinventory.cpp6
-rw-r--r--indra/newview/llviewermenu.cpp18
8 files changed, 33 insertions, 22 deletions
diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp
index 067b22ee27..7241b3c0c2 100644
--- a/indra/llinventory/llfoldertype.cpp
+++ b/indra/llinventory/llfoldertype.cpp
@@ -100,7 +100,7 @@ LLFolderDictionary::LLFolderDictionary()
addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE));
addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE));
- addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", FALSE));
+ addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", TRUE));
addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE));
};
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 940933955d..827e1d992d 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -981,15 +981,20 @@ void LLFloaterEditExtDayCycle::reblendSettings()
void LLFloaterEditExtDayCycle::doApplyCreateNewInventory()
{
// This method knows what sort of settings object to create.
- LLSettingsVOBase::createInventoryItem(mEditDay, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
+
+ LLSettingsVOBase::createInventoryItem(mEditDay, parent_id,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
}
void LLFloaterEditExtDayCycle::doApplyUpdateInventory()
{
if (mInventoryId.isNull())
- LLSettingsVOBase::createInventoryItem(mEditDay, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ LLSettingsVOBase::createInventoryItem(mEditDay, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS),
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
else
- LLSettingsVOBase::updateInventoryItem(mEditDay, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
+ LLSettingsVOBase::updateInventoryItem(mEditDay, mInventoryId,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
}
void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where)
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index be7b55bd45..d926697117 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -270,16 +270,20 @@ void LLFloaterFixedEnvironment::onButtonCancel()
void LLFloaterFixedEnvironment::doApplyCreateNewInventory()
{
+ LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
// This method knows what sort of settings object to create.
- LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ LLSettingsVOBase::createInventoryItem(mSettings, parent_id,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
}
void LLFloaterFixedEnvironment::doApplyUpdateInventory()
{
if (mInventoryId.isNull())
- LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS),
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
else
- LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
+ LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId,
+ [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
}
void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 46ae200a1c..b60999e64a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1729,6 +1729,7 @@ namespace LLInitParam
declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX);
declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX);
declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT);
+ declare(LLFolderType::lookup(LLFolderType::FT_SETTINGS) , LLFolderType::FT_SETTINGS);
declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS);
declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK);
declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_VERSION), LLFolderType::FT_MARKETPLACE_VERSION);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 646b317325..e2c8652f47 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -90,10 +90,9 @@ namespace
//=========================================================================
-void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback)
+void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, inventory_result_fn callback)
{
LLTransactionID tid;
- LLUUID parentFolder; //= gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner();
tid.generate();
@@ -103,7 +102,7 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
});
create_inventory_settings(gAgent.getID(), gAgent.getSessionID(),
- parentFolder, tid,
+ parent_id, tid,
settings->getName(), "new settings collection.",
settings->getSettingsTypeValue(), nextOwnerPerm, cb);
}
diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h
index 7d68586fa0..5d62edd867 100644
--- a/indra/newview/llsettingsvo.h
+++ b/indra/newview/llsettingsvo.h
@@ -47,7 +47,7 @@ public:
typedef std::function<void(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat extstat)> asset_download_fn;
typedef std::function<void(LLUUID asset_id, LLUUID inventory_id, LLUUID object_id, LLSD results)> inventory_result_fn;
- static void createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback = inventory_result_fn());
+ static void createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, inventory_result_fn callback = inventory_result_fn());
static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn());
static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn());
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index ec457c1b5d..09b07b83b8 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1823,8 +1823,6 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
}
else if (("sky" == type_name) || ("water" == type_name) || ("daycycle" == type_name))
{
- LL_WARNS("LAPRAS") << "Creating settings object of type: '" << type_name << "'" << LL_ENDL;
-
LLSettingsBase::ptr_t settings;
std::string name;
@@ -1852,8 +1850,10 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
return;
}
+ LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
+
settings->setName(name);
- LLSettingsVOBase::createInventoryItem(settings);
+ LLSettingsVOBase::createInventoryItem(settings, parent_id);
}
else
{
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3688f6614f..e992cce26e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -8445,6 +8445,11 @@ class LLWorldEnableEnvSettings : public view_listener_t
bool result = false;
std::string tod = userdata.asString();
+ if (tod == "pauseclouds")
+ {
+ return LLEnvironment::instance().isCloudScrollPaused();
+ }
+
LLSettingsSky::ptr_t sky = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL);
if (!sky)
@@ -8453,31 +8458,28 @@ class LLWorldEnableEnvSettings : public view_listener_t
}
std::string skyname = (sky) ? sky->getName() : "";
+ LLUUID skyid = (sky) ? sky->getAssetId() : LLUUID::null;
if (tod == "sunrise")
{
- result = (skyname == "Sunrise");
+ result = (skyid == LLEnvironment::KNOWN_SKY_SUNRISE);
}
else if (tod == "noon")
{
- result = (skyname == "Midday");
+ result = (skyid == LLEnvironment::KNOWN_SKY_MIDDAY);
}
else if (tod == "sunset")
{
- result = (skyname == "Sunset");
+ result = (skyid == LLEnvironment::KNOWN_SKY_SUNSET);
}
else if (tod == "midnight")
{
- result = (skyname == "Midnight");
+ result = (skyid == LLEnvironment::KNOWN_SKY_MIDNIGHT);
}
else if (tod == "region")
{
return false;
}
- else if (tod == "pauseclouds")
- {
- return LLEnvironment::instance().isCloudScrollPaused();
- }
else
{
LL_WARNS() << "Unknown time-of-day item: " << tod << LL_ENDL;