From 5a4728d25a141866ee0e712e48824067d26fc696 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 13 Sep 2010 16:42:33 +0300 Subject: STORM-99 FIXED Fixed wrong name of item shown in confirmation popup when sharing items from undocked sidetray inventory. I couldn't repro situation when select was disabled, but problem with wrong items reproduced for me all the time. It happened because all detached tab floaters were getting name "floater", so couldn't be found by sidetray's getPanel(), and even if inventory could be found is_inventorysp_active() in LLInventoryPanel::getActiveInventoryPanel() would not let us reach point of getting it. - Added setting name of floater to sidebar tab's name on it's detach. - Added search of detached inventory tab to LLInventoryPanel::getActiveInventoryPanel() and if it is detached, inventory panel is found there, and z-order of floater is stored and later compared with z-orders of "inventory" floaters(the ones that are opened via Ctrl+Shift+I). --- indra/newview/llinventorypanel.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 820520df9e..50adae09c0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -916,6 +916,8 @@ BOOL is_inventorysp_active() // static LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { + S32 z_min = S32_MAX; + LLInventoryPanel* res = NULL; // A. If the inventory side panel is open, use that preferably. if (is_inventorysp_active()) { @@ -925,11 +927,26 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) return inventorySP->getActivePanel(); } } + // or if it is in floater undocked from sidetray get it and remember z order of floater to later compare it + // with other inventory floaters order. + else if (!LLSideTray::getInstance()->isTabAttached("sidebar_inventory")) + { + LLSidepanelInventory *inventorySP = + dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + LLFloater* inv_floater = LLFloaterReg::findInstance("side_bar_tab", LLSD("sidebar_inventory")); + if (inventorySP && inv_floater) + { + res = inventorySP->getActivePanel(); + z_min = gFloaterView->getZOrder(inv_floater); + } + else + { + llwarns << "Inventory tab is detached from sidetray, but either panel or floater were not found!" << llendl; + } + } // B. 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; - LLInventoryPanel* res = NULL; for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { LLFloaterInventory* iv = dynamic_cast(*iter); -- cgit v1.2.3