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.meow-7.2.2
parent
d6add298d7
commit
6b919e324e
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue