diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-01 18:26:36 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-01 18:26:36 +0300 |
commit | 995a006b58f2be1d7236b32be3570b6d7250013b (patch) | |
tree | 475c135fca3d5c7ff89ecb70ead0a0a4ecccc3da /indra | |
parent | 6e2c05a512f498fe10aee307308e0365536f9819 (diff) |
STORM-1253 WIP Update UI when a day cycle gets added or deleted.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldaycyclemanager.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lldaycyclemanager.h | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterdeleteenvpreset.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloaterdeleteenvpreset.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloatereditdaycycle.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloatereditdaycycle.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterenvironmentsettings.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterenvironmentsettings.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.h | 2 |
10 files changed, 50 insertions, 0 deletions
diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp index 0cd23f5202..960879c32c 100644 --- a/indra/newview/lldaycyclemanager.cpp +++ b/indra/newview/lldaycyclemanager.cpp @@ -82,6 +82,7 @@ bool LLDayCycleManager::savePreset(const std::string& name, const LLSD& data) // Add it to our map. addPreset(name, data); + mModifySignal(); return true; } @@ -95,6 +96,7 @@ bool LLDayCycleManager::deletePreset(const std::string& name) if (gDirUtilp->fileExists(path)) { gDirUtilp->deleteFilesInDir(getUserDir(), filename); + mModifySignal(); return true; } @@ -102,6 +104,11 @@ bool LLDayCycleManager::deletePreset(const std::string& name) return false; } +boost::signals2::connection LLDayCycleManager::setModifyCallback(const modify_signal_t::slot_type& cb) +{ + return mModifySignal.connect(cb); +} + // virtual void LLDayCycleManager::initSingleton() { diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h index b33c0a0d39..0d4a474ac6 100644 --- a/indra/newview/lldaycyclemanager.h +++ b/indra/newview/lldaycyclemanager.h @@ -44,6 +44,7 @@ class LLDayCycleManager : public LLSingleton<LLDayCycleManager> public: typedef std::map<std::string, LLWLDayCycle> dc_map_t; + typedef boost::signals2::signal<void()> modify_signal_t; const dc_map_t& getPresets(); bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const; @@ -53,6 +54,9 @@ public: bool savePreset(const std::string& name, const LLSD& data); bool deletePreset(const std::string& name); + /// Emitted when a preset gets added or deleted. + boost::signals2::connection setModifyCallback(const modify_signal_t::slot_type& cb); + private: friend class LLSingleton<LLDayCycleManager>; /*virtual*/ void initSingleton(); @@ -66,6 +70,7 @@ private: static std::string getUserDir(); dc_map_t mDayCycleMap; + modify_signal_t mModifySignal; }; #endif // LL_LLDAYCYCLEMANAGER_H diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp index d2f0f6e520..d791c29a96 100644 --- a/indra/newview/llfloaterdeleteenvpreset.cpp +++ b/indra/newview/llfloaterdeleteenvpreset.cpp @@ -62,6 +62,8 @@ BOOL LLFloaterDeleteEnvPreset::postBuild() getChild<LLButton>("delete")->setCommitCallback(boost::bind(&LLFloaterDeleteEnvPreset::onBtnDelete, this)); getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterDeleteEnvPreset::onBtnCancel, this)); + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterDeleteEnvPreset::onDayCycleListChange, this)); + return TRUE; } @@ -193,5 +195,9 @@ void LLFloaterDeleteEnvPreset::populateDayCyclesList() void LLFloaterDeleteEnvPreset::onDeleteDayCycleConfirmation() { LLDayCycleManager::instance().deletePreset(mPresetCombo->getValue().asString()); +} + +void LLFloaterDeleteEnvPreset::onDayCycleListChange() +{ populateDayCyclesList(); } diff --git a/indra/newview/llfloaterdeleteenvpreset.h b/indra/newview/llfloaterdeleteenvpreset.h index 76b23feae8..aaa4143233 100644 --- a/indra/newview/llfloaterdeleteenvpreset.h +++ b/indra/newview/llfloaterdeleteenvpreset.h @@ -50,6 +50,7 @@ private: void populateDayCyclesList(); void onDeleteDayCycleConfirmation(); + void onDayCycleListChange(); LLComboBox* mPresetCombo; }; diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp index 8c85f6833b..f77e73c30b 100644 --- a/indra/newview/llfloatereditdaycycle.cpp +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -147,6 +147,9 @@ void LLFloaterEditDayCycle::initCallbacks(void) env_mgr.setRegionChangeCallback(boost::bind(&LLFloaterEditDayCycle::onRegionChange, this)); env_mgr.setRegionSettingsAppliedCallback(boost::bind(&LLFloaterEditDayCycle::onRegionSettingsApplied, this, _1)); + // Connect to day cycle manager events. + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleListChange, this)); + // Connect to region info updates. LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditDayCycle::onRegionInfoUpdate, this)); } @@ -758,6 +761,14 @@ void LLFloaterEditDayCycle::onSaveConfirmed() closeFloater(); } +void LLFloaterEditDayCycle::onDayCycleListChange() +{ + if (!isNewDay()) + { + refreshDayCyclesList(); + } +} + // static std::string LLFloaterEditDayCycle::getRegionName() { diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index 0a2ba32dfe..3b467b2939 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -103,6 +103,8 @@ private: bool onSaveAnswer(const LLSD& notification, const LLSD& response); void onSaveConfirmed(); + void onDayCycleListChange(); + static std::string getRegionName(); static bool canEditRegionSettings(); diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 35163d6230..7287a2beff 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -75,6 +75,8 @@ BOOL LLFloaterEnvironmentSettings::postBuild() setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEnvironmentSettings::onDayCycleListChange, this)); + return TRUE; } @@ -161,6 +163,11 @@ void LLFloaterEnvironmentSettings::onSelectDayCyclePreset() mDirty = true; } +void LLFloaterEnvironmentSettings::onDayCycleListChange() +{ + populateDayCyclePresetsList(); +} + void LLFloaterEnvironmentSettings::onBtnOK() { mDirty = false; diff --git a/indra/newview/llfloaterenvironmentsettings.h b/indra/newview/llfloaterenvironmentsettings.h index 0953ab4a65..6d29a5d4d5 100644 --- a/indra/newview/llfloaterenvironmentsettings.h +++ b/indra/newview/llfloaterenvironmentsettings.h @@ -50,6 +50,8 @@ private: void onSelectSkyPreset(); void onSelectDayCyclePreset(); + void onDayCycleListChange(); + void onBtnOK(); void onBtnCancel(); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 414695d40f..db1eae5835 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3293,6 +3293,8 @@ BOOL LLPanelEnvironmentInfo::postBuild() LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1)); + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLPanelEnvironmentInfo::onDayCycleListChange, this)); + return TRUE; } @@ -3747,3 +3749,8 @@ void LLPanelEnvironmentInfo::onRegionSettingsApplied(bool ok) LLEnvManagerNew::instance().requestRegionSettings(); } } + +void LLPanelEnvironmentInfo::onDayCycleListChange() +{ + populateDayCyclesList(); +} diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 6075842e76..4f5222eb34 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -471,6 +471,8 @@ private: void onRegionSettingschange(); void onRegionSettingsApplied(bool ok); + void onDayCycleListChange(); + bool mEnableEditing; LLRadioGroup* mRegionSettingsRadioGroup; |