[VMM] Actually connect the sort menu (probably still not)

This commit is contained in:
Lirusaito
2019-03-05 16:05:04 -05:00
parent 2524b407be
commit d7c7360205

View File

@@ -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<LLPanelMarketplaceListings>
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
mPtr->onViewSortMenuItemClicked(userdata["data"]);
return true;
}
};
struct MarketplaceViewSortCheckItem : public LLMemberListener<LLPanelMarketplaceListings>
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> 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<LLUICtrl>("sort_btn");
new LLBindMemberListener(this, "Marketplace.ViewSort.Action", [this](LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
LLMenuGL::sMenuContainer->findControl(userdata["control"].asString())->setValue(onViewSortMenuItemCheck(userdata["data"]));
});
new LLBindMemberListener(this, "Marketplace.ViewSort.CheckItem", [this](LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
onViewSortMenuItemClicked(userdata["data"]);
});
sort->setCommitCallback(boost::bind(showMenu, _1, mMenu));
mFilterEditor = getChild<LLFilterEditor>("filter_editor");