Skip to content

Commit

Permalink
ensure delete button continue text always set
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Nov 15, 2024
1 parent 5e3b8a7 commit 844d801
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/securedrop_client/gui/source/delete/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(self, sources: list[Source], source_total: int) -> None:
super().__init__(show_header=False, dangerous=True)
self.sources = sources
self.source_total = source_total
self.continue_text = "CONTINUE"

# If the dialog is constructed with no sources, show a warning; otherwise,
# confirm the number and designation of the sources to be deleted
Expand All @@ -49,20 +50,20 @@ def __init__(self, sources: list[Source], source_total: int) -> None:
self._show_warning_nothing_selected()
else:
if num_sources < source_total:
continue_text = ngettext(
self.continue_text = ngettext(
"YES, DELETE ENTIRE SOURCE ACCOUNT",
"YES, DELETE {number} SOURCE ACCOUNTS",
num_sources,
).format(number=num_sources)
else:
continue_text = ngettext(
self.continue_text = ngettext(
"YES, DELETE ENTIRE SOURCE ACCOUNT", # in this case, all 1 accounts.
"YES, DELETE ALL {number} SOURCE ACCOUNTS",
num_sources,
).format(number=num_sources)

self.body.setText(self.make_body_text(self.sources, self.source_total))
self.continue_button.setText(continue_text)
self.continue_button.setText(self.continue_text)
self.cancel_button.setDefault(True)
self.cancel_button.setFocus()
self.confirmation_label.setText(_("Are you sure this is what you want?"))
Expand Down

0 comments on commit 844d801

Please sign in to comment.