From d861768345ff531a69685b71d9e492378d10bc4c Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Tue, 18 May 2010 15:19:03 +0300 Subject: EXT-7381 FIXED (Nothing happens after clicking on some verb buttons of 'My Inventory' side panel) - \"options_gear_btn\", \"trash_btn\" and \"add_btn\" now initialized using getChild of the main inventory panel (to avoid another break if the \"bottom_panel\"'s control class will be changed again from LLLayoutStack to something other, e. g. reverted back to LLPanel) - mTrashButton member was added (which corresponds to \"trash_btn\" control) to optimize performance a little: LLPanelMainInventory::updateListCommands() updates \"trash_btn\"'s enabled state, so to avoid searching using getChild() again and again, a separate member was created. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/401/ --HG-- branch : product-engine --- indra/newview/llpanelmaininventory.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 327196d9ba..5ff51b8165 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -900,14 +900,12 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) void LLPanelMainInventory::initListCommandsHandlers() { - mListCommands = getChild("bottom_panel"); + childSetAction("options_gear_btn", boost::bind(&LLPanelMainInventory::onGearButtonClick, this)); + childSetAction("trash_btn", boost::bind(&LLPanelMainInventory::onTrashButtonClick, this)); + childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this)); - mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelMainInventory::onGearButtonClick, this)); - mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelMainInventory::onTrashButtonClick, this)); - mListCommands->childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this)); - - LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); - trash_btn->setDragAndDropHandler(boost::bind(&LLPanelMainInventory::handleDragAndDropToTrash, this + mTrashButton = getChild("trash_btn"); + mTrashButton->setDragAndDropHandler(boost::bind(&LLPanelMainInventory::handleDragAndDropToTrash, this , _4 // BOOL drop , _5 // EDragAndDropType cargo_type , _7 // EAcceptance* accept @@ -923,7 +921,7 @@ void LLPanelMainInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); - mListCommands->childSetEnabled("trash_btn", trash_enabled); + mTrashButton->setEnabled(trash_enabled); } void LLPanelMainInventory::onGearButtonClick() -- cgit v1.2.3