summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp195
1 files changed, 55 insertions, 140 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 7791c037d3..3ce1b46a4c 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -144,7 +144,7 @@ LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key)
BOOL LLVoiceSetKeyDialog::postBuild()
{
childSetAction("Cancel", onCancel, this);
- getChild<LLUICtrl>("Cancel")->setFocus(TRUE);
+ childSetFocus("Cancel");
gFocusMgr.setKeystrokesOnly(TRUE);
@@ -330,7 +330,7 @@ BOOL LLFloaterPreference::postBuild()
tabcontainer->selectFirstTab();
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
- getChild<LLUICtrl>("cache_location")->setValue(cache_location);
+ childSetText("cache_location", cache_location);
// if floater is opened before login set default localized busy message
if (LLStartUp::getStartupState() < STATE_STARTED)
@@ -426,28 +426,28 @@ void LLFloaterPreference::apply()
fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView());
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
- getChild<LLUICtrl>("cache_location")->setValue(cache_location);
+ childSetText("cache_location", cache_location);
- LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue());
+ LLViewerMedia::setCookiesEnabled(childGetValue("cookies_enabled"));
if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port"))
{
- bool proxy_enable = getChild<LLUICtrl>("web_proxy_enabled")->getValue();
- std::string proxy_address = getChild<LLUICtrl>("web_proxy_editor")->getValue();
- int proxy_port = getChild<LLUICtrl>("web_proxy_port")->getValue();
+ bool proxy_enable = childGetValue("web_proxy_enabled");
+ std::string proxy_address = childGetValue("web_proxy_editor");
+ int proxy_port = childGetValue("web_proxy_port");
LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port);
}
// LLWString busy_response = utf8str_to_wstring(getChild<LLUICtrl>("busy_response")->getValue().asString());
// LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
- gSavedSettings.setBOOL("PlainTextChatHistory", getChild<LLUICtrl>("plain_text_chat_history")->getValue().asBoolean());
+ gSavedSettings.setBOOL("PlainTextChatHistory", childGetValue("plain_text_chat_history").asBoolean());
if(mGotPersonalInfo)
{
// gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response)));
- bool new_im_via_email = getChild<LLUICtrl>("send_im_to_email")->getValue().asBoolean();
- bool new_hide_online = getChild<LLUICtrl>("online_visibility")->getValue().asBoolean();
+ bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
+ bool new_hide_online = childGetValue("online_visibility").asBoolean();
if((new_im_via_email != mOriginalIMViaEmail)
||(new_hide_online != mOriginalHideOnlineStatus))
@@ -545,13 +545,13 @@ void LLFloaterPreference::onOpen(const LLSD& key)
maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT));
}
}
- getChildView("maturity_desired_combobox")->setVisible( true);
- getChildView("maturity_desired_textbox")->setVisible( false);
+ childSetVisible("maturity_desired_combobox", true);
+ childSetVisible("maturity_desired_textbox", false);
}
else
{
- getChild<LLUICtrl>("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel());
- getChildView("maturity_desired_combobox")->setVisible( false);
+ childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel());
+ childSetVisible("maturity_desired_combobox", false);
}
// Display selected maturity icons.
@@ -844,7 +844,7 @@ void LLFloaterPreference::buildPopupLists()
void LLFloaterPreference::refreshEnabledState()
{
- LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
+ LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio");
// Reflections
@@ -857,7 +857,7 @@ void LLFloaterPreference::refreshEnabledState()
bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
getChild<LLCheckBoxCtrl>("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE);
- radio_reflection_detail->setEnabled(reflections);
+ radio_reflection_detail->setEnabled(ctrl_reflections->get() && reflections);
// Avatar Mode
// Enable Avatar Shaders
@@ -903,47 +903,20 @@ void LLFloaterPreference::refreshEnabledState()
// *HACK just checks to see if we can use shaders...
// maybe some cards that use shaders, but don't support windlight
ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
-
- //Deferred/SSAO/Shadows
- LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
- if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") &&
- LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
- shaders)
- {
- BOOL enabled = (ctrl_wind_light->get()) ? TRUE : FALSE;
-
- ctrl_deferred->setEnabled(enabled);
-
- LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
- LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail");
-
- enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE);
-
- ctrl_ssao->setEnabled(enabled);
-
- enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail");
-
- ctrl_shadow->setEnabled(enabled);
- }
-
-
// now turn off any features that are unavailable
disableUnavailableSettings();
- getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
+ childSetEnabled ("block_list", LLLoginInstance::getInstance()->authSuccess());
}
void LLFloaterPreference::disableUnavailableSettings()
{
- LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
+ LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
- LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
- LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail");
- LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
// if vertex shaders off, disable all shader related products
if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
@@ -955,22 +928,13 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_wind_light->setValue(FALSE);
ctrl_reflections->setEnabled(FALSE);
- ctrl_reflections->setValue(0);
+ ctrl_reflections->setValue(FALSE);
ctrl_avatar_vp->setEnabled(FALSE);
ctrl_avatar_vp->setValue(FALSE);
ctrl_avatar_cloth->setEnabled(FALSE);
ctrl_avatar_cloth->setValue(FALSE);
-
- ctrl_shadows->setEnabled(FALSE);
- ctrl_shadows->setValue(0);
-
- ctrl_ssao->setEnabled(FALSE);
- ctrl_ssao->setValue(FALSE);
-
- ctrl_deferred->setEnabled(FALSE);
- ctrl_deferred->setValue(FALSE);
}
// disabled windlight
@@ -978,47 +942,10 @@ void LLFloaterPreference::disableUnavailableSettings()
{
ctrl_wind_light->setEnabled(FALSE);
ctrl_wind_light->setValue(FALSE);
-
- //deferred needs windlight, disable deferred
- ctrl_shadows->setEnabled(FALSE);
- ctrl_shadows->setValue(0);
-
- ctrl_ssao->setEnabled(FALSE);
- ctrl_ssao->setValue(FALSE);
-
- ctrl_deferred->setEnabled(FALSE);
- ctrl_deferred->setValue(FALSE);
- }
-
- // disabled deferred
- if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"))
- {
- ctrl_shadows->setEnabled(FALSE);
- ctrl_shadows->setValue(0);
-
- ctrl_ssao->setEnabled(FALSE);
- ctrl_ssao->setValue(FALSE);
-
- ctrl_deferred->setEnabled(FALSE);
- ctrl_deferred->setValue(FALSE);
- }
-
- // disabled deferred SSAO
- if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO"))
- {
- ctrl_ssao->setEnabled(FALSE);
- ctrl_ssao->setValue(FALSE);
}
- // disabled deferred shadows
- if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"))
- {
- ctrl_shadows->setEnabled(FALSE);
- ctrl_shadows->setValue(0);
- }
-
// disabled reflections
- if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail"))
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections"))
{
ctrl_reflections->setEnabled(FALSE);
ctrl_reflections->setValue(FALSE);
@@ -1032,25 +959,13 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_avatar_cloth->setEnabled(FALSE);
ctrl_avatar_cloth->setValue(FALSE);
-
- //deferred needs AvatarVP, disable deferred
- ctrl_shadows->setEnabled(FALSE);
- ctrl_shadows->setValue(0);
-
- ctrl_ssao->setEnabled(FALSE);
- ctrl_ssao->setValue(FALSE);
-
- ctrl_deferred->setEnabled(FALSE);
- ctrl_deferred->setValue(FALSE);
}
-
// disabled cloth
if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth"))
{
ctrl_avatar_cloth->setEnabled(FALSE);
ctrl_avatar_cloth->setValue(FALSE);
}
-
// disabled impostors
if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors"))
{
@@ -1101,7 +1016,7 @@ void LLFloaterPreference::onClickSetKey()
void LLFloaterPreference::setKey(KEY key)
{
- getChild<LLUICtrl>("modifier_combo")->setValue(LLKeyboard::stringFromKey(key));
+ childSetValue("modifier_combo", LLKeyboard::stringFromKey(key));
// update the control right away since we no longer wait for apply
getChild<LLUICtrl>("modifier_combo")->onCommit();
}
@@ -1214,46 +1129,46 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
if(visibility == VISIBILITY_DEFAULT)
{
mOriginalHideOnlineStatus = false;
- getChildView("online_visibility")->setEnabled(TRUE);
+ childEnable("online_visibility");
}
else if(visibility == VISIBILITY_HIDDEN)
{
mOriginalHideOnlineStatus = true;
- getChildView("online_visibility")->setEnabled(TRUE);
+ childEnable("online_visibility");
}
else
{
mOriginalHideOnlineStatus = true;
}
- getChildView("include_im_in_chat_history")->setEnabled(TRUE);
- getChildView("show_timestamps_check_im")->setEnabled(TRUE);
- getChildView("friends_online_notify_checkbox")->setEnabled(TRUE);
-
- getChild<LLUICtrl>("online_visibility")->setValue(mOriginalHideOnlineStatus);
- getChild<LLUICtrl>("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility);
- getChildView("send_im_to_email")->setEnabled(TRUE);
- getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email);
- getChildView("plain_text_chat_history")->setEnabled(TRUE);
- getChild<LLUICtrl>("plain_text_chat_history")->setValue(gSavedSettings.getBOOL("PlainTextChatHistory"));
- getChildView("log_instant_messages")->setEnabled(TRUE);
-// getChildView("log_chat")->setEnabled(TRUE);
-// getChildView("busy_response")->setEnabled(TRUE);
-// getChildView("log_instant_messages_timestamp")->setEnabled(TRUE);
-// getChildView("log_chat_timestamp")->setEnabled(TRUE);
- getChildView("log_chat_IM")->setEnabled(TRUE);
- getChildView("log_date_timestamp")->setEnabled(TRUE);
-
-// getChild<LLUICtrl>("busy_response")->setValue(gSavedSettings.getString("BusyModeResponse2"));
-
- getChildView("log_nearby_chat")->setEnabled(TRUE);
- getChildView("log_instant_messages")->setEnabled(TRUE);
- getChildView("show_timestamps_check_im")->setEnabled(TRUE);
- getChildView("log_path_string")->setEnabled(FALSE);// LineEditor becomes readonly in this case.
- getChildView("log_path_button")->setEnabled(TRUE);
+ childEnable("include_im_in_chat_history");
+ childEnable("show_timestamps_check_im");
+ childEnable("friends_online_notify_checkbox");
+
+ childSetValue("online_visibility", mOriginalHideOnlineStatus);
+ childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
+ childEnable("send_im_to_email");
+ childSetValue("send_im_to_email", im_via_email);
+ childEnable("plain_text_chat_history");
+ childSetValue("plain_text_chat_history", gSavedSettings.getBOOL("PlainTextChatHistory"));
+ childEnable("log_instant_messages");
+// childEnable("log_chat");
+// childEnable("busy_response");
+// childEnable("log_instant_messages_timestamp");
+// childEnable("log_chat_timestamp");
+ childEnable("log_chat_IM");
+ childEnable("log_date_timestamp");
+
+// childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2"));
+
+ childEnable("log_nearby_chat");
+ childEnable("log_instant_messages");
+ childEnable("show_timestamps_check_im");
+ childDisable("log_path_string");// LineEditor becomes readonly in this case.
+ childEnable("log_path_button");
std::string display_email(email);
- getChild<LLUICtrl>("email_address")->setValue(display_email);
+ childSetText("email_address",display_email);
}
@@ -1352,8 +1267,8 @@ BOOL LLPanelPreference::postBuild()
if(hasChild("voice_unavailable"))
{
BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice");
- getChildView("voice_unavailable")->setVisible( voice_disabled);
- getChildView("enable_voice_check")->setVisible( !voice_disabled);
+ childSetVisible("voice_unavailable", voice_disabled);
+ childSetVisible("enable_voice_check", !voice_disabled);
}
//////////////////////PanelSkins ///////////////////
@@ -1373,8 +1288,8 @@ BOOL LLPanelPreference::postBuild()
if(hasChild("online_visibility") && hasChild("send_im_to_email"))
{
- getChild<LLUICtrl>("email_address")->setValue(getString("log_in_to_change") );
-// getChild<LLUICtrl>("busy_response")->setValue(getString("log_in_to_change"));
+ childSetText("email_address",getString("log_in_to_change") );
+// childSetText("busy_response", getString("log_in_to_change"));
}
//////////////////////PanelPrivacy ///////////////////
@@ -1398,9 +1313,9 @@ BOOL LLPanelPreference::postBuild()
if (hasChild("modifier_combo"))
{
//localizing if push2talk button is set to middle mouse
- if (MIDDLE_MOUSE_CV == getChild<LLUICtrl>("modifier_combo")->getValue().asString())
+ if (MIDDLE_MOUSE_CV == childGetValue("modifier_combo").asString())
{
- getChild<LLUICtrl>("modifier_combo")->setValue(getString("middle_mouse"));
+ childSetValue("modifier_combo", getString("middle_mouse"));
}
}