From 4b74b82f8d1d0b9fb57dd21e6bf3caad410dd691 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 29 Sep 2023 22:17:37 +0300 Subject: SL-20367 Click actions Zoom and Ignore can't be set from object's profile --- indra/newview/llsidepaneltaskinfo.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview/llsidepaneltaskinfo.cpp') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 225751ab92..1103db9baa 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -855,11 +855,12 @@ void LLSidepanelTaskInfo::refresh() U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { - LLComboBox* ComboClickAction = getChild("clickaction"); - if (ComboClickAction) - { - ComboClickAction->setCurrentByIndex((S32)click_action); - } + if (click_action > CLICK_ACTION_OPEN_MEDIA) + { + // Doesn't list media, nor play + click_action -= 2; + } + getChild("clickaction")->setCurrentByIndex((S32)click_action); } getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); @@ -1143,6 +1144,8 @@ static U8 string_value_to_click_action(std::string p_value) return CLICK_ACTION_ZOOM; if (p_value == "None") return CLICK_ACTION_DISABLED; + if (p_value == "Ignore") + return CLICK_ACTION_IGNORE; return CLICK_ACTION_TOUCH; } -- cgit v1.2.3 From bcfd5d5279f1796abaf347d2276d2a0b9983f35e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 2 Oct 2023 21:56:06 +0300 Subject: SL-20367 Switch from index to value based selection To make sure it won't happen again once new option gets added --- indra/newview/llsidepaneltaskinfo.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'indra/newview/llsidepaneltaskinfo.cpp') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 1103db9baa..525dd760ad 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -73,6 +73,32 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::sActivePanel = NULL; static LLPanelInjector t_task_info("sidepanel_task_info"); +static std::string click_action_to_string_value(U8 click_action) +{ + switch (click_action) + { + case CLICK_ACTION_TOUCH: + return "Touch"; + case CLICK_ACTION_SIT: + return "Sit"; + case CLICK_ACTION_BUY: + return "Buy"; + case CLICK_ACTION_PAY: + return "Pay"; + case CLICK_ACTION_OPEN: + return "Open"; + case CLICK_ACTION_ZOOM: + return "Zoom"; + case CLICK_ACTION_DISABLED: + return "None"; + case CLICK_ACTION_IGNORE: + return "Ignore"; + default: + return "Touch"; + } + return "Touch"; +} + // Default constructor LLSidepanelTaskInfo::LLSidepanelTaskInfo() { @@ -855,12 +881,7 @@ void LLSidepanelTaskInfo::refresh() U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { - if (click_action > CLICK_ACTION_OPEN_MEDIA) - { - // Doesn't list media, nor play - click_action -= 2; - } - getChild("clickaction")->setCurrentByIndex((S32)click_action); + getChild("clickaction")->setValue(click_action_to_string_value(click_action)); } getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); -- cgit v1.2.3