diff options
author | Jiao Li <angela@lindenlab.com> | 2009-09-14 06:45:55 +0000 |
---|---|---|
committer | Jiao Li <angela@lindenlab.com> | 2009-09-14 06:45:55 +0000 |
commit | b6c716e50fa1bcab831d175eb1e3412912da29e1 (patch) | |
tree | 10b57bd4984f13c537fc35716aafdb6d77378fd9 /indra/newview/llfloaterpreference.cpp | |
parent | 39f446fdabab5191b79c9acf50008d6ade261ae9 (diff) |
EXT-804 Preferences > General does not show the static text, or combo_box for Maturity rating -- to be reviewed
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e2e9734012..2dc96d1fb3 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -522,6 +522,34 @@ void LLFloaterPreference::cancel() void LLFloaterPreference::onOpen(const LLSD& key) { gAgent.sendAgentUserInfoRequest(); + /////////////////////////// From LLPanelGeneral ////////////////////////// + // if we have no agent, we can't let them choose anything + // if we have an agent, then we only let them choose if they have a choice + bool canChoose = gAgent.getID().notNull() && + (gAgent.isMature() || gAgent.isGodlike()); + + if (canChoose) + { + + // if they're not adult or a god, they shouldn't see the adult selection, so delete it + if (!gAgent.isAdult() && !gAgent.isGodlike()) + { + LLComboBox* pMaturityCombo = getChild<LLComboBox>("maturity_desired_combobox"); + // we're going to remove the adult entry from the combo. This obviously depends + // on the order of items in the XML file, but there doesn't seem to be a reasonable + // way to depend on the field in XML called 'name'. + pMaturityCombo->remove(0); + } + childSetVisible("maturity_desired_combobox", true); + childSetVisible("maturity_desired_prompt", true); + + } + else + { + childSetVisible("maturity_desired_prompt", false); + childSetVisible("maturity_desired_combobox", false); + } + LLPanelLogin::setAlwaysRefresh(true); refresh(); } @@ -1351,37 +1379,7 @@ static void applyUIColor(const std::string& color_name, LLUICtrl* ctrl, const LL //virtual BOOL LLPanelPreference::postBuild() { - if (hasChild("maturity_desired_combobox")) - { - /////////////////////////// From LLPanelGeneral ////////////////////////// - // if we have no agent, we can't let them choose anything - // if we have an agent, then we only let them choose if they have a choice - bool canChoose = gAgent.getID().notNull() && - (gAgent.isMature() || gAgent.isGodlike()); - - if (canChoose) - { - // if they're not adult or a god, they shouldn't see the adult selection, so delete it - if (!gAgent.isAdult() && !gAgent.isGodlike()) - { - LLComboBox* pMaturityCombo = getChild<LLComboBox>("maturity_desired_combobox"); - // we're going to remove the adult entry from the combo. This obviously depends - // on the order of items in the XML file, but there doesn't seem to be a reasonable - // way to depend on the field in XML called 'name'. - pMaturityCombo->remove(0); - } - childSetVisible("maturity_desired_combobox", true); - childSetVisible("maturity_desired_textbox", false); - } - else - { - childSetVisible("maturity_desired_combobox", false); - std::string selectedItemLabel = getChild<LLComboBox>("maturity_desired_combobox")->getSelectedItemLabel(); - childSetValue("maturity_desired_textbox", selectedItemLabel); - childSetVisible("maturity_desired_textbox", true); - } - } ////////////////////// PanelVoice /////////////////// if(hasChild("voice_unavailable")) { |