diff options
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r-- | indra/newview/llviewermessage.cpp | 102 |
1 files changed, 66 insertions, 36 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index df5e3021b1..bca7fbac33 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -76,6 +76,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpanelgrouplandmoney.h" +#include "llpanelmaininventory.h" #include "llrecentpeople.h" #include "llscriptfloater.h" #include "llscriptruntimeperms.h" @@ -1537,11 +1538,35 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam } //////////////////////////////////////////////////////////////////////////////// + static LLUICachedControl<bool> find_original_new_floater("FindOriginalOpenWindow", false); + //show in a new single-folder window + if(find_original_new_floater && !from_name.empty()) + { + const LLInventoryObject *obj = gInventory.getObject(obj_id); + if (obj && obj->getParentUUID().notNull()) + { + if (obj->getActualType() == LLAssetType::AT_CATEGORY) + { + LLPanelMainInventory::newFolderWindow(obj_id); + } + else + { + LLPanelMainInventory::newFolderWindow(obj->getParentUUID(), obj_id); + } + } + } + else + { // Highlight item const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false !from_name.empty(); // don't open if it's not from anyone. - LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id); + if(auto_open) + { + LLFloaterReg::showInstance("inventory"); + } + LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true); + } } } @@ -5920,42 +5945,47 @@ void container_inventory_arrived(LLViewerObject* object, { // create a new inventory category to put this in LLUUID cat_id; - cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(), - LLFolderType::FT_NONE, - LLTrans::getString("AcquiredItems")); + gInventory.createNewCategory( + gInventory.getRootFolderID(), + LLFolderType::FT_NONE, + LLTrans::getString("AcquiredItems"), + [inventory](const LLUUID &new_cat_id) + { + LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); + LLInventoryObject::object_list_t::const_iterator end = inventory->end(); + for (; it != end; ++it) + { + if ((*it)->getType() != LLAssetType::AT_CATEGORY) + { + LLInventoryObject* obj = (LLInventoryObject*)(*it); + LLInventoryItem* item = (LLInventoryItem*)(obj); + LLUUID item_id; + item_id.generate(); + time_t creation_date_utc = time_corrected(); + LLPointer<LLViewerInventoryItem> new_item + = new LLViewerInventoryItem(item_id, + new_cat_id, + item->getPermissions(), + item->getAssetUUID(), + item->getType(), + item->getInventoryType(), + item->getName(), + item->getDescription(), + LLSaleInfo::DEFAULT, + item->getFlags(), + creation_date_utc); + new_item->updateServer(TRUE); + gInventory.updateItem(new_item); + } + } + gInventory.notifyObservers(); - LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); - LLInventoryObject::object_list_t::const_iterator end = inventory->end(); - for ( ; it != end; ++it) - { - if ((*it)->getType() != LLAssetType::AT_CATEGORY) - { - LLInventoryObject* obj = (LLInventoryObject*)(*it); - LLInventoryItem* item = (LLInventoryItem*)(obj); - LLUUID item_id; - item_id.generate(); - time_t creation_date_utc = time_corrected(); - LLPointer<LLViewerInventoryItem> new_item - = new LLViewerInventoryItem(item_id, - cat_id, - item->getPermissions(), - item->getAssetUUID(), - item->getType(), - item->getInventoryType(), - item->getName(), - item->getDescription(), - LLSaleInfo::DEFAULT, - item->getFlags(), - creation_date_utc); - new_item->updateServer(TRUE); - gInventory.updateItem(new_item); - } - } - gInventory.notifyObservers(); - if(active_panel) - { - active_panel->setSelection(cat_id, TAKE_FOCUS_NO); - } + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) + { + active_panel->setSelection(new_cat_id, TAKE_FOCUS_NO); + } + }); } else if (inventory->size() == 2) { |