summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-07 19:30:30 +0200
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-07 19:30:55 +0200
commitea94cda5f5bb9a426782ee7c7aebb1095ba444c1 (patch)
tree68d4d1a1f7ca5b89678e0dad0f45891ad721a5dc /indra
parent8b8d4795a76246915b15d19154723cdb1f20ba99 (diff)
SL-19356 bring SFV to the top instead of opening a new window if there’s already one open for that folder
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelmaininventory.cpp30
-rw-r--r--indra/newview/llpanelmaininventory.h1
2 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 6b9e04840d..a3ac64aee8 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -415,8 +415,33 @@ void LLPanelMainInventory::newWindow()
}
}
+//static
void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_select)
{
+ 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();)
+ {
+ LLFloaterSidePanelContainer* inventory_container = dynamic_cast<LLFloaterSidePanelContainer*>(*iter++);
+ if (inventory_container)
+ {
+ LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(inventory_container->findChild<LLPanel>("main_panel", true));
+ if (sidepanel_inventory)
+ {
+ LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
+ if (main_inventory && main_inventory->isSingleFolderMode()
+ && (main_inventory->getSingleFolderViewRoot() == folder_id))
+ {
+ main_inventory->setFocus(true);
+ if(item_to_select.notNull())
+ {
+ sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES);
+ }
+ return;
+ }
+ }
+ }
+ }
+
S32 instance_num = get_instance_num();
LLFloaterSidePanelContainer* inventory_container = LLFloaterReg::showTypedInstance<LLFloaterSidePanelContainer>("inventory", LLSD(instance_num));
@@ -1346,6 +1371,11 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool
}
}
+LLUUID LLPanelMainInventory::getSingleFolderViewRoot()
+{
+ return mSingleFolderPanelInventory->getSingleFolderRoot();
+}
+
void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name)
{
if (menu)
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 7edaf7db96..b0f520ac5e 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -104,6 +104,7 @@ public:
void onBackFolderClicked();
void onForwardFolderClicked();
void setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history = true);
+ LLUUID getSingleFolderViewRoot();
bool isSingleFolderMode() { return mSingleFolderMode; }
protected: