diff options
author | Armin Weatherwax | 2011-04-10 11:51:41 +0200 |
---|---|---|
committer | McCabe Maxsted | 2011-04-19 17:50:49 -0700 |
commit | 96f007a9f0e83a62492366c66f5ad3ecdf483c4a (patch) | |
tree | 674b6077b554e1647202fda5d561cbe24824808e /linden/indra/newview/llprefsadvanced.cpp | |
parent | add some basic cloud preferences in prefs > advanced >eye candy - please revi... (diff) | |
download | meta-impy-96f007a9f0e83a62492366c66f5ad3ecdf483c4a.zip meta-impy-96f007a9f0e83a62492366c66f5ad3ecdf483c4a.tar.gz meta-impy-96f007a9f0e83a62492366c66f5ad3ecdf483c4a.tar.bz2 meta-impy-96f007a9f0e83a62492366c66f5ad3ecdf483c4a.tar.xz |
fix some flaws in the cloud particle prefs
Diffstat (limited to 'linden/indra/newview/llprefsadvanced.cpp')
-rw-r--r-- | linden/indra/newview/llprefsadvanced.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index ad60694..f1b2428 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp | |||
@@ -119,7 +119,7 @@ BOOL LLPrefsAdvanced::postBuild() | |||
119 | getChild<LLButton>("ac_button")->setClickedCallback(onAutoCorrectButton,this); | 119 | getChild<LLButton>("ac_button")->setClickedCallback(onAutoCorrectButton,this); |
120 | initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck"); | 120 | initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck"); |
121 | 121 | ||
122 | 122 | getChild<LLButton>("reset_cloud_this_account")->setClickedCallback(onResetThisCloudButton,this); | |
123 | getChild<LLButton>("save_cloud_this_account")->setClickedCallback(onSaveThisCloudButton,this); | 123 | getChild<LLButton>("save_cloud_this_account")->setClickedCallback(onSaveThisCloudButton,this); |
124 | getChild<LLButton>("save_cloud_any_account")->setClickedCallback(onSaveAnyoneCloudButton,this); | 124 | getChild<LLButton>("save_cloud_any_account")->setClickedCallback(onSaveAnyoneCloudButton,this); |
125 | 125 | ||
@@ -214,8 +214,11 @@ void LLPrefsAdvanced::apply() | |||
214 | 214 | ||
215 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); | 215 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); |
216 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); | 216 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); |
217 | 217 | ||
218 | onSaveThisCloudButton(NULL); | 218 | if (LLStartUp::isLoggedIn() && LLVOAvatar::sHasCloud) |
219 | { | ||
220 | onSaveThisCloudButton(NULL); | ||
221 | } | ||
219 | } | 222 | } |
220 | 223 | ||
221 | void LLPrefsAdvanced::cancel() | 224 | void LLPrefsAdvanced::cancel() |
@@ -344,13 +347,15 @@ void LLPrefsAdvanced::draw() | |||
344 | 347 | ||
345 | void LLPrefsAdvanced::setParticleControls(bool is_logged_in) | 348 | void LLPrefsAdvanced::setParticleControls(bool is_logged_in) |
346 | { | 349 | { |
347 | 350 | childSetEnabled("reset_cloud_this_account", is_logged_in ); | |
348 | childSetEnabled("save_cloud_this_account", is_logged_in); | 351 | childSetEnabled("save_cloud_this_account", is_logged_in); |
349 | childSetEnabled("save_cloud_any_account", is_logged_in); | 352 | childSetEnabled("save_cloud_any_account", is_logged_in); |
350 | childSetEnabled("part_start_color_swatch", is_logged_in); | 353 | childSetEnabled("part_start_color_swatch", is_logged_in); |
351 | childSetEnabled("part_end_color_swatch", is_logged_in); | 354 | childSetEnabled("part_end_color_swatch", is_logged_in); |
352 | childSetEnabled("part_texture_picker", is_logged_in ); | 355 | childSetEnabled("part_texture_picker", is_logged_in ); |
353 | 356 | ||
357 | childSetEnabled("preview_cloud", is_logged_in); | ||
358 | childSetVisible("preview_cloud", is_logged_in); | ||
354 | childSetVisible("must_be_logged_in_textbox", !is_logged_in); | 359 | childSetVisible("must_be_logged_in_textbox", !is_logged_in); |
355 | } | 360 | } |
356 | 361 | ||
@@ -419,6 +424,25 @@ void LLPrefsAdvanced::onClickCommandLine(void* data) | |||
419 | FloaterCommandLine::getInstance()->center(); | 424 | FloaterCommandLine::getInstance()->center(); |
420 | } | 425 | } |
421 | 426 | ||
427 | void LLPrefsAdvanced::onResetThisCloudButton(void * data) | ||
428 | { | ||
429 | LLPrefsAdvanced* self = (LLPrefsAdvanced*)data; | ||
430 | if (!self) | ||
431 | { | ||
432 | return; | ||
433 | } | ||
434 | |||
435 | // keep draw() from overriding the cloud with the values from the UI | ||
436 | LLVOAvatar::sHasCloud = false; | ||
437 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cloud.xml"); | ||
438 | LLVOAvatar::loadCloud(filename, LLVOAvatar::sCloud); | ||
439 | |||
440 | // tell draw() to override values from the UI with the data from the new cloud | ||
441 | self-> mWasLoggedIn = !(LLStartUp::isLoggedIn()); | ||
442 | |||
443 | LLVOAvatar::sHasCloud = true; | ||
444 | } | ||
445 | |||
422 | void LLPrefsAdvanced::onSaveThisCloudButton(void * data) | 446 | void LLPrefsAdvanced::onSaveThisCloudButton(void * data) |
423 | { | 447 | { |
424 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "cloud.xml"); | 448 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "cloud.xml"); |