From e69efc8369a65008d41155717761fbaec0e309c5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 12 Aug 2011 10:39:35 -0700 Subject: EXP-843 Enable drag and drop from the outbox EXP-1036 Disable most inventory functionality for the outbox view --- indra/newview/llinventoryfunctions.cpp | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index db3b968730..91026367c7 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -58,6 +58,7 @@ #include "llinventorypanel.h" #include "lllineeditor.h" #include "llmenugl.h" +#include "llnotificationsutil.h" #include "llpanelmaininventory.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" @@ -471,6 +472,102 @@ void show_item_original(const LLUUID& item_uuid) } } +void move_to_outbox_cb(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + + LLViewerInventoryItem * viitem = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + LLUUID dest_folder_id = notification["payload"]["dest_folder_id"].asUUID(); + + if (viitem) + { + // when moving item directly into outbox create folder with that name + if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) + { + dest_folder_id = gInventory.createNewCategory(dest_folder_id, LLFolderType::FT_NONE, viitem->getName()); + } + + //LLUUID old_parent = viitem->getParentUUID(); + + change_item_parent( + &gInventory, + viitem, + dest_folder_id, + false); + + //LLInventoryModel::cat_array_t* cat_array; + //LLInventoryModel::item_array_t* item_array; + //gInventory.getDirectDescendentsOf(old_parent,cat_array,item_array); + + //if (cat_array->empty() && item_array->empty()) + //{ + // remove_category(&gInventory, old_parent); + //} + } +} + +void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) +{ + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // 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()); + } + + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + dest_folder, + inv_item->getName(), + LLPointer(NULL)); + } + else + { + LLSD args; + args["ITEM_NAME"] = inv_item->getName(); + LLSD payload; + payload["item_id"] = inv_item->getUUID(); + payload["dest_folder_id"] = dest_folder; + LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); + } +} + +void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder) +{ + LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName()); + + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(inv_cat->getUUID(),cat_array,item_array); + + // copy the vector because otherwise the iterator won't be happy if we delete from it + LLInventoryModel::item_array_t item_array_copy = *item_array; + + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + copy_item_to_outbox(item, new_folder_id); + } + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLViewerInventoryCategory* category = *iter; + copy_folder_to_outbox(category, new_folder_id); + } + + // delete the folder if we have emptied it + //if (cat_array->empty() && item_array->empty()) + //{ + // remove_category(inventory_model, inv_cat->getUUID()); + //} +} + ///---------------------------------------------------------------------------- /// LLInventoryCollectFunctor implementations ///---------------------------------------------------------------------------- -- cgit v1.2.3 From 6f7132ca77d0507f2744bea5050a2ab1135cd88a Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 15 Aug 2011 09:53:26 -0700 Subject: deleting folders after no-copy move to outbox --- indra/newview/llinventoryfunctions.cpp | 52 ++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 91026367c7..b5be0a971d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -488,7 +488,7 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) dest_folder_id = gInventory.createNewCategory(dest_folder_id, LLFolderType::FT_NONE, viitem->getName()); } - //LLUUID old_parent = viitem->getParentUUID(); + LLUUID parent = viitem->getParentUUID(); change_item_parent( &gInventory, @@ -496,18 +496,45 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) dest_folder_id, false); - //LLInventoryModel::cat_array_t* cat_array; - //LLInventoryModel::item_array_t* item_array; - //gInventory.getDirectDescendentsOf(old_parent,cat_array,item_array); + LLUUID top_level_folder = notification["payload"]["top_level_folder"].asUUID(); + + if (top_level_folder != LLUUID::null) + { + LLViewerInventoryCategory* category; + + while (parent.notNull()) + { + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(parent,cat_array,item_array); + + LLUUID next_parent; + + category = gInventory.getCategory(parent); + + if (!category) break; + + next_parent = category->getParentUUID(); + + if (cat_array->empty() && item_array->empty()) + { + remove_category(&gInventory, parent); + } + + if (parent == top_level_folder) + { + break; + } + + parent = next_parent; + } + } - //if (cat_array->empty() && item_array->empty()) - //{ - // remove_category(&gInventory, old_parent); - //} } } -void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) + +void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder) { if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) { @@ -532,11 +559,12 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) LLSD payload; payload["item_id"] = inv_item->getUUID(); payload["dest_folder_id"] = dest_folder; + payload["top_level_folder"] = top_level_folder; LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); } } -void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder) +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()); @@ -550,7 +578,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - copy_item_to_outbox(item, new_folder_id); + copy_item_to_outbox(item, new_folder_id, top_level_folder); } LLInventoryModel::cat_array_t cat_array_copy = *cat_array; @@ -558,7 +586,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) { LLViewerInventoryCategory* category = *iter; - copy_folder_to_outbox(category, new_folder_id); + copy_folder_to_outbox(category, new_folder_id, top_level_folder); } // delete the folder if we have emptied it -- cgit v1.2.3 From 2d4d7e7ca36f8f3a6636d13410d3ca940e7d3498 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 16 Aug 2011 15:58:34 -0700 Subject: EXP-1093 User can place multiple copies of a no-copy item in merchant outbox to sell and can cause viewer to crash --- indra/newview/llinventoryfunctions.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index b5be0a971d..8632e40c54 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -486,6 +486,7 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { dest_folder_id = gInventory.createNewCategory(dest_folder_id, LLFolderType::FT_NONE, viitem->getName()); + gInventory.notifyObservers(); } LLUUID parent = viitem->getParentUUID(); @@ -542,6 +543,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_item->getName()); + gInventory.notifyObservers(); } copy_inventory_item( @@ -567,6 +569,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL 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()); + gInventory.notifyObservers(); LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; -- cgit v1.2.3 From f1c01becf27ab92a39c90d725c5bc70c73286e65 Mon Sep 17 00:00:00 2001 From: "leslie@leslie-HPz600.lindenlab.com" Date: Tue, 30 Aug 2011 16:18:34 -0700 Subject: EXP-857 PROGRESS -- Add context menu entries as alternate path to populate outbox * Folders containing items being worn now have the "Copy to Marketplace" context menu item disabled. --- indra/newview/llinventoryfunctions.cpp | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8632e40c54..0af013fde5 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -211,6 +211,58 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s model->notifyObservers(); } +class LLInventoryCollectAllItems : public LLInventoryCollectFunctor +{ +public: + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + return true; + } +}; + +BOOL get_is_parent_to_worn_item(const LLUUID& id) +{ + const LLViewerInventoryCategory* cat = gInventory.getCategory(id); + if (!cat) + { + return FALSE; + } + + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLInventoryCollectAllItems collect_all; + gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), cats, items, LLInventoryModel::EXCLUDE_TRASH, collect_all); + + for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it) + { + const LLViewerInventoryItem * const item = *it; + + llassert(item->getIsLinkType()); + + LLUUID linked_id = item->getLinkedUUID(); + const LLViewerInventoryItem * const linked_item = gInventory.getItem(linked_id); + + if (linked_item) + { + LLUUID parent_id = linked_item->getParentUUID(); + + while (!parent_id.isNull()) + { + LLInventoryCategory * parent_cat = gInventory.getCategory(parent_id); + + if (cat == parent_cat) + { + return TRUE; + } + + parent_id = parent_cat->getParentUUID(); + } + } + } + + return FALSE; +} + BOOL get_is_item_worn(const LLUUID& id) { const LLViewerInventoryItem* item = gInventory.getItem(id); -- cgit v1.2.3 From 0f3221e25d6261d7f29b5b37391156c07fde1d0c Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 27 Sep 2011 21:05:05 +0300 Subject: EXP-1225 FIXED Added a floater for My Inventory side tab. - Replaced calls to LLSideTray with LLFloaterSidePanelContainer. - Added LLFloaterSidePanelContainer::getPanel() for getting custom type panels. --- indra/newview/llinventoryfunctions.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 0af013fde5..acec02b507 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -47,6 +47,7 @@ #include "llappviewer.h" //#include "llfirstuse.h" #include "llfloaterinventory.h" +#include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" #include "llfolderview.h" #include "llgesturemgr.h" @@ -459,22 +460,28 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id) { - LLSideTray::getInstance()->showPanel("sidepanel_inventory", LLSD().with("id", item_uuid).with("object", object_id)); + LLFloaterSidePanelContainer::showPanel("my_inventory", LLSD().with("id", item_uuid).with("object", object_id)); } void show_item_profile(const LLUUID& item_uuid) { LLUUID linked_uuid = gInventory.getLinkedItemID(item_uuid); - LLSideTray::getInstance()->showPanel("sidepanel_inventory", LLSD().with("id", linked_uuid)); + LLFloaterSidePanelContainer::showPanel("my_inventory", LLSD().with("id", linked_uuid)); } void show_item_original(const LLUUID& item_uuid) { + LLFloater* floater_my_inventory = LLFloaterReg::getInstance("my_inventory"); + if (!floater_my_inventory) + { + llwarns << "Could not find My Inventory floater" << llendl; + return; + } + //sidetray inventory panel - LLSidepanelInventory *sidepanel_inventory = - dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("my_inventory"); - bool reset_inventory_filter = !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"); + bool reset_inventory_filter = !floater_my_inventory->isInVisibleChain(); LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (!active_panel) -- cgit v1.2.3 From 9d3fc5d930bd1dae07771350080e5140c0113891 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 29 Sep 2011 21:43:07 +0300 Subject: EXP-1209 FIXED Sidetray removed. - Removed all sidetray dependencies and the sidetray itself. - Also removed LLFloaterSidetrayTab and LLSidetrayListener as unused. --- indra/newview/llinventoryfunctions.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index acec02b507..21a026bcf7 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -71,7 +71,6 @@ #include "llscrollbar.h" #include "llscrollcontainer.h" #include "llselectmgr.h" -#include "llsidetray.h" #include "llsidepanelinventory.h" #include "lltabcontainer.h" #include "lltooldraganddrop.h" -- cgit v1.2.3 From 0ff49e798c6bed6fe888ac463c746bc06036d876 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 17 Oct 2011 15:18:19 -0700 Subject: EXP-1359 FIX -- Selecting New Inventory window from gear menu in Inventory panel opens old My Inventory panel * Removed old inventory panel. * Renamed new inventory panel from "my_inventory" to "inventory" Reviewed by Richard. --- indra/newview/llinventoryfunctions.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 21a026bcf7..5fb3f15cd5 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -459,28 +459,28 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id) { - LLFloaterSidePanelContainer::showPanel("my_inventory", LLSD().with("id", item_uuid).with("object", object_id)); + LLFloaterSidePanelContainer::showPanel("inventory", LLSD().with("id", item_uuid).with("object", object_id)); } void show_item_profile(const LLUUID& item_uuid) { LLUUID linked_uuid = gInventory.getLinkedItemID(item_uuid); - LLFloaterSidePanelContainer::showPanel("my_inventory", LLSD().with("id", linked_uuid)); + LLFloaterSidePanelContainer::showPanel("inventory", LLSD().with("id", linked_uuid)); } void show_item_original(const LLUUID& item_uuid) { - LLFloater* floater_my_inventory = LLFloaterReg::getInstance("my_inventory"); - if (!floater_my_inventory) + LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); + if (!floater_inventory) { llwarns << "Could not find My Inventory floater" << llendl; return; } //sidetray inventory panel - LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("my_inventory"); + LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); - bool reset_inventory_filter = !floater_my_inventory->isInVisibleChain(); + bool reset_inventory_filter = !floater_inventory->isInVisibleChain(); LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (!active_panel) -- cgit v1.2.3 From 9fcdec3e34d689ccfb74fb4905fa975f5819270a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 11:15:01 -0800 Subject: EXP-1679 FIX -- Collapse links that are dragged to the outbox * Links are automatically tracked back to their source when dragged to the outbox * Worn items are now allowed into the outbox --- indra/newview/llinventoryfunctions.cpp | 63 +++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 23 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 5fb3f15cd5..7040fef65e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -595,32 +595,49 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder) { - if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + // Collapse links directly to items/folders + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + if (linked_category != NULL) { - // 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(); - } - - copy_inventory_item( - gAgent.getID(), - inv_item->getPermissions().getOwner(), - inv_item->getUUID(), - dest_folder, - inv_item->getName(), - LLPointer(NULL)); + copy_folder_to_outbox(linked_category, dest_folder, top_level_folder); } else - { - LLSD args; - args["ITEM_NAME"] = inv_item->getName(); - LLSD payload; - payload["item_id"] = inv_item->getUUID(); - payload["dest_folder_id"] = dest_folder; - payload["top_level_folder"] = top_level_folder; - LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); + { + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + if (linked_item != NULL) + { + inv_item = (LLInventoryItem *) linked_item; + } + + // Check for copy permissions + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // 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(); + } + + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + dest_folder, + inv_item->getName(), + LLPointer(NULL)); + } + else + { + LLSD args; + args["ITEM_NAME"] = inv_item->getName(); + LLSD payload; + payload["item_id"] = inv_item->getUUID(); + payload["dest_folder_id"] = dest_folder; + payload["top_level_folder"] = top_level_folder; + LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); + } } } -- cgit v1.2.3 From d7fabfee19e536dd8df356fd4531437ccb3630d5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 13:56:41 -0800 Subject: EXP-1715 FIX -- Merchant outbox drag and drop has offset between mouse position and selected folder EXP-1717 FIX -- Drag and drop within the outbox can result in an item created at the top level of the outbox Folders are now created for items dragged around within the merchant outbox if their drop target is the top level outbox inventory panel itself. --- indra/newview/llinventoryfunctions.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') 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()); -- cgit v1.2.3 From 26998a5e387edca7d89159673c3dc8cd1a8d7539 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 5 Jan 2012 12:42:58 -0800 Subject: EXP-1753 FIX -- Open Merchant Outbox floater when user selects copy to Merchant Outbox context menu option in Inventory * Modified "copy to merchant outbox" and "move to merchant outbox" context menu actions to also open the merchant outbox floater * Changed context menu behavior to always preserve disabled menu items on multiselect rather than occasionally ignoring it --- indra/newview/llinventoryfunctions.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 6c5325620e..e8efac1ebf 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -530,6 +530,11 @@ void show_item_original(const LLUUID& item_uuid) } } +void open_outbox() +{ + LLFloaterReg::showInstance("outbox"); +} + void move_to_outbox_cb(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -588,6 +593,8 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) parent = next_parent; } } + + open_outbox(); } } @@ -625,6 +632,8 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL dest_folder, inv_item->getName(), LLPointer(NULL)); + + open_outbox(); } else { @@ -682,11 +691,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold copy_folder_to_outbox(category, new_folder_id, top_level_folder); } - // delete the folder if we have emptied it - //if (cat_array->empty() && item_array->empty()) - //{ - // remove_category(inventory_model, inv_cat->getUUID()); - //} + open_outbox(); } ///---------------------------------------------------------------------------- -- cgit v1.2.3 From ba41aea4b2813ac96cad2bae7c82da6e5eefd63a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 12 Jan 2012 17:01:23 -0800 Subject: EXP-1795 FIX -- Update warning dialog for dragging and dropping no-copy items to Merchant Outbox * Any drag and drop or copy operation to the merchant outbox that contains one or more no-copy items now brings up a single modal dialog prompting the user to move the no-copy items to the outbox or to leave them all behind. --- indra/newview/llinventoryfunctions.cpp | 60 +++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index e8efac1ebf..7672f7e674 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -82,6 +82,8 @@ #include "llvoavatarself.h" #include "llwearablelist.h" +#include + BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; @@ -535,13 +537,10 @@ void open_outbox() LLFloaterReg::showInstance("outbox"); } -void move_to_outbox_cb(const LLSD& notification, const LLSD& response) +void move_to_outbox_cb_action(const LLSD& payload) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) return; // canceled - - LLViewerInventoryItem * viitem = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - LLUUID dest_folder_id = notification["payload"]["dest_folder_id"].asUUID(); + LLViewerInventoryItem * viitem = gInventory.getItem(payload["item_id"].asUUID()); + LLUUID dest_folder_id = payload["dest_folder_id"].asUUID(); if (viitem) { @@ -560,12 +559,12 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) dest_folder_id, false); - LLUUID top_level_folder = notification["payload"]["top_level_folder"].asUUID(); + LLUUID top_level_folder = payload["top_level_folder"].asUUID(); if (top_level_folder != LLUUID::null) { LLViewerInventoryCategory* category; - + while (parent.notNull()) { LLInventoryModel::cat_array_t* cat_array; @@ -593,20 +592,41 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) parent = next_parent; } } - + open_outbox(); } } +static S32 move_to_outbox_operation_id = -1; +static std::list move_to_outbox_payloads; + +void move_to_outbox_cb(const LLSD& notification, const LLSD& response) +{ + const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + llassert(move_to_outbox_payloads.size() > 0); + + BOOST_FOREACH(const LLSD& payload, move_to_outbox_payloads) + { + move_to_outbox_cb_action(payload); + } + } + + move_to_outbox_operation_id = -1; + move_to_outbox_payloads.clear(); +} + -void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder) +void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id) { // Collapse links directly to items/folders LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); if (linked_category != NULL) { - copy_folder_to_outbox(linked_category, dest_folder, top_level_folder); + copy_folder_to_outbox(linked_category, dest_folder, top_level_folder, operation_id); } else { @@ -639,11 +659,21 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL { LLSD args; args["ITEM_NAME"] = inv_item->getName(); + LLSD payload; payload["item_id"] = inv_item->getUUID(); payload["dest_folder_id"] = dest_folder; payload["top_level_folder"] = top_level_folder; - LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); + + if (move_to_outbox_operation_id != operation_id) + { + LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); + + move_to_outbox_operation_id = operation_id; + move_to_outbox_payloads.clear(); + } + + move_to_outbox_payloads.push_back(payload); } } } @@ -665,7 +695,7 @@ void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) false); } -void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder) +void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id) { LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName()); gInventory.notifyObservers(); @@ -680,7 +710,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - copy_item_to_outbox(item, new_folder_id, top_level_folder); + copy_item_to_outbox(item, new_folder_id, top_level_folder, operation_id); } LLInventoryModel::cat_array_t cat_array_copy = *cat_array; @@ -688,7 +718,7 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) { LLViewerInventoryCategory* category = *iter; - copy_folder_to_outbox(category, new_folder_id, top_level_folder); + copy_folder_to_outbox(category, new_folder_id, top_level_folder, operation_id); } open_outbox(); -- cgit v1.2.3 From 6b919e324e55ebcac0e2d33ca44a05fae9ac1d42 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 13 Jan 2012 16:36:57 -0800 Subject: EXP-1803 FIX -- Notify the user when a folder is automatically created for them in the outbox * New confirmation dialog lets them know when a folder was automatically created to contain an item dragged/copied to the outbox. --- indra/newview/llinventoryfunctions.cpp | 45 +++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 7672f7e674..f5be271a68 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -532,11 +532,39 @@ void show_item_original(const LLUUID& item_uuid) } } + +static S32 create_folder_in_outbox_operation_id = -1; +static S32 move_to_outbox_operation_id = -1; +static std::list move_to_outbox_payloads; + void open_outbox() { LLFloaterReg::showInstance("outbox"); } +void folder_created_in_outbox_cb(const LLSD& notification, const LLSD& response) +{ + create_folder_in_outbox_operation_id = -1; +} + +LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id) +{ + llassert(item); + llassert(destFolderId.notNull()); + + LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName()); + gInventory.notifyObservers(); + + if (create_folder_in_outbox_operation_id != operation_id) + { + LLNotificationsUtil::add("OutboxFolderCreated", LLSD(), LLSD(), boost::bind(&folder_created_in_outbox_cb, _1, _2)); + + create_folder_in_outbox_operation_id = operation_id; + } + + return created_folder_id; +} + void move_to_outbox_cb_action(const LLSD& payload) { LLViewerInventoryItem * viitem = gInventory.getItem(payload["item_id"].asUUID()); @@ -547,8 +575,8 @@ void move_to_outbox_cb_action(const LLSD& payload) // when moving item directly into outbox create folder with that name if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { - dest_folder_id = gInventory.createNewCategory(dest_folder_id, LLFolderType::FT_NONE, viitem->getName()); - gInventory.notifyObservers(); + S32 operation_id = payload["operation_id"].asInteger(); + dest_folder_id = create_folder_in_outbox_for_item(viitem, dest_folder_id, operation_id); } LLUUID parent = viitem->getParentUUID(); @@ -597,9 +625,6 @@ void move_to_outbox_cb_action(const LLSD& payload) } } -static S32 move_to_outbox_operation_id = -1; -static std::list move_to_outbox_payloads; - void move_to_outbox_cb(const LLSD& notification, const LLSD& response) { const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -618,7 +643,6 @@ void move_to_outbox_cb(const LLSD& notification, const LLSD& response) move_to_outbox_payloads.clear(); } - void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id) { // Collapse links directly to items/folders @@ -642,8 +666,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL // 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(); + dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id); } copy_inventory_item(gAgent.getID(), @@ -664,6 +687,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL payload["item_id"] = inv_item->getUUID(); payload["dest_folder_id"] = dest_folder; payload["top_level_folder"] = top_level_folder; + payload["operation_id"] = operation_id; if (move_to_outbox_operation_id != operation_id) { @@ -678,13 +702,12 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL } } -void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder) +void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id) { // 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(); + dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id); } LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; -- cgit v1.2.3 From 577479a3e53ef152da191e3a004aeb34f0815658 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 17 Jan 2012 09:36:14 -0800 Subject: EXP-1803 CLEAN-UP -- Modified code to use the "unique" tag on the notification. --- indra/newview/llinventoryfunctions.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f5be271a68..40bc3b76c9 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -533,7 +533,6 @@ void show_item_original(const LLUUID& item_uuid) } -static S32 create_folder_in_outbox_operation_id = -1; static S32 move_to_outbox_operation_id = -1; static std::list move_to_outbox_payloads; @@ -542,11 +541,6 @@ void open_outbox() LLFloaterReg::showInstance("outbox"); } -void folder_created_in_outbox_cb(const LLSD& notification, const LLSD& response) -{ - create_folder_in_outbox_operation_id = -1; -} - LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id) { llassert(item); @@ -555,12 +549,7 @@ LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& des LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName()); gInventory.notifyObservers(); - if (create_folder_in_outbox_operation_id != operation_id) - { - LLNotificationsUtil::add("OutboxFolderCreated", LLSD(), LLSD(), boost::bind(&folder_created_in_outbox_cb, _1, _2)); - - create_folder_in_outbox_operation_id = operation_id; - } + LLNotificationsUtil::add("OutboxFolderCreated"); return created_folder_id; } -- cgit v1.2.3 From e4b63c96b83a1ed8c18946ecd64c21d6bd7c26fe Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 17 Jan 2012 14:59:18 -0800 Subject: EXP-1804 FIX -- Drag and drop operations can be blocked by modal dialogs * Added support for marketplace notifications that don't display the dialog until the next frame, leaving room for the drag and drop operation to properly complete before the notification shows up and interferes. --- indra/newview/llinventoryfunctions.cpp | 39 ++++------------------------------ 1 file changed, 4 insertions(+), 35 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 40bc3b76c9..dd92188e9d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -58,6 +58,7 @@ #include "llinventorymodel.h" #include "llinventorypanel.h" #include "lllineeditor.h" +#include "llmarketplacenotifications.h" #include "llmenugl.h" #include "llnotificationsutil.h" #include "llpanelmaininventory.h" @@ -533,9 +534,6 @@ void show_item_original(const LLUUID& item_uuid) } -static S32 move_to_outbox_operation_id = -1; -static std::list move_to_outbox_payloads; - void open_outbox() { LLFloaterReg::showInstance("outbox"); @@ -614,24 +612,6 @@ void move_to_outbox_cb_action(const LLSD& payload) } } -void move_to_outbox_cb(const LLSD& notification, const LLSD& response) -{ - const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if (option == 0) - { - llassert(move_to_outbox_payloads.size() > 0); - - BOOST_FOREACH(const LLSD& payload, move_to_outbox_payloads) - { - move_to_outbox_cb_action(payload); - } - } - - move_to_outbox_operation_id = -1; - move_to_outbox_payloads.clear(); -} - void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id) { // Collapse links directly to items/folders @@ -668,25 +648,14 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL open_outbox(); } else - { - LLSD args; - args["ITEM_NAME"] = inv_item->getName(); - + { LLSD payload; payload["item_id"] = inv_item->getUUID(); payload["dest_folder_id"] = dest_folder; payload["top_level_folder"] = top_level_folder; payload["operation_id"] = operation_id; - - if (move_to_outbox_operation_id != operation_id) - { - LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&move_to_outbox_cb, _1, _2)); - - move_to_outbox_operation_id = operation_id; - move_to_outbox_payloads.clear(); - } - - move_to_outbox_payloads.push_back(payload); + + LLMarketplaceInventoryNotifications::addNoCopyNotification(payload, move_to_outbox_cb_action); } } } -- cgit v1.2.3