1 from gettext
import gettext
4 from tailsgreeter
.translatable_window
import TranslatableWindow
6 gi
.require_version("Gtk", "3.0")
7 from gi
.repository
import Gtk
# noqa: E402
12 class MessageDialog(Gtk
.MessageDialog
, TranslatableWindow
):
15 message_type
: Gtk
.MessageType
,
18 cancel_label
: str |
None = None,
19 ok_label
: str |
None = None,
20 third_button_label
: str |
None = None,
21 destructive
: bool = False,
23 Gtk
.MessageDialog
.__init
__(self
, message_type
=message_type
, text
=title
)
24 TranslatableWindow
.__init
__(self
, self
)
25 self
.format_secondary_text(text
)
27 self
.cancel_button
= self
.add_button(cancel_label
, Gtk
.ResponseType
.CANCEL
)
28 if third_button_label
:
29 self
.third_button
= self
.add_button(
30 third_button_label
, Gtk
.ResponseType
.REJECT
33 self
.ok_button
= self
.add_button(ok_label
, Gtk
.ResponseType
.OK
)
35 self
.ok_button
.get_style_context().add_class("destructive-action")
36 self
.store_translations(self
)