From 74f080ed31be1d261852f0f21376e9652e83cdef Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 2 Dec 2009 12:02:47 -0500 Subject: EXT-3028 : "Find Original" does nothing if floater inventory isn't open InventorySP will open if no inventory floaters are open. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0d75561f27..9945bb4404 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -843,18 +843,6 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() { LLInventoryPanel* res = NULL; - // If the inventorySP is opened and its main inventory view is active, use that. - LLSidepanelInventory *sidepanel_inventory = - dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); - if (sidepanel_inventory) - { - res = sidepanel_inventory->getActivePanel(); - if (res) - { - return res; - } - } - // Iterate through the inventory floaters and return whichever is on top. LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); S32 z_min = S32_MAX; @@ -871,5 +859,22 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() } } } + + // Otherwise, open the inventorySP and use that. + if (!res) + { + LLSD key; + LLSidepanelInventory *sidepanel_inventory = + dynamic_cast(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); + if (sidepanel_inventory) + { + res = sidepanel_inventory->getActivePanel(); + if (res) + { + return res; + } + } + } + return res; } -- cgit v1.2.3