diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-04 15:57:35 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-04 15:57:35 -0700 |
commit | 38ea63e084362d01deedf07e617b6e2bf85bbb25 (patch) | |
tree | efaa6b41c40f4f6e4096c31e473ec1d68b3de4d2 /indra/newview/llfloatertranslationsettings.cpp | |
parent | 819bbce34a2f265287df1e4e9adde90b5a70c8b6 (diff) | |
parent | dabce05d1eed47944e39438e50b3c788b7df649d (diff) |
merging in viewer-chui
Diffstat (limited to 'indra/newview/llfloatertranslationsettings.cpp')
-rw-r--r-- | indra/newview/llfloatertranslationsettings.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index 1a17183efd..33f2c35239 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -29,7 +29,7 @@ #include "llfloatertranslationsettings.h" // Viewer includes -#include "llnearbychatbar.h" +#include "llfloaterimnearbychat.h" #include "lltranslate.h" #include "llviewercontrol.h" // for gSavedSettings @@ -225,11 +225,10 @@ void LLFloaterTranslationSettings::updateControlsEnabledState() mGoogleVerifyBtn->setEnabled(on && google_selected && !mGoogleKeyVerified && !getEnteredGoogleKey().empty()); - mOKBtn->setEnabled( - !on || ( - (bing_selected && mBingKeyVerified) || - (google_selected && mGoogleKeyVerified) - )); + bool service_verified = (bing_selected && mBingKeyVerified) || (google_selected && mGoogleKeyVerified); + gSavedPerAccountSettings.setBOOL("TranslatingEnabled", service_verified); + + mOKBtn->setEnabled(!on || service_verified); } void LLFloaterTranslationSettings::verifyKey(int service, const std::string& key, bool alert) @@ -285,7 +284,16 @@ void LLFloaterTranslationSettings::onBtnGoogleVerify() verifyKey(LLTranslate::SERVICE_GOOGLE, key); } } +void LLFloaterTranslationSettings::onClose(bool app_quitting) +{ + std::string service = gSavedSettings.getString("TranslationService"); + bool bing_selected = service == "bing"; + bool google_selected = service == "google"; + + bool service_verified = (bing_selected && mBingKeyVerified) || (google_selected && mGoogleKeyVerified); + gSavedPerAccountSettings.setBOOL("TranslatingEnabled", service_verified); +} void LLFloaterTranslationSettings::onBtnOK() { gSavedSettings.setBOOL("TranslateChat", mMachineTranslationCB->getValue().asBoolean()); @@ -293,6 +301,7 @@ void LLFloaterTranslationSettings::onBtnOK() gSavedSettings.setString("TranslationService", getSelectedService()); gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey()); gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey()); - LLNearbyChatBar::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured()); + (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))-> + showTranslationCheckbox(LLTranslate::isTranslationConfigured()); closeFloater(false); } |