summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-10-02 21:56:06 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-10-02 21:57:12 +0300
commitbcfd5d5279f1796abaf347d2276d2a0b9983f35e (patch)
tree391dc16b7cee5f5f4286eb2701a7b69f5942688a
parent4b74b82f8d1d0b9fb57dd21e6bf3caad410dd691 (diff)
SL-20367 Switch from index to value based selection
To make sure it won't happen again once new option gets added
-rw-r--r--indra/newview/llsidepaneltaskinfo.cpp33
1 files changed, 27 insertions, 6 deletions
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<LLSidepanelTaskInfo> 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<LLComboBox>("clickaction")->setCurrentByIndex((S32)click_action);
+ getChild<LLComboBox>("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);