FIRE-31816: Include selection count when deleting more than one object from inventory

master
Ansariel 2022-08-15 14:41:11 +02:00
parent 7d4c73b7b5
commit 714f669c06
3 changed files with 36 additions and 5 deletions

View File

@ -2653,7 +2653,38 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
// </FS:Ansariel>
LLSD args;
args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem");
// <FS:Ansariel> FIRE-31816: Include selection count when deleting more than one object from inventory
//args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem");
//args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem", args);
LLLocale locale("");
std::string count_str{};
S32 selection_count = root->getSelectedCount();
S32 total_count{ 0 };
for (const auto item : root->getSelectedItems())
{
total_count++;
LLFolderViewModelItemInventory * view_model = dynamic_cast<LLFolderViewModelItemInventory *>(item->getViewModelItem());
if (view_model)
{
auto cat = model->getCategory(view_model->getUUID());
if (cat)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
model->collectDescendents(cat->getUUID(), cats, items, TRUE);
total_count += (S32)(cats.size() + items.size());
}
}
}
LLResMgr::instance().getIntegerString(count_str, selection_count);
args["COUNT_SELECTION"] = count_str;
LLResMgr::instance().getIntegerString(count_str, total_count);
args["COUNT_TOTAL"] = count_str;
args["QUESTION"] = LLTrans::getString(selection_count > 1 ? "DeleteItems" : "DeleteItem", args);
// </FS:Ansariel>
LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root->getHandle()));
}
// Note: marketplace listings will be updated in the callback if delete confirmed

View File

@ -5458,10 +5458,10 @@ Falls der Fehler weiterhin auftritt, überprüfen Sie bitte Ihre Netzwerk- und F
Meine Premium-Mitgliedschaft
</string>
<string name="DeleteItems">
Ausgewählte Objekte löschen?
Ausgewählte [COUNT_SELECTION] Objekte löschen ([COUNT_TOTAL] insgesamt)?
</string>
<string name="DeleteItem">
Ausgewähltes Objekt löschen?
Ausgewähltes Objekt löschen ([COUNT_TOTAL] insgesamt)?
</string>
<string name="EmptyOutfitText">
Keine Objekte in diesem Outfit

View File

@ -2502,8 +2502,8 @@ If you continue to experience problems, please check your network and firewall s
<string name="MembershipPremiumText">My Premium membership</string>
<!-- Question strings for delete items notifications -->
<string name="DeleteItems">Delete selected items?</string>
<string name="DeleteItem">Delete selected item?</string>
<string name="DeleteItems">Delete selected [COUNT_SELECTION] items ([COUNT_TOTAL]] total)?</string>
<string name="DeleteItem">Delete selected item ([COUNT_TOTAL]] total)?</string>
<string name="EmptyOutfitText">There are no items in this outfit</string>