aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelian R <arusanu@gmail.com>2026-03-26 21:39:42 +0200
committerAurelian R <arusanu@gmail.com>2026-03-26 21:39:42 +0200
commit10c8891ea8c180a37f364dd947cacaebc4ca2954 (patch)
tree7a26fee7799072ae7e370109a0f4b13b9458eb7b
parent340aca6721d54b02bfb2bb3e109bf7241c9e97f0 (diff)
downloadmsec-10c8891ea8c180a37f364dd947cacaebc4ca2954.tar
msec-10c8891ea8c180a37f364dd947cacaebc4ca2954.tar.gz
msec-10c8891ea8c180a37f364dd947cacaebc4ca2954.tar.bz2
msec-10c8891ea8c180a37f364dd947cacaebc4ca2954.tar.xz
msec-10c8891ea8c180a37f364dd947cacaebc4ca2954.zip
Prepare replacement of deprecated Gtk.STOCK_OK(CANCEL) macros
-rwxr-xr-xsrc/msec/msecgui.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py
index abb2a8e..9f4afe4 100755
--- a/src/msec/msecgui.py
+++ b/src/msec/msecgui.py
@@ -107,6 +107,12 @@ changing them to the specified values when a change is detected. """)
SAVE_SETTINGS_TEXT=_("""Save and apply new configuration?""")
+#TODO: Prepare for translating the deprecated Gtk.STOCK_OK/CANCEL macros
+#TEXT_OK = _("OK")
+#TEXT_CANCEL = _("Cancel")
+TEXT_OK = Gtk.STOCK_OK
+TEXT_CANCEL = Gtk.STOCK_CANCEL
+
# gui-related settings
DEFAULT_SPACING=5
BANNER="msec.png"
@@ -351,10 +357,10 @@ class MsecGui(Gtk.Window):
# creating preview window
dialog = Gtk.Dialog(title=_('Saving changes...'), transient_for=self.window, modal=True)
- dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
+ dialog.add_button(TEXT_CANCEL, Gtk.ResponseType.CANCEL)
if ask_ignore:
dialog.add_button(_('Ignore and quit'), Gtk.ResponseType.REJECT)
- dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
+ dialog.add_button(TEXT_OK, Gtk.ResponseType.OK)
dialog.set_default_size(640, 300)
dialog.set_default_response(Gtk.ResponseType.OK)
@@ -694,7 +700,7 @@ class MsecGui(Gtk.Window):
dialog = Gtk.Dialog(title=_("Periodic check results"),
transient_for=self.window, modal=True)
- dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
+ dialog.add_button(TEXT_OK, Gtk.ResponseType.OK)
dialog.set_size_request(640, 280)
text_buffer = Gtk.TextBuffer()
@@ -1424,9 +1430,9 @@ class MsecGui(Gtk.Window):
title = _("Adding new exception")
# asks for new parameter value
- dialog = Gtk.Dialog(title=title, transient_for=self.window, flags=0)
- dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
- dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
+ dialog = Gtk.Dialog(title=title, transient_for=self.window, modal=True)
+ dialog.add_button(TEXT_OK, Gtk.ResponseType.OK)
+ dialog.add_button(TEXT_CANCEL, Gtk.ResponseType.CANCEL)
label = Gtk.Label(label=_("Editing exception. Please select the correspondent msec check and exception value\n"))
label.set_line_wrap(True)
label.set_use_markup(True)
@@ -1501,9 +1507,9 @@ class MsecGui(Gtk.Window):
force = "force"
# asks for new parameter value
- dialog = Gtk.Dialog(title=title, transient_for=self.window, flags=0)
- dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
- dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
+ dialog = Gtk.Dialog(title=title, transient_for=self.window, modal=True)
+ dialog.add_button(TEXT_OK, Gtk.ResponseType.OK)
+ dialog.add_button(TEXT_CANCEL, Gtk.ResponseType.CANCEL)
label = Gtk.Label(label=_("Changing permissions on <b>%s</b>") % (file or _("new file")))
label.set_line_wrap(True)
label.set_use_markup(True)
@@ -1638,9 +1644,9 @@ class MsecGui(Gtk.Window):
# asks for new parameter value
dialog = Gtk.Dialog(title=_("Select new value for %s") % (param),
- transient_for=self.window, flags=0)
- dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
- dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
+ transient_for=self.window, modal=True)
+ dialog.add_button(TEXT_OK, Gtk.ResponseType.OK)
+ dialog.add_button(TEXT_CANCEL, Gtk.ResponseType.CANCEL)
# option title
label = Gtk.Label(label="<b>%s</b>\n" % param)
label.set_use_markup(True)