summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-07-25 17:39:45 +0000
committerRider Linden <rider@lindenlab.com>2018-07-25 17:39:45 +0000
commitb50faa9b6fecf85fee40f1777f17abe604f1fbb0 (patch)
tree33beee3dc867c9d84631e6b06801f747e7b8a303
parentc822d8af16428cf245ae57305a4f39d3fccd672b (diff)
parent3bbfd3c676e098f986aad887fe24c7a4dbfd84c4 (diff)
Merged in andreykproductengine/maint-eep (pull request #31)
MAINT-8886 EEP - Implement code for load button in fixed environment floater Approved-by: Simon Linden <simon@lindenlab.com> Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com> Approved-by: Rider Linden <rider@lindenlab.com>
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp42
-rw-r--r--indra/newview/llfloaterfixedenvironment.h4
2 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index fd72bb3624..0b4de90703 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -37,6 +37,7 @@
#include "llsliderctrl.h"
#include "lltabcontainer.h"
#include "llfilepicker.h"
+#include "llsettingspicker.h"
#include "llviewerparcelmgr.h"
@@ -64,6 +65,7 @@ namespace
const std::string BUTTON_NAME_COMMIT("btn_commit");
const std::string BUTTON_NAME_CANCEL("btn_cancel");
const std::string BUTTON_NAME_FLYOUT("btn_flyout");
+ const std::string BUTTON_NAME_LOAD("btn_load");
const std::string ACTION_SAVE("save_settings");
const std::string ACTION_SAVEAS("save_as_new_settings");
@@ -102,6 +104,7 @@ BOOL LLFloaterFixedEnvironment::postBuild()
getChild<LLButton>(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); });
getChild<LLButton>(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); });
+ getChild<LLButton>(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); });
mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
@@ -130,6 +133,8 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key)
void LLFloaterFixedEnvironment::onClose(bool app_quitting)
{
+ doCloseInventoryFloater(app_quitting);
+
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
@@ -226,6 +231,12 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId)
[this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); });
}
+void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id)
+{
+ LLSettingsVOBase::getSettingsAsset(asset_id,
+ [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); });
+}
+
void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status)
{
if (!settings || status)
@@ -283,6 +294,27 @@ void LLFloaterFixedEnvironment::onButtonCancel()
this->closeFloater();
}
+void LLFloaterFixedEnvironment::onButtonLoad()
+{
+ // LLUI::sWindow->setCursor(UI_CURSOR_WAIT);
+ LLFloaterSettingsPicker *picker = static_cast<LLFloaterSettingsPicker *>(mInventoryFloater.get());
+
+ // Show the dialog
+ if (!picker)
+ {
+ picker = new LLFloaterSettingsPicker(this,
+ LLUUID::null, "SELECT SETTINGS");
+
+ mInventoryFloater = picker->getHandle();
+
+ picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data.asUUID()); });
+ }
+
+ picker->setSettingsFilter(mSettings->getSettingsTypeValue());
+ picker->openFloater();
+ picker->setFocus(TRUE);
+}
+
void LLFloaterFixedEnvironment::doApplyCreateNewInventory()
{
LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
@@ -344,6 +376,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
}
+void LLFloaterFixedEnvironment::doCloseInventoryFloater(bool quitting)
+{
+ LLFloater* floaterp = mInventoryFloater.get();
+
+ if (floaterp)
+ {
+ floaterp->closeFloater(quitting);
+ }
+}
+
void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
{
LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL;
diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h
index ef47941555..f3b14c2daf 100644
--- a/indra/newview/llfloaterfixedenvironment.h
+++ b/indra/newview/llfloaterfixedenvironment.h
@@ -75,6 +75,7 @@ protected:
virtual void doApplyCreateNewInventory();
virtual void doApplyUpdateInventory();
virtual void doApplyEnvironment(const std::string &where);
+ void doCloseInventoryFloater(bool quitting = false);
bool canUseInventory() const;
bool canApplyRegion() const;
@@ -84,6 +85,7 @@ protected:
LLUUID mInventoryId;
LLInventoryItem * mInventoryItem;
+ LLHandle<LLFloater> mInventoryFloater;
void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
@@ -94,7 +96,9 @@ private:
void onButtonImport();
void onButtonApply(LLUICtrl *ctrl, const LLSD &data);
void onButtonCancel();
+ void onButtonLoad();
+ void onPickerCommitSetting(LLUUID asset_id);
void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status);
};