diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-13 12:44:45 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-13 12:44:45 +0100 |
commit | d3418e5e65f7845f89b5ce2019bd635861573ed3 (patch) | |
tree | d56a1e629858cb89775c84c2a34b2282d29b2955 /indra/newview/llfloaterpreference.cpp | |
parent | 818e970b3efe65f6e471d071ae5f01603f61da79 (diff) | |
parent | d50a34e6e37c34fb84ad232aad7b3bf2a3b3b408 (diff) |
merge
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a8da0c8b16..32ee9a073c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -330,9 +330,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 @@ -487,6 +506,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 ////////////////////////// @@ -540,6 +575,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(); @@ -1045,18 +1090,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); |