diff options
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 195 |
1 files changed, 140 insertions, 55 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ee8836bb47..3804a1b858 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -138,7 +138,7 @@ LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key) BOOL LLVoiceSetKeyDialog::postBuild() { childSetAction("Cancel", onCancel, this); - childSetFocus("Cancel"); + getChild<LLUICtrl>("Cancel")->setFocus(TRUE); gFocusMgr.setKeystrokesOnly(TRUE); @@ -324,7 +324,7 @@ BOOL LLFloaterPreference::postBuild() tabcontainer->selectFirstTab(); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - childSetText("cache_location", cache_location); + getChild<LLUICtrl>("cache_location")->setValue(cache_location); // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -420,28 +420,28 @@ void LLFloaterPreference::apply() fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - childSetText("cache_location", cache_location); + getChild<LLUICtrl>("cache_location")->setValue(cache_location); - LLViewerMedia::setCookiesEnabled(childGetValue("cookies_enabled")); + LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) { - bool proxy_enable = childGetValue("web_proxy_enabled"); - std::string proxy_address = childGetValue("web_proxy_editor"); - int proxy_port = childGetValue("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(); 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", childGetValue("plain_text_chat_history").asBoolean()); + gSavedSettings.setBOOL("PlainTextChatHistory", getChild<LLUICtrl>("plain_text_chat_history")->getValue().asBoolean()); if(mGotPersonalInfo) { // gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response))); - bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); - bool new_hide_online = childGetValue("online_visibility").asBoolean(); + bool new_im_via_email = getChild<LLUICtrl>("send_im_to_email")->getValue().asBoolean(); + bool new_hide_online = getChild<LLUICtrl>("online_visibility")->getValue().asBoolean(); if((new_im_via_email != mOriginalIMViaEmail) ||(new_hide_online != mOriginalHideOnlineStatus)) @@ -539,13 +539,13 @@ void LLFloaterPreference::onOpen(const LLSD& key) maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT)); } } - childSetVisible("maturity_desired_combobox", true); - childSetVisible("maturity_desired_textbox", false); + getChildView("maturity_desired_combobox")->setVisible( true); + getChildView("maturity_desired_textbox")->setVisible( false); } else { - childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel()); - childSetVisible("maturity_desired_combobox", false); + getChild<LLUICtrl>("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel()); + getChildView("maturity_desired_combobox")->setVisible( false); } // Display selected maturity icons. @@ -838,7 +838,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio"); // Reflections @@ -851,7 +851,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(ctrl_reflections->get() && reflections); + radio_reflection_detail->setEnabled(reflections); // Avatar Mode // Enable Avatar Shaders @@ -897,20 +897,47 @@ 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(); - childSetEnabled ("block_list", LLLoginInstance::getInstance()->authSuccess()); + getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } void LLFloaterPreference::disableUnavailableSettings() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("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")) @@ -922,13 +949,22 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setValue(FALSE); ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(FALSE); + ctrl_reflections->setValue(0); 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 @@ -936,10 +972,47 @@ 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("RenderWaterReflections")) + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); @@ -953,13 +1026,25 @@ 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")) { @@ -1010,7 +1095,7 @@ void LLFloaterPreference::onClickSetKey() void LLFloaterPreference::setKey(KEY key) { - childSetValue("modifier_combo", LLKeyboard::stringFromKey(key)); + getChild<LLUICtrl>("modifier_combo")->setValue(LLKeyboard::stringFromKey(key)); // update the control right away since we no longer wait for apply getChild<LLUICtrl>("modifier_combo")->onCommit(); } @@ -1123,46 +1208,46 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im if(visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; - childEnable("online_visibility"); + getChildView("online_visibility")->setEnabled(TRUE); } else if(visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; - childEnable("online_visibility"); + getChildView("online_visibility")->setEnabled(TRUE); } else { mOriginalHideOnlineStatus = 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"); + 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); std::string display_email(email); - childSetText("email_address",display_email); + getChild<LLUICtrl>("email_address")->setValue(display_email); } @@ -1261,8 +1346,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("voice_unavailable")) { BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); - childSetVisible("voice_unavailable", voice_disabled); - childSetVisible("enable_voice_check", !voice_disabled); + getChildView("voice_unavailable")->setVisible( voice_disabled); + getChildView("enable_voice_check")->setVisible( !voice_disabled); } //////////////////////PanelSkins /////////////////// @@ -1282,8 +1367,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("online_visibility") && hasChild("send_im_to_email")) { - childSetText("email_address",getString("log_in_to_change") ); -// childSetText("busy_response", getString("log_in_to_change")); + getChild<LLUICtrl>("email_address")->setValue(getString("log_in_to_change") ); +// getChild<LLUICtrl>("busy_response")->setValue(getString("log_in_to_change")); } //////////////////////PanelPrivacy /////////////////// @@ -1307,9 +1392,9 @@ BOOL LLPanelPreference::postBuild() if (hasChild("modifier_combo")) { //localizing if push2talk button is set to middle mouse - if (MIDDLE_MOUSE_CV == childGetValue("modifier_combo").asString()) + if (MIDDLE_MOUSE_CV == getChild<LLUICtrl>("modifier_combo")->getValue().asString()) { - childSetValue("modifier_combo", getString("middle_mouse")); + getChild<LLUICtrl>("modifier_combo")->setValue(getString("middle_mouse")); } } |