diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-02-24 23:41:04 +0200 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-02-24 23:41:04 +0200 |
commit | c4277e421ca8934e405d778f3c86f21760c55c9d (patch) | |
tree | 275f717c997d3911a05465ad377fc19a951a979a | |
parent | 59b82f8185247638a5fb294881ffc0c0558952b3 (diff) |
Implemented (EXT-4704) Add maturity icons to Prefs -> General.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_general.xml | 27 |
3 files changed, 46 insertions, 2 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index fb7e757c43..780393a9c0 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -323,7 +323,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); - + mCommitCallbackRegistrar.add("Pref.MaturitySettings", boost::bind(&LLFloaterPreference::onChangeMaturity, this)); + sSkin = gSavedSettings.getString("SkinCurrent"); gSavedSettings.getControl("AvatarNameTagMode")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); @@ -536,6 +537,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) { childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel()); childSetVisible("maturity_desired_combobox", false); + + // Display selected maturity icons. + onChangeMaturity(); } // Enabled/disabled popups, might have been changed by user actions @@ -1212,7 +1216,19 @@ void LLFloaterPreference::applyResolution() refresh(); } +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); +} void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 93b39d72bc..71aa5d3189 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -134,8 +134,9 @@ public: void onCommitMediaEnabled(); void onCommitMusicEnabled(); void applyResolution(); + void onChangeMaturity(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); - void getUIColor(LLUICtrl* ctrl, const LLSD& param); + void getUIColor(LLUICtrl* ctrl, const LLSD& param); void buildPopupLists(); static void refreshSkin(void* data); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 099c789e4b..d11aebe943 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -141,7 +141,34 @@ label="General" name="Desired_PG" value="13" /> + <combo_box.commit_callback + function="Pref.MaturitySettings"/> </combo_box> + <icon + follows="left|top" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left_pad="5" + name="rating_icon_general" + top_delta="3" + width="18"/> + <icon + follows="left|top" + height="16" + image_name="Parcel_M_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_moderate" + width="18"/> + <icon + follows="left|top" + height="16" + image_name="Parcel_R_Dark" + layout="topleft" + left_pad="2" + name="rating_icon_adult" + width="18"/> <text type="string" length="1" |