use a better confirmation dialog text at clearing the recycle bin

This commit is contained in:
tibbi 2021-04-18 20:04:21 +02:00
parent 851fddc67a
commit 4a20695d77

View file

@ -503,18 +503,22 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
config.skipDeleteConfirmation -> deleteFolders() config.skipDeleteConfirmation -> deleteFolders()
else -> { else -> {
val itemsCnt = selectedKeys.size val itemsCnt = selectedKeys.size
val items = if (itemsCnt == 1) { if (itemsCnt == 1 && getSelectedItems().first().isRecycleBin()) {
var folder = getSelectedPaths().first().getFilenameFromPath() ConfirmationDialog(activity, "", R.string.empty_recycle_bin_confirmation, R.string.yes, R.string.no) {
if (folder == RECYCLE_BIN) { deleteFolders()
folder = activity.getString(R.string.recycle_bin)
} }
return
}
val items = if (itemsCnt == 1) {
val folder = getSelectedPaths().first().getFilenameFromPath()
"\"$folder\"" "\"$folder\""
} else { } else {
resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt) resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
} }
val fileDirItem = getFirstSelectedItem() ?: return val fileDirItem = getFirstSelectedItem() ?: return
val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.isRecycleBin()) || (isOneItemSelected() && fileDirItem.areFavorites())) { val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.areFavorites())) {
R.string.deletion_confirmation R.string.deletion_confirmation
} else { } else {
R.string.move_to_recycle_bin_confirmation R.string.move_to_recycle_bin_confirmation