summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-02 10:12:57 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-02 10:12:57 -0400
commitc8ba633a4564da29d9b58b0e08ffb590bb3bce5f (patch)
tree16142170d61f2ecf0ad8a4d6194a152658527589 /indra/newview
parent3591afb2a8eba2599d76f3f41d413c882634f017 (diff)
Add 'UI' 'getParents' op to list top-menu 'parent_menu' names.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lluilistener.cpp15
-rw-r--r--indra/newview/lluilistener.h3
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
index 2b2187a73b..b81859a764 100644
--- a/indra/newview/lluilistener.cpp
+++ b/indra/newview/lluilistener.cpp
@@ -68,6 +68,11 @@ LLUIListener::LLUIListener():
&LLUIListener::getValue,
llsd::map("path", LLSD(), "reply", LLSD()));
+ add("getParents",
+ "List names of Top menus suitable for passing as \"parent_menu\"",
+ &LLUIListener::getParents,
+ llsd::map("reply", LLSD::String()));
+
LLSD required_args = llsd::map("name", LLSD(), "label", LLSD(), "reply", LLSD());
add("addMenu",
"Add new drop-down menu [\"name\"] with displayed [\"label\"] to the Top menu.",
@@ -174,7 +179,7 @@ void LLUIListener::callables(const LLSD& event) const
response["callables"] = list;
}
-void LLUIListener::getValue(const LLSD&event) const
+void LLUIListener::getValue(const LLSD& event) const
{
Response response(LLSD(), event);
@@ -192,6 +197,14 @@ void LLUIListener::getValue(const LLSD&event) const
}
}
+void LLUIListener::getParents(const LLSD& event) const
+{
+ Response response(LLSD(), event);
+ response["parents"] = llsd::toArray(
+ *gMenuBarView->getChildList(),
+ [](auto childp) {return childp->getName(); });
+}
+
LLMenuGL::Params get_params(const LLSD&event)
{
LLMenuGL::Params item_params;
diff --git a/indra/newview/lluilistener.h b/indra/newview/lluilistener.h
index c90253ab59..671eb5f29b 100644
--- a/indra/newview/lluilistener.h
+++ b/indra/newview/lluilistener.h
@@ -42,7 +42,8 @@ public:
private:
void call(const LLSD& event);
void callables(const LLSD& event) const;
- void getValue(const LLSD&event) const;
+ void getValue(const LLSD& event) const;
+ void getParents(const LLSD& event) const;
void addMenu(const LLSD&event) const;
void addMenuBranch(const LLSD&event) const;