diff options
author | Leslie Linden <leslie@lindenlab.com> | 2012-01-13 16:36:57 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2012-01-13 16:36:57 -0800 |
commit | 6b919e324e55ebcac0e2d33ca44a05fae9ac1d42 (patch) | |
tree | 9892da4c0a9224378b1f6dc65e1fb08c1912373c /indra/newview | |
parent | d6add298d7c793eda1fee2c03b2ccf91df7f6102 (diff) |
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.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 22 |
4 files changed, 53 insertions, 18 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 11e22d5226..270ef4fddc 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3690,7 +3690,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { if (move_is_from_outbox) { - move_item_within_outbox(inv_item, mUUID); + move_item_within_outbox(inv_item, mUUID, LLToolDragAndDrop::getOperationId()); } else { 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<LLSD> 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<LLSD> 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; diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index a93446000d..ce2b89b22e 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -75,7 +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, S32 operation_id); -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); void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1a4dab2ac5..e44fb3bf28 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -204,11 +204,23 @@ Save changes to current clothing/body part? name="ConfirmNoCopyToOutbox" type="alertmodal"> You don't have permission to copy one or more of these items to the Merchant Outbox. You can move them or leave them behind. - <usetemplate - name="okcancelbuttons" - notext="Don't move item(s)" - yestext="Move item(s)"/> - </notification> + <usetemplate + name="okcancelbuttons" + notext="Don't move item(s)" + yestext="Move item(s)"/> + </notification> + + <notification + icon="OutboxStatus_Success" + name="OutboxFolderCreated" + type="outbox"> +A new folder has been created for each item you have transferred into the top level of your Merchant Outbox. + + <usetemplate + ignoretext="A new folder was created in the Merchant Outbox" + name="okignore" + yestext="OK"/> + </notification> <notification icon="OutboxStatus_Success" |