summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-06-17 11:02:12 +0300
committerYuri Chebotarev <ychebotarev@productengine.com>2010-06-17 11:02:12 +0300
commit9eeaaf67387377fcf552be7cae5191df338f5a1e (patch)
treee28616facab195c0170a990553037160e351f912 /indra/newview/llinventoryfunctions.cpp
parent3ad0981d2f80a053a4bc22d659a129b3640852d4 (diff)
EXT-7791 FIX Show inventory panel if its not visible.
reviewed by Mike Antipov, Loren Shih at https://codereview.productengine.com/secondlife/r/599/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp43
1 files changed, 32 insertions, 11 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 68fc86467c..de24bd92d0 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -335,24 +335,34 @@ void show_item_profile(const LLUUID& item_uuid)
void show_item_original(const LLUUID& item_uuid)
{
+ //sidetray inventory panel
+ LLSidepanelInventory *sidepanel_inventory =
+ dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+
bool reset_inventory_filter = !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory");
LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
- if (!active_panel) return;
+ if (!active_panel)
+ {
+ //this may happen when there is no floatera and other panel is active in inventory tab
+
+ if (sidepanel_inventory)
+ {
+ sidepanel_inventory->showInventoryPanel();
+ }
+ }
+
+ active_panel = LLInventoryPanel::getActiveInventoryPanel();
+ if (!active_panel)
+ {
+ return;
+ }
active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_NO);
if(reset_inventory_filter)
{
- LLSidepanelInventory *sidepanel_inventory =
- dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
- if(sidepanel_inventory)
- {
- LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
-
- main_inventory->onFilterEdit("");
- }
-
- //now for inventory floater
+ //inventory floater
+ bool floater_inventory_visible = false;
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
@@ -364,8 +374,19 @@ void show_item_original(const LLUUID& item_uuid)
main_inventory->onFilterEdit("");
}
+
+ if(floater_inventory->getVisible())
+ {
+ floater_inventory_visible = true;
+ }
+
}
+ if(sidepanel_inventory && !floater_inventory_visible)
+ {
+ LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
+ main_inventory->onFilterEdit("");
+ }
}
}