summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimsessiontab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp20
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();