From fa979d280609eb4e7623d92d4876ab3639a3cddc Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 4 May 2010 08:30:32 -0700 Subject: Fixed preferences > advanced speedrez interval spinner not updating --- linden/indra/newview/llprefsadvanced.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview/llprefsadvanced.cpp') diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index 2ad8de2..ee90518 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -40,6 +40,7 @@ LLPrefsAdvanced::LLPrefsAdvanced() { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_advanced.xml"); + childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); } LLPrefsAdvanced::~LLPrefsAdvanced() @@ -54,10 +55,12 @@ BOOL LLPrefsAdvanced::postBuild() childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag")); childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ClothingLayerProtection")); childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); - childSetValue("speedrez_check", gSavedSettings.getBOOL("SpeedRez")); - childSetValue("speedrez_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval")); + childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); + childSetValue("speed_rez_interval_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval")); childSetValue("appearance_stand_check", gSavedSettings.getBOOL("AppearanceForceStand")); + refresh(); + return TRUE; } @@ -67,8 +70,8 @@ void LLPrefsAdvanced::apply() gSavedSettings.setBOOL("DisableTeleportScreens", childGetValue("disable_tp_screen_check")); gSavedSettings.setBOOL("ShowClientNameTag", childGetValue("client_name_tag_check")); gSavedSettings.setBOOL("ImagePipelineUseHTTP", childGetValue("http_texture_check")); - gSavedSettings.setBOOL("SpeedRez", childGetValue("speedrez_check")); - gSavedSettings.setU32("SpeedRezInterval", childGetValue("speedrez_spinner").asReal()); + gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); + gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval_spinner").asReal()); gSavedSettings.setBOOL("AppearanceForceStand", childGetValue("appearance_stand_check")); // Need to force a rebake when ClothingLayerProtection toggled for it take effect -- MC @@ -119,3 +122,24 @@ void LLPrefsAdvanced::apply() void LLPrefsAdvanced::cancel() { } + +void LLPrefsAdvanced::refresh() +{ + if (childGetValue("speed_rez_check").asBoolean()) + { + childEnable("speed_rez_interval_spinner"); + childEnable("speed_rez_seconds_text"); + } + else + { + childDisable("speed_rez_interval_spinner"); + childDisable("speed_rez_seconds_text"); + } +} + +//static +void LLPrefsAdvanced::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) +{ + LLPrefsAdvanced* self = (LLPrefsAdvanced*)user_data; + self->refresh(); +} -- cgit v1.1