summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-06-14 18:04:29 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-06-14 18:04:29 +0300
commitab431d1774d5b282836a3327dd0bfa8b3b91632b (patch)
tree22e89504eb196f0310b5473d299950c8ea8476f6 /indra/newview
parent4fd946fa3e5217b8f64e0fcd91d268c7eaf1bbf5 (diff)
STORM-1305 WIP User day cycles now go first in all lists.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldaycyclemanager.cpp36
-rw-r--r--indra/newview/lldaycyclemanager.h7
-rw-r--r--indra/newview/llenvmanager.cpp7
-rw-r--r--indra/newview/llfloaterdeleteenvpreset.cpp14
-rw-r--r--indra/newview/llfloatereditdaycycle.cpp21
-rw-r--r--indra/newview/llfloaterenvironmentsettings.cpp20
-rw-r--r--indra/newview/llfloaterregioninfo.cpp22
7 files changed, 96 insertions, 31 deletions
diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp
index ab442d7c83..347a467a8b 100644
--- a/indra/newview/lldaycyclemanager.cpp
+++ b/indra/newview/lldaycyclemanager.cpp
@@ -30,12 +30,40 @@
#include "lldiriterator.h"
-const LLDayCycleManager::dc_map_t& LLDayCycleManager::getPresets()
+void LLDayCycleManager::getPresetNames(preset_name_list_t& names) const
{
- // Refresh day cycles.
- loadAllPresets();
+ names.clear();
+
+ for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it)
+ {
+ names.push_back(it->first);
+ }
+}
+
+void LLDayCycleManager::getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const
+{
+ user.clear();
+ sys.clear();
- return mDayCycleMap;
+ for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it)
+ {
+ const std::string& name = it->first;
+
+ if (isSystemPreset(name))
+ {
+ sys.push_back(name);
+ }
+ else
+ {
+ user.push_back(name);
+ }
+ }
+}
+
+void LLDayCycleManager::getUserPresetNames(preset_name_list_t& user) const
+{
+ preset_name_list_t sys; // unused
+ getPresetNames(user, sys);
}
bool LLDayCycleManager::getPreset(const std::string name, LLWLDayCycle& day_cycle) const
diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h
index 032e336491..3d2144960d 100644
--- a/indra/newview/lldaycyclemanager.h
+++ b/indra/newview/lldaycyclemanager.h
@@ -43,10 +43,15 @@ class LLDayCycleManager : public LLSingleton<LLDayCycleManager>
LOG_CLASS(LLDayCycleManager);
public:
+ typedef std::list<std::string> preset_name_list_t;
+
typedef std::map<std::string, LLWLDayCycle> dc_map_t;
typedef boost::signals2::signal<void()> modify_signal_t;
- const dc_map_t& getPresets();
+ void getPresetNames(preset_name_list_t& names) const;
+ void getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const;
+ void getUserPresetNames(preset_name_list_t& user) const;
+
bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const;
bool getPreset(const std::string name, LLSD& day_cycle) const;
bool presetExists(const std::string name) const;
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index c08ef34685..4051a4d8db 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -918,10 +918,11 @@ void LLEnvManagerNew::dumpPresets()
{
LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
}
- const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
- for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ LLDayCycleManager::preset_name_list_t days;
+ LLDayCycleManager::instance().getPresetNames(days);
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = days.begin(); it != days.end(); ++it)
{
- LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
+ LL_DEBUGS("Windlight") << " - " << *it << LL_ENDL;
}
}
diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp
index cd9f46e5a2..4fefd2242a 100644
--- a/indra/newview/llfloaterdeleteenvpreset.cpp
+++ b/indra/newview/llfloaterdeleteenvpreset.cpp
@@ -244,17 +244,11 @@ void LLFloaterDeleteEnvPreset::populateDayCyclesList()
}
LLDayCycleManager& day_mgr = LLDayCycleManager::instance();
- const LLDayCycleManager::dc_map_t& map = day_mgr.getPresets();
- for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ LLDayCycleManager::preset_name_list_t user_days;
+ day_mgr.getUserPresetNames(user_days); // list only user presets
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it)
{
- const std::string& name = it->first;
-
- // list only user presets
- if (day_mgr.isSystemPreset(name))
- {
- continue;
- }
-
+ const std::string& name = *it;
mPresetCombo->add(name, ADD_BOTTOM, name != cur_day);
}
diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp
index 4f4739384d..165b271133 100644
--- a/indra/newview/llfloatereditdaycycle.cpp
+++ b/indra/newview/llfloatereditdaycycle.cpp
@@ -287,11 +287,24 @@ void LLFloaterEditDayCycle::refreshDayCyclesList()
}
#endif
- const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
- for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ LLDayCycleManager::preset_name_list_t user_days, sys_days;
+ LLDayCycleManager::instance().getPresetNames(user_days, sys_days);
+
+ // Add user days.
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it)
{
- LLWLParamKey key(it->first, LLEnvKey::SCOPE_LOCAL);
- mDayCyclesCombo->add(key.name, key.toLLSD());
+ mDayCyclesCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD());
+ }
+
+ if (user_days.size() > 0)
+ {
+ mDayCyclesCombo->addSeparator();
+ }
+
+ // Add system days.
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it)
+ {
+ mDayCyclesCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD());
}
mDayCyclesCombo->setLabel(getString("combo_label"));
diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp
index e8d123a955..4dbc8cdee0 100644
--- a/indra/newview/llfloaterenvironmentsettings.cpp
+++ b/indra/newview/llfloaterenvironmentsettings.cpp
@@ -260,9 +260,23 @@ void LLFloaterEnvironmentSettings::populateDayCyclePresetsList()
{
mDayCyclePresetCombo->removeall();
- const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
- for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ LLDayCycleManager::preset_name_list_t user_days, sys_days;
+ LLDayCycleManager::instance().getPresetNames(user_days, sys_days);
+
+ // Add user days.
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it)
+ {
+ mDayCyclePresetCombo->add(*it);
+ }
+
+ if (user_days.size() > 0)
+ {
+ mDayCyclePresetCombo->addSeparator();
+ }
+
+ // Add system days.
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it)
{
- mDayCyclePresetCombo->add(it->first);
+ mDayCyclePresetCombo->add(*it);
}
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 3734e5e280..4535ad0240 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3504,13 +3504,23 @@ void LLPanelEnvironmentInfo::populateDayCyclesList()
mDayCyclePresetCombo->addSeparator();
}
- // Add local day cycles.
- const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
- for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ // Add local user day cycles.
+ LLDayCycleManager::preset_name_list_t user_days, sys_days;
+ LLDayCycleManager::instance().getPresetNames(user_days, sys_days);
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it)
{
- std::string name = it->first;
- LLWLParamKey key(name, LLEnvKey::SCOPE_LOCAL);
- mDayCyclePresetCombo->add(name, key.toStringVal());
+ mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
+ }
+
+ if (user_days.size() > 0)
+ {
+ mDayCyclePresetCombo->addSeparator();
+ }
+
+ // Add local system day cycles.
+ for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it)
+ {
+ mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
}
// Current day cycle is already selected.