summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-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
-rw-r--r--indra/newview/llsettingspicker.cpp31
-rw-r--r--indra/newview/llsettingspicker.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_environment.xml2
7 files changed, 95 insertions, 57 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 5bf34455bb..4be0e30c62 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:
};
diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp
index 06d54825e7..f72c7c5dcf 100644
--- a/indra/newview/llsettingspicker.cpp
+++ b/indra/newview/llsettingspicker.cpp
@@ -302,6 +302,37 @@ void LLFloaterSettingsPicker::onButtonSelect()
closeFloater();
}
+BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ if (mSettingAssetID.notNull()
+ && mInventoryPanel)
+ {
+ LLUUID item_id = findItemID(mSettingAssetID, FALSE);
+ S32 inventory_x = x - mInventoryPanel->getRect().mLeft;
+ S32 inventory_y = y - mInventoryPanel->getRect().mBottom;
+ if (item_id.notNull()
+ && mInventoryPanel->parentPointInView(inventory_x, inventory_y))
+ {
+ // make sure item (not folder) is selected
+ LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(item_id);
+ if (item_viewp && item_viewp->isSelected())
+ {
+ LLRect target_rect;
+ item_viewp->localRectToOtherView(item_viewp->getLocalRect(), &target_rect, this);
+ if (target_rect.pointInRect(x, y))
+ {
+ // Quick-apply
+ if (mCommitSignal)
+ (*mCommitSignal)(this, LLSD(mSettingAssetID));
+ closeFloater();
+ return TRUE;
+ }
+ }
+ }
+ }
+ return LLFloater::handleDoubleClick(x, y, mask);
+}
+
//=========================================================================
void LLFloaterSettingsPicker::setActive(bool active)
{
diff --git a/indra/newview/llsettingspicker.h b/indra/newview/llsettingspicker.h
index a58fa38ed0..2faefefd4a 100644
--- a/indra/newview/llsettingspicker.h
+++ b/indra/newview/llsettingspicker.h
@@ -96,6 +96,7 @@ private:
void onSelectionChange(const itemlist_t &items, bool user_action);
void onButtonCancel();
void onButtonSelect();
+ virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
LLHandle<LLView> mOwnerHandle;
diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml
index 3ce0d7a2ef..cfb142093a 100644
--- a/indra/newview/skins/default/xui/en/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml
@@ -21,6 +21,7 @@
height="367"
follows="all"
layout="topleft"
+ animate="false"
orientation="vertical">
<layout_panel
auto_resize="true"
@@ -50,6 +51,7 @@
bottom="-1"
layout="topleft"
follows="all"
+ animate="false"
orientation="horizontal">
<layout_panel
background_visible="true"