summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp65
1 files changed, 35 insertions, 30 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index c47c7b073c..2dc96d1fb3 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -61,6 +61,7 @@
#include "llnavigationbar.h"
#include "llpanellogin.h"
#include "llradiogroup.h"
+#include "llsearchcombobox.h"
#include "llsky.h"
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
@@ -102,6 +103,7 @@
#include "llviewermedia.h"
#include "llpluginclassmedia.h"
+#include <boost/regex.hpp>
//RN temporary includes for resolution switching
#include "llglheaders.h"
@@ -214,6 +216,11 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response
// flag client texture cache for clearing next time the client runs
gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE);
LLNotifications::instance().add("CacheWillClear");
+
+ LLSearchHistory::getInstance()->clearHistory();
+ LLSearchHistory::getInstance()->save();
+ LLSearchComboBox* search_ctrl = LLNavigationBar::getInstance()->getChild<LLSearchComboBox>("search_combo_box");
+ search_ctrl->clearHistory();
}
return false;
@@ -515,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();
}
@@ -1344,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"))
{