aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwindlightremotectrl.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-08-11 09:56:54 -0700
committerMcCabe Maxsted2010-08-11 09:56:54 -0700
commitd0604362445f83d8d68c5be9b4eea184f24df3c9 (patch)
tree967bdc8abd749b963e5f147ee86316cf2f4b2b2b /linden/indra/newview/llwindlightremotectrl.cpp
parentFixed #384: build math button overlaps some UI text. This feedback is still c... (diff)
downloadmeta-impy-d0604362445f83d8d68c5be9b4eea184f24df3c9.zip
meta-impy-d0604362445f83d8d68c5be9b4eea184f24df3c9.tar.gz
meta-impy-d0604362445f83d8d68c5be9b4eea184f24df3c9.tar.bz2
meta-impy-d0604362445f83d8d68c5be9b4eea184f24df3c9.tar.xz
Fixed crash when logging into a region with progress screens disabled
Diffstat (limited to 'linden/indra/newview/llwindlightremotectrl.cpp')
-rw-r--r--linden/indra/newview/llwindlightremotectrl.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/linden/indra/newview/llwindlightremotectrl.cpp b/linden/indra/newview/llwindlightremotectrl.cpp
index b5c15a5..5a6b35d 100644
--- a/linden/indra/newview/llwindlightremotectrl.cpp
+++ b/linden/indra/newview/llwindlightremotectrl.cpp
@@ -58,10 +58,9 @@ private:
58}; 58};
59 59
60 60
61LLWindlightRemoteCtrl::LLWindlightRemoteCtrl() 61LLWindlightRemoteCtrl::LLWindlightRemoteCtrl() :
62 mObserver(NULL)
62{ 63{
63 mPresetsCombo = NULL;
64 mObserver = NULL;
65 setIsChrome(TRUE); 64 setIsChrome(TRUE);
66 65
67 build(); 66 build();
@@ -94,7 +93,7 @@ void LLWindlightRemoteCtrl::draw()
94 if (rlv_handler_t::isEnabled()) 93 if (rlv_handler_t::isEnabled())
95 { 94 {
96 childSetEnabled("Environment", !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)); 95 childSetEnabled("Environment", !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV));
97 mPresetsCombo->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)); 96 getChild<LLComboBox>("Presets")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV));
98 } 97 }
99// [/RLVA:KB] 98// [/RLVA:KB]
100 99
@@ -119,11 +118,11 @@ BOOL LLWindlightRemoteCtrl::postBuild()
119 childSetAction("Environment", onClickToggleEnvironment, this); 118 childSetAction("Environment", onClickToggleEnvironment, this);
120 childSetAction("Popup", onClickPopupBtn, this); 119 childSetAction("Popup", onClickPopupBtn, this);
121 120
122 mPresetsCombo = getChild<LLComboBox>("Presets"); 121 LLComboBox* presetsCombo = getChild<LLComboBox>("Presets");
123 if (mPresetsCombo) 122 if (presetsCombo)
124 { 123 {
125 mPresetsCombo->setCommitCallback(onCommitPreset); 124 presetsCombo->setCommitCallback(onCommitPreset);
126 mPresetsCombo->setCallbackUserData(this); 125 presetsCombo->setCallbackUserData(this);
127 126
128 // set up observer to follow changes 127 // set up observer to follow changes
129 mObserver = new LLWindlightRemoteObserver(this); 128 mObserver = new LLWindlightRemoteObserver(this);
@@ -144,42 +143,43 @@ void LLWindlightRemoteCtrl::refreshPresets()
144 return; 143 return;
145 } 144 }
146 145
147 if (mPresetsCombo) 146 LLComboBox* presetsCombo = getChild<LLComboBox>("Presets", TRUE, TRUE);
147 if (presetsCombo)
148 { 148 {
149 // snag current preset 149 // snag current preset
150 LLWLParamManager * param_mgr = LLWLParamManager::instance(); 150 LLWLParamManager * param_mgr = LLWLParamManager::instance();
151 LLWLParamSet& currentParams = param_mgr->mCurParams; 151 LLWLParamSet& currentParams = param_mgr->mCurParams;
152 152
153 // clear in case presets names have changed 153 // clear in case presets names have changed
154 mPresetsCombo->clearRows(); 154 presetsCombo->clearRows();
155 155
156 std::map<std::string, LLWLParamSet>::iterator mIt = 156 std::map<std::string, LLWLParamSet>::iterator mIt =
157 param_mgr->mParamList.begin(); 157 param_mgr->mParamList.begin();
158 for(; mIt != param_mgr->mParamList.end(); mIt++) 158 for(; mIt != param_mgr->mParamList.end(); mIt++)
159 { 159 {
160 mPresetsCombo->add(mIt->first); 160 presetsCombo->add(mIt->first);
161 } 161 }
162 162
163 // insert separator and add World menu options 163 // insert separator and add World menu options
164 // mPresetsCombo->addSeparator(ADD_BOTTOM); 164 // presetsCombo->addSeparator(ADD_BOTTOM);
165 // mPresetsCombo->addSimpleElement(getString("atmosphere"), ADD_BOTTOM); 165 // presetsCombo->addSimpleElement(getString("atmosphere"), ADD_BOTTOM);
166 // mPresetsCombo->addSimpleElement(getString("lighting"), ADD_BOTTOM); 166 // presetsCombo->addSimpleElement(getString("lighting"), ADD_BOTTOM);
167 // mPresetsCombo->addSimpleElement(getString("clouds"), ADD_BOTTOM); 167 // presetsCombo->addSimpleElement(getString("clouds"), ADD_BOTTOM);
168 // mPresetsCombo->addSimpleElement(getString("advanced_water"), ADD_BOTTOM); 168 // presetsCombo->addSimpleElement(getString("advanced_water"), ADD_BOTTOM);
169 mPresetsCombo->addSeparator(ADD_BOTTOM); 169 presetsCombo->addSeparator(ADD_BOTTOM);
170 mPresetsCombo->addSimpleElement(getString("sunrise"), ADD_BOTTOM); 170 presetsCombo->addSimpleElement(getString("sunrise"), ADD_BOTTOM);
171 mPresetsCombo->addSimpleElement(getString("noon"), ADD_BOTTOM); 171 presetsCombo->addSimpleElement(getString("noon"), ADD_BOTTOM);
172 mPresetsCombo->addSimpleElement(getString("sunset"), ADD_BOTTOM); 172 presetsCombo->addSimpleElement(getString("sunset"), ADD_BOTTOM);
173 mPresetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM); 173 presetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM);
174 mPresetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM); 174 presetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM);
175 175
176 if (!currentParams.mName.empty()) 176 if (!currentParams.mName.empty())
177 { 177 {
178 mPresetsCombo->selectByValue(LLSD(currentParams.mName)); 178 presetsCombo->selectByValue(LLSD(currentParams.mName));
179 } 179 }
180 else 180 else
181 { 181 {
182 mPresetsCombo->selectByValue(LLSD("Default")); 182 presetsCombo->selectByValue(LLSD("Default"));
183 } 183 }
184 } 184 }
185} 185}
@@ -189,7 +189,9 @@ void LLWindlightRemoteCtrl::onCommitPreset(LLUICtrl* ctrl, void* data)
189{ 189{
190 LLWindlightRemoteCtrl* self = (LLWindlightRemoteCtrl*)data; 190 LLWindlightRemoteCtrl* self = (LLWindlightRemoteCtrl*)data;
191 191
192 LLCtrlListInterface* presets = self->mPresetsCombo ? self->mPresetsCombo->getListInterface() : NULL; 192 LLComboBox* presetsCombo = self->getChild<LLComboBox>("Presets");
193
194 LLCtrlListInterface* presets = presetsCombo ? presetsCombo->getListInterface() : NULL;
193 if (presets) 195 if (presets)
194 { 196 {
195 S32 index = presets->getFirstSelectedIndex(); 197 S32 index = presets->getFirstSelectedIndex();
@@ -201,7 +203,7 @@ void LLWindlightRemoteCtrl::onCommitPreset(LLUICtrl* ctrl, void* data)
201 } 203 }
202 204
203 // check for World menu options; if none, apply preset 205 // check for World menu options; if none, apply preset
204 std::string selected = self->mPresetsCombo->getSelectedValue().asString(); 206 std::string selected = presetsCombo->getSelectedValue().asString();
205 207
206 if (selected == self->getString("atmosphere")) 208 if (selected == self->getString("atmosphere"))
207 { 209 {