summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-12-08 23:19:37 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-12-11 23:06:45 +0200
commit3b99af03ca5774bd817c803842eecfc205f77afd (patch)
tree6ee67e020487cdef603b0dd4cdb33f1e11abf29f /indra/newview/llinventorygallery.cpp
parent01a083ea647c2defcf7eace823f74f85321c97c5 (diff)
SL-20672 Item and folder creation support
Moving everything manually doesn't seem like a right way, probably need to make LLFolderView draw grids and then relace with LLInventoryPanel
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 62180bb066..97b82a581c 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2010,6 +2010,39 @@ void LLInventoryGallery::pasteAsLink(const LLUUID& dest,
}
}
+void LLInventoryGallery::doCreate(const LLUUID& dest, const LLSD& userdata)
+{
+
+ LLViewerInventoryCategory* cat = gInventory.getCategory(dest);
+ if (cat && mFolderID != dest)
+ {
+ menu_create_inventory_item(NULL, dest, userdata, LLUUID::null);
+ }
+ else
+ {
+ // todo: needs to reset current floater's filter,
+ // like reset_inventory_filter()
+
+ LLHandle<LLPanel> handle = getHandle();
+ std::function<void(const LLUUID&)> callback_cat_created =
+ [handle](const LLUUID& new_id)
+ {
+ gInventory.notifyObservers();
+ LLInventoryGallery* panel = static_cast<LLInventoryGallery*>(handle.get());
+ if (panel && new_id.notNull())
+ {
+ panel->clearSelection();
+ if (panel->mItemMap.count(new_id) != 0)
+ {
+ panel->addItemSelection(new_id, true);
+ }
+ }
+ };
+
+ menu_create_inventory_item(NULL, mFolderID, userdata, LLUUID::null, callback_cat_created);
+ }
+}
+
void LLInventoryGallery::claimEditHandler()
{
gEditMenuHandler = this;