From d7c73602059768a79373a6952b414dcc65802b9e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Tue, 5 Mar 2019 16:05:04 -0500 Subject: [PATCH] [VMM] Actually connect the sort menu (probably still not) --- .../newview/llfloatermarketplacelistings.cpp | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 00f10ccdb..1caaf6c12 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -66,32 +66,21 @@ void showMenu(LLView* button, LLMenuGL* menu) const auto& rect = button->getRect(); LLMenuGL::showPopup(button, menu, rect.mLeft, rect.mBottom); } -struct MarketplaceViewSortAction : public LLMemberListener -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - mPtr->onViewSortMenuItemClicked(userdata["data"]); - return true; - } -}; - -struct MarketplaceViewSortCheckItem : public LLMemberListener -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLMenuGL::sMenuContainer->findControl(userdata["control"].asString())->setValue(mPtr->onViewSortMenuItemCheck(userdata["data"])); - return true; - } -}; BOOL LLPanelMarketplaceListings::postBuild() { childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this)); childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this)); - mMenu = LLUICtrlFactory::instance().buildMenu("menu_marketplace_view.xml", LLMenuGL::sMenuContainer); - (new MarketplaceViewSortAction)->registerListener(this, "Marketplace.ViewSort.Action"); - (new MarketplaceViewSortCheckItem)->registerListener(this, "Marketplace.ViewSort.CheckItem"); + mMenu = LLUICtrlFactory::instance().buildMenu("menu_marketplace_view.xml", this); auto sort = getChild("sort_btn"); + new LLBindMemberListener(this, "Marketplace.ViewSort.Action", [this](LLPointer event, const LLSD& userdata) + { + LLMenuGL::sMenuContainer->findControl(userdata["control"].asString())->setValue(onViewSortMenuItemCheck(userdata["data"])); + }); + new LLBindMemberListener(this, "Marketplace.ViewSort.CheckItem", [this](LLPointer event, const LLSD& userdata) + { + onViewSortMenuItemClicked(userdata["data"]); + }); sort->setCommitCallback(boost::bind(showMenu, _1, mMenu)); mFilterEditor = getChild("filter_editor");