Skip to content
Snippets Groups Projects
Commit b50faa9b authored by Rider Linden's avatar Rider Linden
Browse files

Merged in andreykproductengine/maint-eep (pull request #31)


MAINT-8886 EEP - Implement code for load button in fixed environment floater

Approved-by: default avatarSimon Linden <simon@lindenlab.com>
Approved-by: default avatarAndrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: default avatarRider Linden <rider@lindenlab.com>
parents c822d8af 3bbfd3c6
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "llsliderctrl.h" #include "llsliderctrl.h"
#include "lltabcontainer.h" #include "lltabcontainer.h"
#include "llfilepicker.h" #include "llfilepicker.h"
#include "llsettingspicker.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
...@@ -64,6 +65,7 @@ namespace ...@@ -64,6 +65,7 @@ namespace
const std::string BUTTON_NAME_COMMIT("btn_commit"); const std::string BUTTON_NAME_COMMIT("btn_commit");
const std::string BUTTON_NAME_CANCEL("btn_cancel"); const std::string BUTTON_NAME_CANCEL("btn_cancel");
const std::string BUTTON_NAME_FLYOUT("btn_flyout"); 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_SAVE("save_settings");
const std::string ACTION_SAVEAS("save_as_new_settings"); const std::string ACTION_SAVEAS("save_as_new_settings");
...@@ -102,6 +104,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() ...@@ -102,6 +104,7 @@ BOOL LLFloaterFixedEnvironment::postBuild()
getChild<LLButton>(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); 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_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 = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
...@@ -130,6 +133,8 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key) ...@@ -130,6 +133,8 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key)
void LLFloaterFixedEnvironment::onClose(bool app_quitting) void LLFloaterFixedEnvironment::onClose(bool app_quitting)
{ {
doCloseInventoryFloater(app_quitting);
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
...@@ -226,6 +231,12 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) ...@@ -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); }); [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) void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status)
{ {
if (!settings || status) if (!settings || status)
...@@ -283,6 +294,27 @@ void LLFloaterFixedEnvironment::onButtonCancel() ...@@ -283,6 +294,27 @@ void LLFloaterFixedEnvironment::onButtonCancel()
this->closeFloater(); 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() void LLFloaterFixedEnvironment::doApplyCreateNewInventory()
{ {
LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
...@@ -344,6 +376,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) ...@@ -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) 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; LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL;
......
...@@ -75,6 +75,7 @@ class LLFloaterFixedEnvironment : public LLFloater ...@@ -75,6 +75,7 @@ class LLFloaterFixedEnvironment : public LLFloater
virtual void doApplyCreateNewInventory(); virtual void doApplyCreateNewInventory();
virtual void doApplyUpdateInventory(); virtual void doApplyUpdateInventory();
virtual void doApplyEnvironment(const std::string &where); virtual void doApplyEnvironment(const std::string &where);
void doCloseInventoryFloater(bool quitting = false);
bool canUseInventory() const; bool canUseInventory() const;
bool canApplyRegion() const; bool canApplyRegion() const;
...@@ -84,6 +85,7 @@ class LLFloaterFixedEnvironment : public LLFloater ...@@ -84,6 +85,7 @@ class LLFloaterFixedEnvironment : public LLFloater
LLUUID mInventoryId; LLUUID mInventoryId;
LLInventoryItem * mInventoryItem; LLInventoryItem * mInventoryItem;
LLHandle<LLFloater> mInventoryFloater;
void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results); void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results); void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
...@@ -94,7 +96,9 @@ class LLFloaterFixedEnvironment : public LLFloater ...@@ -94,7 +96,9 @@ class LLFloaterFixedEnvironment : public LLFloater
void onButtonImport(); void onButtonImport();
void onButtonApply(LLUICtrl *ctrl, const LLSD &data); void onButtonApply(LLUICtrl *ctrl, const LLSD &data);
void onButtonCancel(); void onButtonCancel();
void onButtonLoad();
void onPickerCommitSetting(LLUUID asset_id);
void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status); void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment