diff options
| -rwxr-xr-x | src/msec/libmsec.py | 2 | ||||
| -rwxr-xr-x | src/msec/msecgui.py | 35 |
2 files changed, 20 insertions, 17 deletions
diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index f7b7f54..d4fa75b 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -197,7 +197,7 @@ class Log: if self.buffer: self.buffer["warn"].append(message) else: - self.logger.warn(message) + self.logger.warning(message) def start_buffer(self): """Beginns message buffering""" diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py index 7374dbf..cfdde40 100755 --- a/src/msec/msecgui.py +++ b/src/msec/msecgui.py @@ -129,7 +129,7 @@ class BackgroundRunner(Thread): print("Aborted: %s" % sys.exc_info()[1]) self.finish.put(-1) -class MsecGui: +class MsecGui(Gtk.Window): """Msec GUI""" # common columns (COLUMN_LEVEL, COLUMN_LEVEL_DESCR, COLUMN_LEVEL_CURRENT) = list(range(3)) @@ -339,7 +339,7 @@ class MsecGui: curperms = self.permconfig # creating preview window - dialog = Gtk.Dialog(_('Saving changes...'), self.window, modal=True) + dialog = Gtk.Dialog(title=_('Saving changes...'), transient_for=self.window, modal=True) dialog.add_action_widget(Gtk.Button(label=_('Cancel')), Gtk.ResponseType.CANCEL) if ask_ignore: dialog.add_action_widget(Gtk.Button(label=_("Ignore and quit")), Gtk.ResponseType.REJECT) @@ -365,7 +365,7 @@ class MsecGui: vbox = Gtk.VBox() exp_vbox.set_size_request(640, 280) - sw.gtk_container_add(GTK_CONTAINER (vbox)) + sw.add(vbox) # were there changes in configuration? num_changes, allchanges, messages = self.check_for_changes(curconfig, curperms) @@ -646,7 +646,7 @@ class MsecGui: label.set_property("xalign", 0.0) label.set_property("yalign", 0.5) # label.modify_font(Pango.FontDescription("11")) - table.attach(label, 2, 3, row, row + 1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 0, 0, 0) + table.attach(label, 1, 2, row, row + 1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 0, 0, 0) row += 1 for check, logfile, updated_n, updated in tools.periodic_check_status(log): if not updated: @@ -684,7 +684,7 @@ class MsecGui: data = fd.readlines() except: data = [_("Unable to read log file: %s") % sys.exc_info()[1]] - dialog = Gtk.Dialog(_("Periodic check results"), parent=self.window, flags=0) + dialog = Gtk.Dialog(_("Periodic check results"), transient_for=self.window, flags=0) dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK) dialog.set_size_request(640, 280) view = Gtk.TextView() @@ -710,7 +710,7 @@ class MsecGui: def run_periodic_check(self, widget, check): """Shows results for the test""" dialog = Gtk.MessageDialog( - parent=self.window, + transient_for=self.window, flags=0, message_type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.YES_NO) @@ -769,10 +769,10 @@ class MsecGui: type = Gtk.MessageType.ERROR # policy was initialized dialog = Gtk.MessageDialog( - parent=self.window, + transient_for=self.window, flags=0, - type=type, - message_format=text, + message_type=type, + text=text, buttons=Gtk.ButtonsType.OK ) dialog.show_all() @@ -1416,7 +1416,7 @@ class MsecGui: title = _("Adding new exception") # asks for new parameter value - dialog = Gtk.Dialog(title, parent=self.window, flags=0) + 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) label = Gtk.Label(label=_("Editing exception. Please select the correspondent msec check and exception value\n")) @@ -1493,7 +1493,7 @@ class MsecGui: force = "force" # asks for new parameter value - dialog = Gtk.Dialog(title, parent=self.window, flags=0) + 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) label = Gtk.Label(label=_("Changing permissions on <b>%s</b>") % (file or _("new file"))) @@ -1629,8 +1629,8 @@ class MsecGui: val_def = conf_def.get(param) # asks for new parameter value - dialog = Gtk.Dialog(_("Select new value for %s") % (param), - parent=self.window, flags=0) + 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) # option title @@ -1648,9 +1648,12 @@ class MsecGui: # new value hbox = Gtk.HBox() - alignment = Gtk.Alignment.new(xalign=0.5, yalign=0.5, xscale=1.0, yscale=1.0) - alignment.add(Gtk.Label(label=_("New value:"))) - hbox.add(alignment) + label = Gtk.Label(label=_("New value:")) + label.set_halign(Gtk.Align.CENTER) + label.set_valign(Gtk.Align.CENTER) + label.set_hexpand(True) + label.set_vexpand(True) + hbox.add(label) if '*' in params: # string parameter entry = Gtk.Entry() |
