Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
// Avatar Mode
// Enable Avatar Shaders
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
// Avatar Render Mode
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
ctrl_avatar_vp->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE);
if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||
gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)
{
ctrl_avatar_cloth->setEnabled(false);
}
else
{
ctrl_avatar_cloth->setEnabled(true);
}
// Vertex Shaders
// Global Shader Enable
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
// radio set for terrain detail mode
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
BOOL shaders = ctrl_shader_enable->get();
if (shaders)
{
mRadioTerrainDetail->setValue(1);
mRadioTerrainDetail->setEnabled(FALSE);
}
else
{
mRadioTerrainDetail->setEnabled(TRUE);
}
// WindLight
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
// *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);
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
//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();
Eugene Mutavchi
committed
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
}
void LLFloaterPreference::disableUnavailableSettings()
{
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"))
{
ctrl_shader_enable->setEnabled(FALSE);
ctrl_shader_enable->setValue(FALSE);
ctrl_wind_light->setEnabled(FALSE);
ctrl_wind_light->setValue(FALSE);
ctrl_reflections->setEnabled(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
if(!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders"))
{
ctrl_wind_light->setEnabled(FALSE);
ctrl_wind_light->setValue(FALSE);
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
//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"))
{
ctrl_reflections->setEnabled(FALSE);
ctrl_reflections->setValue(FALSE);
}
// disabled av
if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"))
{
ctrl_avatar_vp->setEnabled(FALSE);
ctrl_avatar_vp->setValue(FALSE);
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"))
{
ctrl_avatar_impostors->setEnabled(FALSE);
ctrl_avatar_impostors->setValue(FALSE);
}
}
void LLFloaterPreference::refresh()
{
LLPanel::refresh();
// sliders and their text boxes
// mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow");
// slider text boxes
James Cook
committed
updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail", true), getChild<LLTextBox>("ObjectMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true));
James Cook
committed
updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true));
updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true));
refreshEnabledState();
}
void LLFloaterPreference::onCommitWindowedMode()
{
refresh();
}
void LLFloaterPreference::onChangeQuality(const LLSD& data)
{
U32 level = (U32)(data.asReal());
LLFeatureManager::getInstance()->setGraphicsLevel(level, true);
refreshEnabledGraphics();
refresh();
}
void LLFloaterPreference::onClickSetKey()
{
LLVoiceSetKeyDialog* dialog = LLFloaterReg::showTypedInstance<LLVoiceSetKeyDialog>("voice_set_key", LLSD(), TRUE);
if (dialog)
{
dialog->setParent(this);
}
void LLFloaterPreference::setKey(KEY 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();
void LLFloaterPreference::onClickSetMiddleMouse()
LLUICtrl* p2t_line_editor = getChild<LLUICtrl>("modifier_combo");
// update the control right away since we no longer wait for apply
p2t_line_editor->setControlValue(MIDDLE_MOUSE_CV);
//push2talk button "middle mouse" control value is in English, need to localize it for presentation
LLPanel* advanced_preferences = dynamic_cast<LLPanel*>(p2t_line_editor->getParent());
if (advanced_preferences)
{
p2t_line_editor->setValue(advanced_preferences->getString("middle_mouse"));
}
/*
void LLFloaterPreference::onClickSkipDialogs()
{
LLNotificationsUtil::add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, this));
void LLFloaterPreference::onClickResetDialogs()
LLNotificationsUtil::add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, this));
*/
void LLFloaterPreference::onClickEnablePopup()
{
LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups");
std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
//gSavedSettings.setWarning(templatep->mName, TRUE);
std::string notification_name = templatep->mName;
LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE);
}
buildPopupLists();
James Cook
committed
void LLFloaterPreference::onClickDisablePopup()
{
LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups");
std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
templatep->mForm->setIgnored(true);
James Cook
committed
}
buildPopupLists();
James Cook
committed
}
void LLFloaterPreference::resetAllIgnored()
{
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
++iter)
{
if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
iter->second->mForm->setIgnored(false);
}
}
}
void LLFloaterPreference::setAllIgnored()
{
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
++iter)
{
if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
{
iter->second->mForm->setIgnored(true);
void LLFloaterPreference::onClickLogPath()
{
James Cook
committed
std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
LLDirPicker& picker = LLDirPicker::instance();
if (!picker.getDir(&proposed_name ) )
return; //Canceled!
}
gSavedPerAccountSettings.setString("InstantMessageLogPath", picker.getDirName());
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
mGotPersonalInfo = true;
mOriginalIMViaEmail = im_via_email;
mDirectoryVisibility = visibility;
if(visibility == VISIBILITY_DEFAULT)
mOriginalHideOnlineStatus = false;
getChildView("online_visibility")->setEnabled(TRUE);
}
else if(visibility == VISIBILITY_HIDDEN)
{
mOriginalHideOnlineStatus = true;
getChildView("online_visibility")->setEnabled(TRUE);
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"));
Andrew Productengine
committed
getChildView("favorites_on_login_check")->setEnabled(TRUE);
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);
Wolfpup Lowenhar
committed
childEnable("logfile_name_datestamp");
std::string display_email(email);
getChild<LLUICtrl>("email_address")->setValue(display_email);
}
void LLFloaterPreference::onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name)
{
James Cook
committed
std::string ctrl_name = name.asString();
if((ctrl_name =="" )|| !hasChild(ctrl_name, true))
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
return;
LLTextBox* text_box = getChild<LLTextBox>(name.asString());
LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl);
updateSliderText(slider, text_box);
}
void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box)
{
if(text_box == NULL || ctrl== NULL)
return;
// get range and points when text should change
F32 value = (F32)ctrl->getValue().asReal();
F32 min = ctrl->getMinValue();
F32 max = ctrl->getMaxValue();
F32 range = max - min;
llassert(range > 0);
F32 midPoint = min + range / 3.0f;
F32 highPoint = min + (2.0f * range / 3.0f);
// choose the right text
if(value < midPoint)
{
text_box->setText(LLTrans::getString("GraphicsQualityLow"));
}
else if (value < highPoint)
{
text_box->setText(LLTrans::getString("GraphicsQualityMid"));
}
else
{
text_box->setText(LLTrans::getString("GraphicsQualityHigh"));
}
}
void LLFloaterPreference::onChangeMaturity()
{
U8 sim_access = gSavedSettings.getU32("PreferredMaturity");
getChild<LLIconCtrl>("rating_icon_general")->setVisible(sim_access == SIM_ACCESS_PG
|| sim_access == SIM_ACCESS_MATURE
|| sim_access == SIM_ACCESS_ADULT);
getChild<LLIconCtrl>("rating_icon_moderate")->setVisible(sim_access == SIM_ACCESS_MATURE
|| sim_access == SIM_ACCESS_ADULT);
getChild<LLIconCtrl>("rating_icon_adult")->setVisible(sim_access == SIM_ACCESS_ADULT);
}
// FIXME: this will stop you from spawning the sidetray from preferences dialog on login screen
// but the UI for this will still be enabled
void LLFloaterPreference::onClickBlockList()
{
// don't create side tray on demand
if (LLSideTray::instanceCreated())
{
LLSideTray::getInstance()->showPanel("panel_block_list_sidetray");
}
}
Andrew Productengine
committed
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
void LLFloaterPreference::onDoubleClickCheckBox(LLUICtrl* ctrl)
{
if (!ctrl) return;
mDoubleClickActionDirty = true;
LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
if (!radio_double_click_action) return;
// select default value("teleport") in radio-group.
radio_double_click_action->setSelectedIndex(0);
// set radio-group enabled depending on state of checkbox
radio_double_click_action->setEnabled(ctrl->getValue());
}
void LLFloaterPreference::onDoubleClickRadio()
{
mDoubleClickActionDirty = true;
}
void LLFloaterPreference::updateDoubleClickSettings()
{
LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
if (!double_click_action_cb) return;
bool enable = double_click_action_cb->getValue().asBoolean();
LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
if (!radio_double_click_action) return;
// enable double click radio-group depending on state of checkbox
radio_double_click_action->setEnabled(enable);
if (!enable)
{
// set double click action settings values to false if checkbox was unchecked
gSavedSettings.setBOOL("DoubleClickAutoPilot", false);
gSavedSettings.setBOOL("DoubleClickTeleport", false);
}
else
{
std::string selected = radio_double_click_action->getValue().asString();
bool teleport_selected = selected == "radio_teleport";
// set double click action settings values depending on chosen radio-button
gSavedSettings.setBOOL( "DoubleClickTeleport", teleport_selected );
gSavedSettings.setBOOL( "DoubleClickAutoPilot", !teleport_selected );
}
}
void LLFloaterPreference::updateDoubleClickControls()
{
// check is one of double-click actions settings enabled
bool double_click_action_enabled = gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport");
LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
if (double_click_action_cb)
{
// check checkbox if one of double-click actions settings enabled, uncheck otherwise
double_click_action_cb->setValue(double_click_action_enabled);
}
LLRadioGroup* double_click_action_radio = getChild<LLRadioGroup>("double_click_action");
if (!double_click_action_radio) return;
// set radio-group enabled if one of double-click actions settings enabled
double_click_action_radio->setEnabled(double_click_action_enabled);
// select button in radio-group depending on setting
double_click_action_radio->setSelectedIndex(gSavedSettings.getBOOL("DoubleClickAutoPilot"));
}
void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
}
void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param)
{
LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*) ctrl;
color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
}
Vadim ProductEngine
committed
void LLFloaterPreference::setCacheLocation(const LLStringExplicit& location)
{
LLUICtrl* cache_location_editor = getChild<LLUICtrl>("cache_location");
cache_location_editor->setValue(location);
cache_location_editor->setToolTip(location);
}
//----------------------------------------------------------------------------
static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference");
LLPanelPreference::LLPanelPreference()
: LLPanel()
mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
paul_productengine
committed
mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1));
James Cook
committed
}
//virtual
BOOL LLPanelPreference::postBuild()
{
////////////////////// PanelVoice ///////////////////
if(hasChild("voice_unavailable"))
BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice");
getChildView("voice_unavailable")->setVisible( voice_disabled);
getChildView("enable_voice_check")->setVisible( !voice_disabled);
}
//////////////////////PanelSkins ///////////////////
if (hasChild("skin_selection"))
{
LLFloaterPreference::refreshSkin(this);
// if skin is set to a skin that no longer exists (silver) set back to default
if (getChild<LLRadioGroup>("skin_selection")->getSelectedIndex() < 0)
gSavedSettings.setString("SkinCurrent", "default");
LLFloaterPreference::refreshSkin(this);
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"));
//////////////////////PanelPrivacy ///////////////////
{
bool media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia");
Igor Borovkov
committed
getChild<LLCheckBoxCtrl>("media_enabled")->set(media_enabled);
getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(media_enabled);
}
if (hasChild("music_enabled"))
{
getChild<LLCheckBoxCtrl>("music_enabled")->set(gSavedSettings.getBOOL("AudioStreamingMusic"));
Igor Borovkov
committed
if (hasChild("voice_call_friends_only_check"))
{
getChild<LLCheckBoxCtrl>("voice_call_friends_only_check")->setCommitCallback(boost::bind(&showFriendsOnlyWarning, _1, _2));
}
Andrew Productengine
committed
if (hasChild("favorites_on_login_check"))
{
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2));
}
Igor Borovkov
committed
// Panel Advanced
if (hasChild("modifier_combo"))
{
//localizing if push2talk button is set to middle mouse
if (MIDDLE_MOUSE_CV == getChild<LLUICtrl>("modifier_combo")->getValue().asString())
getChild<LLUICtrl>("modifier_combo")->setValue(getString("middle_mouse"));
}
}
apply();
return true;
void LLPanelPreference::apply()
{
// no-op
}
void LLPanelPreference::saveSettings()
{
// Save the value of all controls in the hierarchy
mSavedValues.clear();
std::list<LLView*> view_stack;
view_stack.push_back(this);
while(!view_stack.empty())
{
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
James Cook
committed
LLColorSwatchCtrl* color_swatch = dynamic_cast<LLColorSwatchCtrl *>(curview);
if (color_swatch)
{
mSavedColors[color_swatch->getName()] = color_swatch->get();
}
else
James Cook
committed
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
James Cook
committed
LLControlVariable* control = ctrl->getControlVariable();
if (control)
{
mSavedValues[control] = control->getValue();
}
James Cook
committed
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
{
view_stack.push_back(*iter);
}
Igor Borovkov
committed
void LLPanelPreference::showFriendsOnlyWarning(LLUICtrl* checkbox, const LLSD& value)
{
if (checkbox && checkbox->getValue())
{
LLNotificationsUtil::add("FriendsAndGroupsOnly");
}
}
Andrew Productengine
committed
void LLPanelPreference::showFavoritesOnLoginWarning(LLUICtrl* checkbox, const LLSD& value)
{
if (checkbox && checkbox->getValue())
{
LLNotificationsUtil::add("FavoritesOnLogin");
}
}
void LLPanelPreference::cancel()
for (control_values_map_t::iterator iter = mSavedValues.begin();
iter != mSavedValues.end(); ++iter)
LLControlVariable* control = iter->first;
LLSD ctrl_value = iter->second;
control->set(ctrl_value);
James Cook
committed
for (string_color_map_t::iterator iter = mSavedColors.begin();
iter != mSavedColors.end(); ++iter)
{
LLColorSwatchCtrl* color_swatch = findChild<LLColorSwatchCtrl>(iter->first);
if(color_swatch)
{
color_swatch->set(iter->second);
color_swatch->onCommit();
}
}
void LLPanelPreference::setControlFalse(const LLSD& user_data)
{
std::string control_name = user_data.asString();
LLControlVariable* control = findControl(control_name);
if (control)
control->set(LLSD(FALSE));
paul_productengine
committed
}
void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl)
{
std::string name = ctrl->getName();
// Disable "Allow Media to auto play" only when both
// "Streaming Music" and "Media" are unchecked. STORM-513.
if ((name == "enable_music") || (name == "enable_media"))
{
bool music_enabled = getChild<LLCheckBoxCtrl>("enable_music")->get();
bool media_enabled = getChild<LLCheckBoxCtrl>("enable_media")->get();
getChild<LLCheckBoxCtrl>("media_auto_play_btn")->setEnabled(music_enabled || media_enabled);
}
}
Ychebotarev ProductEngine
committed
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
static LLRegisterPanelClassWrapper<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics");
BOOL LLPanelPreferenceGraphics::postBuild()
{
return LLPanelPreference::postBuild();
}
void LLPanelPreferenceGraphics::draw()
{
LLPanelPreference::draw();
LLButton* button_apply = findChild<LLButton>("Apply");
if(button_apply && button_apply->getVisible())
{
bool enable = hasDirtyChilds();
button_apply->setEnabled(enable);
}
}
bool LLPanelPreferenceGraphics::hasDirtyChilds()
{
std::list<LLView*> view_stack;
view_stack.push_back(this);
while(!view_stack.empty())
{
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
{
if(ctrl->isDirty())
return true;
}
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
{
view_stack.push_back(*iter);
}
}
return false;
}
void LLPanelPreferenceGraphics::resetDirtyChilds()
{
std::list<LLView*> view_stack;
view_stack.push_back(this);
while(!view_stack.empty())
{
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
{
ctrl->resetDirty();
}
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
{
view_stack.push_back(*iter);
}
}
}
void LLPanelPreferenceGraphics::apply()
{
resetDirtyChilds();
LLPanelPreference::apply();
}
void LLPanelPreferenceGraphics::cancel()
{
resetDirtyChilds();
LLPanelPreference::cancel();
}
void LLPanelPreferenceGraphics::saveSettings()
{
resetDirtyChilds();
LLPanelPreference::saveSettings();
}
void LLPanelPreferenceGraphics::setHardwareDefaults()
{
resetDirtyChilds();
LLPanelPreference::setHardwareDefaults();
}