diff options
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index c86d463a08..de24bd92d0 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -52,6 +52,7 @@ #include "llappearancemgr.h" #include "llappviewer.h" //#include "llfirstuse.h" +#include "llfloaterinventory.h" #include "llfocusmgr.h" #include "llfolderview.h" #include "llgesturemgr.h" @@ -63,6 +64,7 @@ #include "llinventorypanel.h" #include "lllineeditor.h" #include "llmenugl.h" +#include "llpanelmaininventory.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" #include "llpreviewnotecard.h" @@ -74,6 +76,7 @@ #include "llscrollcontainer.h" #include "llselectmgr.h" #include "llsidetray.h" +#include "llsidepanelinventory.h" #include "lltabcontainer.h" #include "lltooldraganddrop.h" #include "lluictrlfactory.h" @@ -332,9 +335,59 @@ 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) + { + //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) + { + LLFloaterInventory* floater_inventory = dynamic_cast<LLFloaterInventory*>(*iter); + if (floater_inventory) + { + LLPanelMainInventory* main_inventory = floater_inventory->getMainInventoryPanel(); + + 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(""); + } + } } ///---------------------------------------------------------------------------- |