From 73bc0fb42b5bcd80030d9f30d5cb57ec2397ba08 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Sat, 17 Feb 2007 03:02:16 +0000 Subject: merge -r 56779:58057 /branches/selection_management --- indra/newview/llinventorymodel.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bdc57c798d..90455f5902 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -28,6 +28,7 @@ #include "llmutelist.h" #include "llnotify.h" #include "llcallbacklist.h" +#include "llpreview.h" #include //#define DIFF_INVENTORY_FILES @@ -2295,6 +2296,8 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo item_array_t items; update_map_t update; S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); + bool all_one_folder = true; + LLUUID folder_id; for(S32 i = 0; i < count; ++i) { LLPointer titem = new LLViewerInventoryItem; @@ -2321,6 +2324,14 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo { ++update[titem->getParentUUID()]; } + if (folder_id.isNull()) + { + folder_id = titem->getParentUUID(); + } + else + { + all_one_folder = false; + } } if(account) { @@ -2344,6 +2355,18 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); if(!gInventory.isObjectDescendentOf(lastitem->getUUID(), trash_id)) { + LLMultiPreview* multi_previewp = LLMultiPreview::getAutoOpenInstance(folder_id); + if (!multi_previewp && all_one_folder) + { + S32 left, top; + gFloaterView->getNewFloaterPosition(&left, &top); + + multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); + LLMultiPreview::setAutoOpenInstance(multi_previewp, folder_id); + } + + LLFloater::setFloaterHost(multi_previewp); + bool show_keep_discard = lastitem->getPermissions().getCreator() != gAgent.getID(); switch(lastitem->getType()) { @@ -2374,6 +2397,13 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, boo default: break; } + + LLFloater::setFloaterHost(NULL); + if (multi_previewp) + { + multi_previewp->open(); + } + LLInventoryView* view = LLInventoryView::getActiveInventory(); if(view) { -- cgit v1.2.3