diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloateroutbox.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 1 |
4 files changed, 37 insertions, 11 deletions
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index b15380d427..eb11933368 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -248,7 +248,7 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxInventoryPanel->setShape(inventory_placeholder_rect); // Set the sort order newest to oldest - mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME); mOutboxInventoryPanel->getFilter()->markDefault(); fetchOutboxContents(); @@ -340,19 +340,25 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - // Pass drag and drop to this floater to the outbox inventory control - if ((mOutboxInventoryPanel == NULL) || (mWindowShade && mWindowShade->isShown()) || LLMarketplaceInventoryImporter::getInstance()->isImportInProgress()) { return FALSE; } - - S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; - S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; - - return mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + + BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL); + + // Pass drag and drop to this floater to the outbox inventory control if no other children handle it + if (!handled) + { + S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; + S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; + + handled = mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + + return handled; } void LLFloaterOutbox::onImportButtonClicked() diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3d20b99c9b..4bc846faeb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3463,6 +3463,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { copy_item_to_outbox(inv_item, mUUID, LLUUID::null); } + else if (move_is_into_outbox && move_is_from_outbox) + { + move_item_within_outbox(inv_item, mUUID); + } // NORMAL or TRASH folder // (move the item, restamp if into trash) else diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 7040fef65e..6c5325620e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -588,7 +588,6 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) parent = next_parent; } } - } } @@ -620,8 +619,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL gInventory.notifyObservers(); } - copy_inventory_item( - gAgent.getID(), + copy_inventory_item(gAgent.getID(), inv_item->getPermissions().getOwner(), inv_item->getUUID(), dest_folder, @@ -641,6 +639,23 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL } } +void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) +{ + // when moving item directly into outbox create folder with that name + if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) + { + dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName()); + gInventory.notifyObservers(); + } + + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + + change_item_parent(&gInventory, + viewer_inv_item, + dest_folder, + false); +} + void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder) { LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName()); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 7b452537f8..9f0ee0571a 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -75,6 +75,7 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s void append_path(const LLUUID& id, std::string& path); void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder); +void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder); void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder); |