From 2ee5550c9ee9307a34c77a1d5c9510ab4bea9408 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 15 Jun 2022 11:51:34 +0200 Subject: [PATCH] ui: add ability to change button label in SomethingFailed message box Signed-off-by: Olivier Gayot --- subiquitycore/ui/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subiquitycore/ui/utils.py b/subiquitycore/ui/utils.py index 5c855909..dd8f4269 100644 --- a/subiquitycore/ui/utils.py +++ b/subiquitycore/ui/utils.py @@ -344,9 +344,10 @@ def rewrap(text): class SomethingFailed(Stretchy): - def __init__(self, parent, msg, stderr): + def __init__(self, parent, msg, stderr, + *, btn_label: str = _("Close")) -> None: self.parent = parent - ok = other_btn(label=_("Close"), on_press=self.close) + ok = other_btn(label=btn_label, on_press=self.close) widgets = [ Text(msg), Text(""),