hide skip recycle bin option on delete dialog if file is already in recycle bin
This commit is contained in:
parent
bc85272855
commit
19a500f552
2 changed files with 7 additions and 3 deletions
|
@ -1070,15 +1070,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
val size = fileDirItem.getProperSize(this, countHidden = true).formatSize()
|
val size = fileDirItem.getProperSize(this, countHidden = true).formatSize()
|
||||||
val filename = "\"${getCurrentPath().getFilenameFromPath()}\""
|
val filename = "\"${getCurrentPath().getFilenameFromPath()}\""
|
||||||
val filenameAndSize = "$filename ($size)"
|
val filenameAndSize = "$filename ($size)"
|
||||||
|
val isInRecycleBin = getCurrentMedium()!!.getIsInRecycleBin()
|
||||||
|
|
||||||
val baseString = if (config.useRecycleBin && !config.tempSkipRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
val baseString = if (config.useRecycleBin && !config.tempSkipRecycleBin && !isInRecycleBin) {
|
||||||
R.string.move_to_recycle_bin_confirmation
|
R.string.move_to_recycle_bin_confirmation
|
||||||
} else {
|
} else {
|
||||||
R.string.deletion_confirmation
|
R.string.deletion_confirmation
|
||||||
}
|
}
|
||||||
|
|
||||||
val message = String.format(resources.getString(baseString), filenameAndSize)
|
val message = String.format(resources.getString(baseString), filenameAndSize)
|
||||||
DeleteWithRememberDialog(this, message, config.useRecycleBin) { remember, skipRecycleBin ->
|
val showSkipRecycleBinOption = config.useRecycleBin && !isInRecycleBin
|
||||||
|
|
||||||
|
DeleteWithRememberDialog(this, message, showSkipRecycleBinOption) { remember, skipRecycleBin ->
|
||||||
config.tempSkipDeleteConfirmation = remember
|
config.tempSkipDeleteConfirmation = remember
|
||||||
|
|
||||||
if (remember) {
|
if (remember) {
|
||||||
|
|
|
@ -508,8 +508,9 @@ class MediaAdapter(
|
||||||
val baseString =
|
val baseString =
|
||||||
if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation
|
if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation
|
||||||
val question = String.format(resources.getString(baseString), itemsAndSize)
|
val question = String.format(resources.getString(baseString), itemsAndSize)
|
||||||
|
val showSkipRecycleBinOption = config.useRecycleBin && !isRecycleBin
|
||||||
|
|
||||||
DeleteWithRememberDialog(activity, question, config.useRecycleBin) { remember, skipRecycleBin ->
|
DeleteWithRememberDialog(activity, question, showSkipRecycleBinOption) { remember, skipRecycleBin ->
|
||||||
config.tempSkipDeleteConfirmation = remember
|
config.tempSkipDeleteConfirmation = remember
|
||||||
|
|
||||||
if (remember) {
|
if (remember) {
|
||||||
|
|
Loading…
Reference in a new issue