diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-09-17 17:03:10 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-09-17 17:03:10 +0300 |
commit | 8f44ac231921cd7b83c0b0e47fbef0b6a52a0b57 (patch) | |
tree | 2573f3a01d18acd4dab048cd5b69a1e9be278705 /indra/newview/llfloaterfixedenvironment.cpp | |
parent | 636839a47c6881b10d676d19c65d6c34a956622a (diff) |
SL-9664 FIXED [EEP] File pickers are not threaded
Diffstat (limited to 'indra/newview/llfloaterfixedenvironment.cpp')
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 09a05eb7e2..45662cb37b 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -38,7 +38,7 @@ #include "lltabcontainer.h" #include "llfilepicker.h" #include "llsettingspicker.h" - +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewerparcelmgr.h" // newview @@ -581,30 +581,29 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key) void LLFloaterFixedEnvironmentWater::doImportFromDisk() { // Load a a legacy Windlight XML from disk. + (new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); +} - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); - - LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; - LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); - - if (!legacywater) - { - LLSD args(LLSDMap("FILE", filename)); - LLNotificationsUtil::add("WLImportFail", args); - return; - } +void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector<std::string>& filenames) +{ + if (filenames.size() < 1) return;
+ std::string filename = filenames[0]; + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); - loadInventoryItem(LLUUID::null); + if (!legacywater) + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); + return; + } - setDirtyFlag(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); - setEditSettings(legacywater); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + loadInventoryItem(LLUUID::null); - } + setDirtyFlag(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); + setEditSettings(legacywater); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } //========================================================================= @@ -669,30 +668,31 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) void LLFloaterFixedEnvironmentSky::doImportFromDisk() { // Load a a legacy Windlight XML from disk. + (new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentSky::loadSkySettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); +} - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); +void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector<std::string>& filenames) +{ + if (filenames.size() < 1) return;
+ std::string filename = filenames[0]; - LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; - LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); - if (!legacysky) - { - LLSD args(LLSDMap("FILE", filename)); - LLNotificationsUtil::add("WLImportFail", args); + if (!legacysky) + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); - return; - } + return; + } - loadInventoryItem(LLUUID::null); + loadInventoryItem(LLUUID::null); - clearDirtyFlag(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); - setEditSettings(legacysky); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); - } + clearDirtyFlag(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); + setEditSettings(legacysky); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } //========================================================================= |