summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2018-09-17 17:03:10 +0300
committermaxim_productengine <mnikolenko@productengine.com>2018-09-17 17:03:10 +0300
commit8f44ac231921cd7b83c0b0e47fbef0b6a52a0b57 (patch)
tree2573f3a01d18acd4dab048cd5b69a1e9be278705 /indra
parent636839a47c6881b10d676d19c65d6c34a956622a (diff)
SL-9664 FIXED [EEP] File pickers are not threaded
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp37
-rw-r--r--indra/newview/llfloatereditextdaycycle.h1
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp78
-rw-r--r--indra/newview/llfloaterfixedenvironment.h2
4 files changed, 61 insertions, 57 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 5bf34455bb..69623567d4 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -53,6 +53,7 @@
#include "llparcel.h"
#include "llflyoutcombobtn.h" //Todo: make a proper UI element/button/panel instead
#include "llregioninfomodel.h"
+#include "llviewermenufile.h" // LLFilePickerReplyThread
#include "llviewerregion.h"
#include "llpaneleditwater.h"
#include "llpaneleditsky.h"
@@ -1326,28 +1327,28 @@ void LLFloaterEditExtDayCycle::onInventoryUpdated(LLUUID asset_id, LLUUID invent
void LLFloaterEditExtDayCycle::doImportFromDisk()
{ // Load a a legacy Windlight XML from disk.
+ (new LLFilePickerReplyThread(boost::bind(&LLFloaterEditExtDayCycle::loadSettingFromFile, 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;
- LLSettingsDay::ptr_t legacyday = LLEnvironment::createDayCycleFromLegacyPreset(filename);
+void LLFloaterEditExtDayCycle::loadSettingFromFile(const std::vector<std::string>& filenames)
+{
+ if (filenames.size() < 1) return;
+ std::string filename = filenames[0];
+ LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL;
+ LLSettingsDay::ptr_t legacyday = LLEnvironment::createDayCycleFromLegacyPreset(filename);
- if (!legacyday)
- {
- LLSD args(LLSDMap("FILE", filename));
- LLNotificationsUtil::add("WLImportFail", args);
- return;
- }
+ if (!legacyday)
+ {
+ LLSD args(LLSDMap("FILE", filename));
+ LLNotificationsUtil::add("WLImportFail", args);
+ return;
+ }
- loadInventoryItem(LLUUID::null);
+ loadInventoryItem(LLUUID::null);
- mCurrentTrack = 1;
- setDirtyFlag();
- setEditDayCycle(legacyday);
- }
+ mCurrentTrack = 1;
+ setDirtyFlag();
+ setEditDayCycle(legacyday);
}
bool LLFloaterEditExtDayCycle::canUseInventory() const
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index f03a69c200..185b27bff3 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -136,6 +136,7 @@ private:
void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status);
void doImportFromDisk();
+ void loadSettingFromFile(const std::vector<std::string>& filenames);
void doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day);
void doApplyUpdateInventory(const LLSettingsDay::ptr_t &day);
void doApplyEnvironment(const std::string &where, const LLSettingsDay::ptr_t &day);
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);
}
//=========================================================================
diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h
index b7991ceb01..3181d4cbda 100644
--- a/indra/newview/llfloaterfixedenvironment.h
+++ b/indra/newview/llfloaterfixedenvironment.h
@@ -140,6 +140,7 @@ protected:
virtual void updateEditEnvironment() override;
virtual void doImportFromDisk() override;
+ void loadWaterSettingFromFile(const std::vector<std::string>& filenames);
private:
};
@@ -159,6 +160,7 @@ protected:
virtual void updateEditEnvironment() override;
virtual void doImportFromDisk() override;
+ void loadSkySettingFromFile(const std::vector<std::string>& filenames);
private:
};