diff options
author | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-15 14:07:55 +0200 |
---|---|---|
committer | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-15 14:07:55 +0200 |
commit | a49d3b14254fa5cfac3900e86b2287a016eaf9cc (patch) | |
tree | 3981e313536a19c7e93acd2aba2afdf6b4cb2f2a /indra/newview/llfloaterimsessiontab.cpp | |
parent | e206dff762e9055391a8627c0067de0a11319f2f (diff) |
CHUI-567 FIXED "Translate chat", "Translation settings..." menu items are added.
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index d4eb03f95d..06a79836db 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -72,6 +72,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) boost::bind(&LLFloaterIMSessionTab::onIMShowModesMenuItemCheck, this, _2)); mEnableCallbackRegistrar.add("IMSession.Menu.ShowModes.Enable", boost::bind(&LLFloaterIMSessionTab::onIMShowModesMenuItemEnable, this, _2)); + mEnableCallbackRegistrar.add("Translating.Enabled", + boost::bind(&LLFloaterIMSessionTab::isTranslatingEnabled, this, _2)); + mEnableCallbackRegistrar.add("Translating.On", + boost::bind(&LLFloaterIMSessionTab::isTranslationOn, this, _2)); + mCommitCallbackRegistrar.add("Translating.Toggle", + boost::bind(&LLFloaterIMSessionTab::toggleTranslation, this, _2)); // Right click menu handling mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); @@ -552,6 +558,10 @@ void LLFloaterIMSessionTab::onIMSessionMenuItemClicked(const LLSD& userdata) LLFloaterIMSessionTab::processChatHistoryStyleUpdate(); } +void LLFloaterIMSessionTab::toggleTranslation(const LLSD& userdata) +{ + gSavedSettings.setBOOL("TranslateChat", !gSavedSettings.getBOOL("TranslateChat")); +} bool LLFloaterIMSessionTab::onIMCompactExpandedMenuItemCheck(const LLSD& userdata) { @@ -576,6 +586,16 @@ bool LLFloaterIMSessionTab::onIMShowModesMenuItemEnable(const LLSD& userdata) return (plain_text && (is_not_names || mIsP2PChat)); } +bool LLFloaterIMSessionTab::isTranslatingEnabled(const LLSD& userdata) +{ + return gSavedPerAccountSettings.getBOOL("TranslatingEnabled"); +} + +bool LLFloaterIMSessionTab::isTranslationOn(const LLSD& userdata) +{ + return gSavedSettings.getBOOL("TranslateChat"); +} + void LLFloaterIMSessionTab::hideOrShowTitle() { const LLFloater::Params& default_params = LLFloater::getDefaultParams(); |