Skip to content

Commit 6ecabbe

Browse files
committed
Prompt user for choice of recycle/trash/cancel when deleting backups
1 parent d3534f8 commit 6ecabbe

File tree

4 files changed

+49
-18
lines changed

4 files changed

+49
-18
lines changed

rummage/lib/gui/dialogs/rummage_dialog.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# We forgot to patch the GUI, which will cause issues,
4444
# so raise a helpful error that points us to what we need to do.
4545
raise RuntimeError("GUI has not been patched. Please run tools/gui_patch.py") from e
46-
from .generic_dialogs import errormsg, yesno, infomsg
46+
from .generic_dialogs import errormsg, yesno, infomsg, yesno_cancel
4747
from ..app.custom_app import debug, error, get_log_file
4848
from ..controls import custom_statusbar
4949
from .regex_test_dialog import RegexTestDialog
@@ -2345,8 +2345,15 @@ def on_delete_backups(self, event):
23452345

23462346
from ..dialogs.delete_dialog import DeleteDialog
23472347

2348-
if not yesno(_("Are you sure you wish to delete all backup files/folders?")):
2348+
result = yesno_cancel(
2349+
_("Are you sure you wish to delete all backup files/folders?"),
2350+
yes=_('Recycle'),
2351+
no=_('Trash')
2352+
)
2353+
2354+
if result == wx.ID_CANCEL:
23492355
return
2356+
recycle = result == wx.ID_YES
23502357

23512358
target = self.m_searchin_text.GetValue()
23522359
backup_folder = bool(Settings.get_backup_type())
@@ -2357,7 +2364,7 @@ def on_delete_backups(self, event):
23572364
else:
23582365
pattern = f'**/*.{backup_location}'
23592366
flags = glob.G | glob.O
2360-
dlg = DeleteDialog(self, glob.iglob(pattern, flags=flags, root_dir=target), True)
2367+
dlg = DeleteDialog(self, glob.iglob(pattern, flags=flags, root_dir=target), recycle)
23612368
dlg.ShowModal()
23622369
dlg.Destroy()
23632370

rummage/lib/gui/localization/locale/en_US/LC_MESSAGES/rummage.po

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: rummage 3.6\n"
99
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10-
"POT-Creation-Date: 2025-08-03 23:58-0600\n"
10+
"POT-Creation-Date: 2025-08-04 08:38-0600\n"
1111
"PO-Revision-Date: 2018-02-04 21:10-0700\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language: en_US\n"
@@ -1045,20 +1045,28 @@ msgstr ""
10451045
msgid "Help and Support"
10461046
msgstr ""
10471047

1048-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2348
1048+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2349
10491049
msgid "Are you sure you wish to delete all backup files/folders?"
10501050
msgstr ""
10511051

1052-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2463
1052+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2350
1053+
msgid "Recycle"
1054+
msgstr ""
1055+
1056+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2351
1057+
msgid "Trash"
1058+
msgstr ""
1059+
1060+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2470
10531061
msgid "About"
10541062
msgstr ""
10551063

1056-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2464
1064+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2471
10571065
#, python-format
10581066
msgid "Version: %s %s"
10591067
msgstr ""
10601068

1061-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2465
1069+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2472
10621070
msgid "Developer(s)"
10631071
msgstr ""
10641072

rummage/lib/gui/localization/locale/ru_RU/LC_MESSAGES/rummage.po

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: PROJECT VERSION\n"
55
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
6-
"POT-Creation-Date: 2025-08-03 23:58-0600\n"
6+
"POT-Creation-Date: 2025-08-04 08:38-0600\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
88
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
99
"Language: ru_RU\n"
@@ -1069,20 +1069,28 @@ msgstr ""
10691069
msgid "Help and Support"
10701070
msgstr "Справка и поддержка"
10711071

1072-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2348
1072+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2349
10731073
msgid "Are you sure you wish to delete all backup files/folders?"
10741074
msgstr ""
10751075

1076-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2463
1076+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2350
1077+
msgid "Recycle"
1078+
msgstr ""
1079+
1080+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2351
1081+
msgid "Trash"
1082+
msgstr ""
1083+
1084+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2470
10771085
msgid "About"
10781086
msgstr "О нас"
10791087

1080-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2464
1088+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2471
10811089
#, python-format
10821090
msgid "Version: %s %s"
10831091
msgstr "Версия: %s %s"
10841092

1085-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2465
1093+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2472
10861094
#, fuzzy
10871095
msgid "Developer(s)"
10881096
msgstr ""

rummage/lib/gui/localization/locale/rummage.pot

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PROJECT VERSION\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2025-08-03 23:58-0600\n"
11+
"POT-Creation-Date: 2025-08-04 08:38-0600\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -1044,20 +1044,28 @@ msgstr ""
10441044
msgid "Help and Support"
10451045
msgstr ""
10461046

1047-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2348
1047+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2349
10481048
msgid "Are you sure you wish to delete all backup files/folders?"
10491049
msgstr ""
10501050

1051-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2463
1051+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2350
1052+
msgid "Recycle"
1053+
msgstr ""
1054+
1055+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2351
1056+
msgid "Trash"
1057+
msgstr ""
1058+
1059+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2470
10521060
msgid "About"
10531061
msgstr ""
10541062

1055-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2464
1063+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2471
10561064
#, python-format
10571065
msgid "Version: %s %s"
10581066
msgstr ""
10591067

1060-
#: rummage/lib/gui/dialogs/rummage_dialog.py:2465
1068+
#: rummage/lib/gui/dialogs/rummage_dialog.py:2472
10611069
msgid "Developer(s)"
10621070
msgstr ""
10631071

0 commit comments

Comments
 (0)