Fix dialogs for Gtk deprecations

This commit is contained in:
prculley 2016-12-24 08:46:16 -06:00
parent 4498ee32df
commit cf839a195b

View File

@ -183,9 +183,9 @@ class OptionDialog:
class ErrorDialog(Gtk.MessageDialog): class ErrorDialog(Gtk.MessageDialog):
def __init__(self, msg1, msg2="", parent=None): def __init__(self, msg1, msg2="", parent=None):
Gtk.MessageDialog.__init__(self, parent, Gtk.MessageDialog.__init__(self, transient_for=parent,
flags=Gtk.DialogFlags.MODAL, modal=True,
type=Gtk.MessageType.ERROR, message_type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.CLOSE) buttons=Gtk.ButtonsType.CLOSE)
self.set_markup('<span weight="bold" size="larger">%s</span>' % str(msg1)) self.set_markup('<span weight="bold" size="larger">%s</span>' % str(msg1))
self.format_secondary_text(msg2) self.format_secondary_text(msg2)
@ -223,9 +223,9 @@ class DBErrorDialog(ErrorDialog):
class WarningDialog(Gtk.MessageDialog): class WarningDialog(Gtk.MessageDialog):
def __init__(self, msg1, msg2="", parent=None): def __init__(self, msg1, msg2="", parent=None):
Gtk.MessageDialog.__init__(self, parent, Gtk.MessageDialog.__init__(self, transient_for=parent,
flags=Gtk.DialogFlags.MODAL, modal=True,
type=Gtk.MessageType.WARNING, message_type=Gtk.MessageType.WARNING,
buttons=Gtk.ButtonsType.CLOSE) buttons=Gtk.ButtonsType.CLOSE)
self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1) self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1)
self.format_secondary_markup(msg2) self.format_secondary_markup(msg2)
@ -243,9 +243,9 @@ class WarningDialog(Gtk.MessageDialog):
class OkDialog(Gtk.MessageDialog): class OkDialog(Gtk.MessageDialog):
def __init__(self, msg1, msg2="", parent=None): def __init__(self, msg1, msg2="", parent=None):
Gtk.MessageDialog.__init__(self, parent, Gtk.MessageDialog.__init__(self, transient_for=parent,
flags=Gtk.DialogFlags.MODAL, modal=True,
type=Gtk.MessageType.INFO, message_type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.CLOSE) buttons=Gtk.ButtonsType.CLOSE)
self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1) self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1)
self.format_secondary_text(msg2) self.format_secondary_text(msg2)