aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelian R <arusanu@gmail.com>2026-03-26 16:47:57 +0200
committerAurelian R <arusanu@gmail.com>2026-03-26 16:47:57 +0200
commitaa29a59b4988c529110304a283679a3e009c3a78 (patch)
tree357641cd8aa959966fc5c971988b49077db1a8b1
parentb450b6bd171493d6b54485b2c638efc139e0161d (diff)
downloadmsec-aa29a59b4988c529110304a283679a3e009c3a78.tar
msec-aa29a59b4988c529110304a283679a3e009c3a78.tar.gz
msec-aa29a59b4988c529110304a283679a3e009c3a78.tar.bz2
msec-aa29a59b4988c529110304a283679a3e009c3a78.tar.xz
msec-aa29a59b4988c529110304a283679a3e009c3a78.zip
Fix deprecated warnings in "show_test_results()" dialog
-rwxr-xr-xsrc/msec/msecgui.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py
index cfdde40..4813902 100755
--- a/src/msec/msecgui.py
+++ b/src/msec/msecgui.py
@@ -684,28 +684,29 @@ class MsecGui(Gtk.Window):
data = fd.readlines()
except:
data = [_("Unable to read log file: %s") % sys.exc_info()[1]]
- dialog = Gtk.Dialog(_("Periodic check results"), transient_for=self.window, flags=0)
+
+ dialog = Gtk.Dialog(title=_("Periodic check results"),
+ transient_for=self.window, modal=True)
dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
dialog.set_size_request(640, 280)
- view = Gtk.TextView()
- buffer = view.get_buffer()
- buffer.create_tag("monospace", family="monospace", editable=False)
- iter = buffer.get_iter_at_offset(0)
+
+ text_buffer = Gtk.TextBuffer()
+ text_buffer.create_tag("monospace", family="monospace", editable=False)
+ text_iter = text_buffer.get_iter_at_offset(0)
for l in data:
- buffer.insert_with_tags_by_name(iter, l, "monospace")
+ text_buffer.insert_with_tags_by_name(text_iter, l, "monospace")
+ view = Gtk.TextView.new_with_buffer(text_buffer)
+ view.set_editable(False)
+
sw = Gtk.ScrolledWindow()
sw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
sw.add(view)
dialog.vbox.pack_start(sw, True, True, 0)
-
dialog.show_all()
- ret = dialog.run()
+ dialog.run()
dialog.destroy()
- if ret != Gtk.ResponseType.YES:
- return
- pass
def run_periodic_check(self, widget, check):
"""Shows results for the test"""