diff options
author | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-21 14:10:12 +0200 |
---|---|---|
committer | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-21 14:10:12 +0200 |
commit | 824457f98c93a2f48f402740982a410b9fbc3487 (patch) | |
tree | 2a665693aa96270d98a72e94494fcb7d295b8eb9 /indra | |
parent | 52018b79bdd715dbb7bd42792447566347b641d5 (diff) |
CHUI-567 FIXED Menu items are moved to Participant view menu
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_participant_view.xml | 20 |
5 files changed, 33 insertions, 44 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 8f290ae7c1..f73db6b166 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -813,6 +813,10 @@ void LLFloaterIMContainer::onCustomAction(const LLSD& userdata) floater_prefp->selectPrivacyPanel(); } } + if ("Translating.Toggle" == command) + { + gSavedSettings.setBOOL("TranslateChat", !gSavedSettings.getBOOL("TranslateChat")); + } } BOOL LLFloaterIMContainer::isActionChecked(const LLSD& userdata) @@ -843,7 +847,14 @@ BOOL LLFloaterIMContainer::isActionChecked(const LLSD& userdata) { return (order.getSortOrderParticipants() == LLConversationFilter::SO_DISTANCE); } - + if ("Translating.Enabled" == command) + { + return gSavedPerAccountSettings.getBOOL("TranslatingEnabled"); + } + if ("Translating.On" == command) + { + return gSavedSettings.getBOOL("TranslateChat"); + } return FALSE; } diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index bc5b8c334d..0cdfde3975 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -72,12 +72,6 @@ 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)); @@ -551,11 +545,6 @@ 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) { std::string item = userdata.asString(); @@ -579,16 +568,6 @@ 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(); diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index 05da0f98bc..0fa99a46be 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -109,12 +109,8 @@ protected: // bool onIMShowModesMenuItemCheck(const LLSD& userdata); bool onIMShowModesMenuItemEnable(const LLSD& userdata); - bool isTranslatingEnabled(const LLSD& userdata); - bool isTranslationOn(const LLSD& userdata); static void onSlide(LLFloaterIMSessionTab *self); - void toggleTranslation(const LLSD& userdata); - // refresh a visual state of the Call button void updateCallBtnState(bool callIsActive); diff --git a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml index f2a8b39b04..b0adca0e0e 100644 --- a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml +++ b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml @@ -45,22 +45,5 @@ <menu_item_check.on_enable function="IMSession.Menu.ShowModes.Enable" parameter="IMShowNamesForP2PConv" /> - </menu_item_check> - <menu_item_separator layout="topleft" /> - <menu_item_check name="Translate_chat" label="Translate chat"> - <menu_item_check.on_click - function="Translating.Toggle" /> - <menu_item_check.on_check - function="Translating.On" /> - <menu_item_check.on_enable - function="Translating.Enabled" /> - </menu_item_check> - <menu_item_check name="Translation_settings" label="Translation settings..."> - <menu_item_check.on_check - function="Floater.Visible" - parameter="prefs_translation" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="prefs_translation" /> - </menu_item_check> + </menu_item_check> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_participant_view.xml b/indra/newview/skins/default/xui/en/menu_participant_view.xml index 2f2bafb95d..7ea87ee05c 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_view.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_view.xml @@ -89,4 +89,24 @@ function="Avatar.EnableItem" parameter="conversation_log" /> </menu_item_check> + <menu_item_separator layout="topleft" /> + <menu_item_check name="Translate_chat" label="Translate Nearby chat"> + <menu_item_check.on_click + function="IMFloaterContainer.Action" + parameter="Translating.Toggle" /> + <menu_item_check.on_check + function="IMFloaterContainer.Check" + parameter="Translating.On" /> + <menu_item_check.on_enable + function="IMFloaterContainer.Check" + parameter="Translating.Enabled" /> + </menu_item_check> + <menu_item_check name="Translation_settings" label="Translation settings..."> + <menu_item_check.on_check + function="Floater.Visible" + parameter="prefs_translation" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="prefs_translation" /> + </menu_item_check> </toggleable_menu> |