From b6c716e50fa1bcab831d175eb1e3412912da29e1 Mon Sep 17 00:00:00 2001
From: Jiao Li <angela@lindenlab.com>
Date: Mon, 14 Sep 2009 06:45:55 +0000
Subject: [PATCH] EXT-804 Preferences > General does not show the static text,
 or combo_box for Maturity rating -- to be reviewed

---
 indra/newview/llfloaterpreference.cpp | 58 +++++++++++++--------------
 1 file 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"))
 	{
-- 
GitLab