summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;