diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-01 21:12:34 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-01 21:12:34 -0500 |
commit | 8fdd2e0b28121ead88da55c2be760a5f62b6d112 (patch) | |
tree | 326812c75067e8555096d79b207bde8ec397907d /indra/newview/llinventorypanel.cpp | |
parent | f62ea011ea5e99de16bd3bb761ea9203815ce0e6 (diff) |
EXT-3028 : "Find Original" does nothing if floater inventory isn't open
Changed logic for getActiveInventory so that it considers InventorySP.
Removed getActiveInventory and replaced with getActiveInventoryPanel since that follows its current usage.
This currently contains a bug because the InventorySP always thinks it's open.
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index f633225dbf..0d75561f27 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -31,21 +31,22 @@ */ #include "llviewerprecompiledheaders.h" +#include "llinventorypanel.h" #include <utility> // for std::pair<> -#include "llinventorypanel.h" - #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h" #include "llscrollcontainer.h" #include "llviewerfoldertype.h" -#include "llimfloater.h" #include "llvoavatarself.h" static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel"); @@ -841,12 +842,26 @@ void LLInventoryPanel::dumpSelectionInformation(void* user_data) 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<LLSidepanelInventory*>(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; for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { LLFloaterInventory* iv = dynamic_cast<LLFloaterInventory*>(*iter); - if (iv) + if (iv && iv->getVisible()) { S32 z_order = gFloaterView->getZOrder(iv); if (z_order < z_min) |