From 855e1d9caa44ab738c09cb90401f966e7fa98824 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 13 Nov 2015 13:06:33 -0500 Subject: [PATCH] Add Double-click Autopilot option to System->General preferences. Translators: Nomade: Please review the french System->General and make sure it reads properly Damian: Please take care of translating panel_preferences_ascent_system.xml miKa: Please update the translation of panel_preferences_ascent_system.xml so it reads properly. --- indra/newview/llviewercontrol.cpp | 15 +++++++++++++++ indra/newview/llviewermenu.cpp | 11 +---------- .../xui/de/panel_preferences_ascent_system.xml | 5 +++-- .../xui/en-us/panel_preferences_ascent_system.xml | 6 ++++-- .../xui/es/panel_preferences_ascent_system.xml | 2 +- .../xui/fr/panel_preferences_ascent_system.xml | 3 ++- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index ba8d99b40..0c8aa144a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -654,6 +654,19 @@ static bool handleAllowLargeSounds(const LLSD& newvalue) return true; } +enum DCAction { AUTOPILOT, TELEPORT }; +static void handleDoubleClickActionChanged(const DCAction& action, const LLSD& newvalue) +{ + // Doubleclick actions - there can be only one + if (newvalue.asBoolean()) + { + if (action == AUTOPILOT) + gSavedSettings.setBOOL("DoubleClickTeleport", false); + else + gSavedSettings.setBOOL("DoubleClickAutopilot", false); + } +} + void handleHighResChanged(const LLSD& val) { if (val) // High Res Snapshot active, must uncheck RenderUIInSnapshot @@ -855,6 +868,8 @@ void settings_setup_listeners() gSavedSettings.getControl("AllowLargeSounds")->getSignal()->connect(boost::bind(&handleAllowLargeSounds, _2)); gSavedSettings.getControl("LiruUseZQSDKeys")->getSignal()->connect(boost::bind(load_default_bindings, _2)); + gSavedSettings.getControl("DoubleClickAutopilot")->getSignal()->connect(boost::bind(handleDoubleClickActionChanged, AUTOPILOT, _2)); + gSavedSettings.getControl("DoubleClickTeleport")->getSignal()->connect(boost::bind(handleDoubleClickActionChanged, TELEPORT, _2)); gSavedSettings.getControl("HighResSnapshot")->getSignal()->connect(boost::bind(&handleHighResChanged, _2)); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c9c223ad1..8543fdd54 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7306,16 +7306,7 @@ void menu_toggle_double_click_control(void* user_data) { std::string setting(static_cast(user_data)); LLControlVariable* control(gSavedSettings.getControl(setting)); - bool checked = control->get(); - // Doubleclick actions - there can be only one - if (!checked) - { - if (setting == "DoubleClickAutoPilot") - gSavedSettings.setBOOL("DoubleClickTeleport", false); - else if (setting == "DoubleClickTeleport") - gSavedSettings.setBOOL("DoubleClickAutoPilot", false); - } - control->set(!checked); + control->set(!control->get()); } diff --git a/indra/newview/skins/default/xui/de/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/de/panel_preferences_ascent_system.xml index f46bd45af..84a7da205 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_ascent_system.xml @@ -3,8 +3,9 @@ - - + + + diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index a865a499b..475211660 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -3,8 +3,10 @@ - + + + - + diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_system.xml index b8ec0dc57..6a4061171 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_system.xml @@ -3,7 +3,8 @@ - + +