diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-05-04 15:00:33 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-05-04 15:00:33 +0300 |
commit | 00529b31b722d64699615241d95ea492134bc9bf (patch) | |
tree | 8984aaf701d01923f86fb552c110a46334cf7836 /indra | |
parent | fd337f2c43470df43e4145fc4a88250688a45c97 (diff) |
MAINT-7383 Revise notification for Empty Trash / Purge trash action to include number of items being deleted.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llavataractions.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llavataractions.h | 3 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 17 |
6 files changed, 55 insertions, 6 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 2045c3e297..0d0861efcc 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -930,6 +930,16 @@ void LLAvatarActions::shareWithAvatars(LLView * panel) } +//static +void LLAvatarActions::purgeSelectedItems() +{ + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + if (inventory_selected_uuids.empty()) return; + LLSD args; + args["COUNT"] = (S32)inventory_selected_uuids.size(); + LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), &callbackPurgeSelectedItems); +} + // static bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/) { @@ -1170,6 +1180,24 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con return false; } +bool LLAvatarActions::callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + if (inventory_selected_uuids.empty()) return false; + + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); + for (; it != it_end; ++it) + { + remove_inventory_object(*it, NULL); + } + } + return false; +} + // static bool LLAvatarActions::handleKick(const LLSD& notification, const LLSD& response) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 256d44d820..8ff1ef073d 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -125,6 +125,8 @@ public: */ static void shareWithAvatars(LLView * panel); + static void purgeSelectedItems(); + /** * Block/unblock the avatar. */ @@ -243,6 +245,7 @@ public: private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); + static bool callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response); static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id); static bool handleFreezeAvatar(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8a605ff574..0fe03583f5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3318,7 +3318,14 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT { if (!notification.empty()) { - LLNotificationsUtil::add(notification, LLSD(), LLSD(), + LLSD args; + if(LLFolderType::FT_TRASH == preferred_type) + { + static const U32 trash_max_capacity = gSavedSettings.getU32("InventoryTrashMaxCapacity"); + const LLUUID trash_id = findCategoryUUIDForType(preferred_type); + args["COUNT"] = (S32)getDescendentsCountRecursive(trash_id, trash_max_capacity); + } + LLNotificationsUtil::add(notification, args, LLSD(), boost::bind(&LLInventoryModel::callbackEmptyFolderType, this, _1, _2, preferred_type)); } else diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fa946ee5c7..adbcf377c0 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -118,6 +118,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this)); mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); + mCommitCallbackRegistrar.add("Inventory.Purge", boost::bind(&LLAvatarActions::purgeSelectedItems)); mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index e1f9269c70..7b3a9a2e3e 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -518,8 +518,7 @@ layout="topleft" name="Purge Item"> <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="purge" /> + function="Inventory.Purge"/> </menu_item_call> <menu_item_call label="Restore Item" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 60162bee23..90184a581e 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6188,13 +6188,24 @@ The folder '[FOLDERNAME]' is a system folder. Deleting system folders <notification icon="alertmodal.tga" + name="PurgeSelectedItems" + type="alertmodal"> +[COUNT] item(s) will be permanently deleted. Are you sure you want to permanently delete selected item(s) from your Trash? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="ConfirmEmptyTrash" type="alertmodal"> -Are you sure you want to permanently delete the contents of your Trash? +[COUNT] items will be permanently deleted. Are you sure you want to permanently delete the contents of your Trash? <tag>confirm</tag> <usetemplate - ignoretext="Confirm before I empty the inventory Trash folder" - name="okcancelignore" + name="okcancelbuttons" notext="Cancel" yestext="OK"/> </notification> |