diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 42 | ||||
| -rw-r--r-- | indra/newview/llfloaterfixedenvironment.h | 4 | 
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);  };  | 
