summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-06-21 10:21:52 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-06-21 10:21:52 -0700
commitc8970618567e867b619c9fb5e225978bc5f66781 (patch)
treed5ec9d2f27d887e9a39b1109469ca405b14c6a85 /indra/newview/llfloaterpreference.cpp
parent6be9f280ff5b2e2eba3bb9c3f14d7166579d1a49 (diff)
parenta069e0d3db0e0771e54768a702fa18e57415992e (diff)
Merge with q/viewer-release
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp86
1 files changed, 46 insertions, 40 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 6087312a68..9064604d23 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -349,9 +349,28 @@ BOOL LLFloaterPreference::postBuild()
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
childSetText("cache_location", cache_location);
+ // if floater is opened before login set default localized busy message
+ if (LLStartUp::getStartupState() < STATE_STARTED)
+ {
+ gSavedPerAccountSettings.setString("BusyModeResponse", LLTrans::getString("BusyModeResponseDefault"));
+ }
+
return TRUE;
}
+void LLFloaterPreference::onBusyResponseChanged()
+{
+ // set "BusyResponseChanged" TRUE if user edited message differs from default, FALSE otherwise
+ if(LLTrans::getString("BusyModeResponseDefault") != getChild<LLUICtrl>("busy_response")->getValue().asString())
+ {
+ gSavedPerAccountSettings.setBOOL("BusyResponseChanged", TRUE );
+ }
+ else
+ {
+ gSavedPerAccountSettings.setBOOL("BusyResponseChanged", FALSE );
+ }
+}
+
LLFloaterPreference::~LLFloaterPreference()
{
// clean up user data
@@ -465,8 +484,6 @@ void LLFloaterPreference::apply()
gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility);
}
}
-
- applyResolution();
}
void LLFloaterPreference::cancel()
@@ -506,6 +523,22 @@ void LLFloaterPreference::cancel()
void LLFloaterPreference::onOpen(const LLSD& key)
{
+ // this variable and if that follows it are used to properly handle busy mode response message
+ static bool initialized = FALSE;
+ // if user is logged in and we haven't initialized busy_response yet, do it
+ if (!initialized && LLStartUp::getStartupState() == STATE_STARTED)
+ {
+ // Special approach is used for busy response localization, because "BusyModeResponse" is
+ // in non-localizable xml, and also because it may be changed by user and in this case it shouldn't be localized.
+ // To keep track of whether busy response is default or changed by user additional setting BusyResponseChanged
+ // was added into per account settings.
+
+ // initialization should happen once,so setting variable to TRUE
+ initialized = TRUE;
+ // this connection is needed to properly set "BusyResponseChanged" setting when user makes changes in
+ // busy response message.
+ gSavedPerAccountSettings.getControl("BusyModeResponse")->getSignal()->connect(boost::bind(&LLFloaterPreference::onBusyResponseChanged, this));
+ }
gAgent.sendAgentUserInfoRequest();
/////////////////////////// From LLPanelGeneral //////////////////////////
@@ -520,7 +553,7 @@ void LLFloaterPreference::onOpen(const LLSD& key)
if (can_choose_maturity)
{
// if they're not adult or a god, they shouldn't see the adult selection, so delete it
- if (!gAgent.isAdult() && !gAgent.isGodlike())
+ if (!gAgent.isAdult() && !gAgent.isGodlikeWithoutAdminMenuFakery())
{
// we're going to remove the adult entry from the combo
LLScrollListCtrl* maturity_list = maturity_combo->findChild<LLScrollListCtrl>("ComboBox");
@@ -559,6 +592,16 @@ void LLFloaterPreference::onVertexShaderEnable()
refreshEnabledGraphics();
}
+//static
+void LLFloaterPreference::initBusyResponse()
+ {
+ if (!gSavedPerAccountSettings.getBOOL("BusyResponseChanged"))
+ {
+ //LLTrans::getString("BusyModeResponseDefault") is used here for localization (EXT-5885)
+ gSavedPerAccountSettings.setString("BusyModeResponse", LLTrans::getString("BusyModeResponseDefault"));
+ }
+ }
+
void LLFloaterPreference::setHardwareDefaults()
{
LLFeatureManager::getInstance()->applyRecommendedSettings();
@@ -979,18 +1022,6 @@ void LLFloaterPreference::onChangeQuality(const LLSD& data)
refresh();
}
-// static
-// DEV-24146 - needs to be removed at a later date. jan-2009
-void LLFloaterPreference::cleanupBadSetting()
-{
- if (gSavedPerAccountSettings.getString("BusyModeResponse2") == "|TOKEN COPY BusyModeResponse|")
- {
- llinfos << "cleaning old BusyModeResponse" << llendl;
- //LLTrans::getString("BusyModeResponseDefault") is used here for localization (EXT-5885)
- gSavedPerAccountSettings.setString("BusyModeResponse2", LLTrans::getString("BusyModeResponseDefault"));
- }
-}
-
void LLFloaterPreference::onClickSetKey()
{
LLVoiceSetKeyDialog* dialog = LLFloaterReg::showTypedInstance<LLVoiceSetKeyDialog>("voice_set_key", LLSD(), TRUE);
@@ -1199,31 +1230,6 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
}
}
-void LLFloaterPreference::applyResolution()
-{
- gGL.flush();
-
- // Screen resolution
- S32 num_resolutions;
- LLWindow::LLWindowResolution* supported_resolutions =
- gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
- S32 resIndex = getChild<LLComboBox>("fullscreen combo")->getCurrentIndex();
- if (resIndex == -1)
- {
- // use highest resolution if nothing selected
- resIndex = num_resolutions - 1;
- }
- gSavedSettings.setS32("FullScreenWidth", supported_resolutions[resIndex].mWidth);
- gSavedSettings.setS32("FullScreenHeight", supported_resolutions[resIndex].mHeight);
-
- gViewerWindow->requestResolutionUpdate(gSavedSettings.getBOOL("FullScreen"));
-
- send_agent_update(TRUE);
-
- // Update enable/disable
- refresh();
-}
-
void LLFloaterPreference::onChangeMaturity()
{
U8 sim_access = gSavedSettings.getU32("PreferredMaturity");