summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-30 13:10:36 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-05-30 13:10:36 +0300
commit5c55adae47cab93a12793528373f639ea9e8efcf (patch)
treeffc13bb9ee911a2ed2560e008d585363b2059638 /indra/newview/llinventorypanel.cpp
parentd42f2a1887a1bc94a97c08bfe676731672ce53d3 (diff)
SL-19773 add context menu for root folder in single folder mode
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 2226384ba2..bd15e55b9a 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -2116,6 +2116,7 @@ LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
mCommitCallbackRegistrar.add("Inventory.OpenSelectedFolder", boost::bind(&LLInventorySingleFolderPanel::openInCurrentWindow, this, _2));
mCommitCallbackRegistrar.replace("Inventory.DoCreate", boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2));
+ mCommitCallbackRegistrar.replace("Inventory.Share", boost::bind(&LLInventorySingleFolderPanel::doShare, this));
}
LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel()
@@ -2138,6 +2139,7 @@ void LLInventorySingleFolderPanel::initFromParams(const Params& p)
pane_params.open_first_folder = false;
pane_params.start_folder.id = mFolderID;
LLInventoryPanel::initFromParams(pane_params);
+ mFolderRoot.get()->setSingleFolderMode(true);
}
void LLInventorySingleFolderPanel::openInCurrentWindow(const LLSD& userdata)
@@ -2219,7 +2221,7 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()
LLFolderView* folder_view = createFolderRoot(root_id);
folder_view->setChildrenInited(false);
mFolderRoot = folder_view->getHandle();
-
+ mFolderRoot.get()->setSingleFolderMode(true);
addItemID(root_id, mFolderRoot.get());
LLRect scroller_view_rect = getRect();
@@ -2285,6 +2287,19 @@ void LLInventorySingleFolderPanel::doCreate(const LLSD& userdata)
reset_inventory_filter();
menu_create_inventory_item(this, dest_id, userdata);
}
+
+void LLInventorySingleFolderPanel::doShare()
+{
+ if(mFolderRoot.get()->getCurSelectedItem() == NULL)
+ {
+ std::set<LLUUID> uuids{mFolderID};
+ LLAvatarActions::shareWithAvatars(uuids, gFloaterView->getParentFloater(this));
+ }
+ else
+ {
+ LLAvatarActions::shareWithAvatars(this);
+ }
+}
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/************************************************************************/