Fix a couple of other transient parent errors.

This commit is contained in:
Stephen Boddy 2016-12-12 20:45:50 +01:00
parent e11335e0cb
commit 2546e724c9
3 changed files with 7 additions and 0 deletions

View File

@ -125,6 +125,7 @@ class CustomCommandsMenu(plugin.MenuItem):
_("_OK"), Gtk.ResponseType.ACCEPT _("_OK"), Gtk.ResponseType.ACCEPT
) )
) )
dbox.set_transient_for(widget.get_toplevel())
icon_theme = Gtk.IconTheme.get_default() icon_theme = Gtk.IconTheme.get_default()
if icon_theme.lookup_icon('terminator-custom-commands', 48, 0): if icon_theme.lookup_icon('terminator-custom-commands', 48, 0):
@ -214,11 +215,13 @@ class CustomCommandsMenu(plugin.MenuItem):
hbox.pack_start(button_box, False, True, 0) hbox.pack_start(button_box, False, True, 0)
self.dbox = dbox
dbox.show_all() dbox.show_all()
res = dbox.run() res = dbox.run()
if res == Gtk.ResponseType.ACCEPT: if res == Gtk.ResponseType.ACCEPT:
self.update_cmd_list(store) self.update_cmd_list(store)
self._save_config() self._save_config()
del(self.dbox)
dbox.destroy() dbox.destroy()
return return
@ -271,6 +274,7 @@ class CustomCommandsMenu(plugin.MenuItem):
_("_OK"), Gtk.ResponseType.ACCEPT _("_OK"), Gtk.ResponseType.ACCEPT
) )
) )
dialog.set_transient_for(self.dbox)
table = Gtk.Table(3, 2) table = Gtk.Table(3, 2)
label = Gtk.Label(label=_("Enabled:")) label = Gtk.Label(label=_("Enabled:"))

View File

@ -66,6 +66,7 @@ class Logger(plugin.MenuItem):
savedialog = Gtk.FileChooserDialog(title=_("Save Log File As"), savedialog = Gtk.FileChooserDialog(title=_("Save Log File As"),
action=self.dialog_action, action=self.dialog_action,
buttons=self.dialog_buttons) buttons=self.dialog_buttons)
savedialog.set_transient_for(_widget.get_toplevel())
savedialog.set_do_overwrite_confirmation(True) savedialog.set_do_overwrite_confirmation(True)
savedialog.set_local_only(True) savedialog.set_local_only(True)
savedialog.show_all() savedialog.show_all()
@ -90,6 +91,7 @@ class Logger(plugin.MenuItem):
e = sys.exc_info()[1] e = sys.exc_info()[1]
error = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, error = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR,
Gtk.ButtonsType.OK, e.strerror) Gtk.ButtonsType.OK, e.strerror)
error.set_transient_for(savedialog)
error.run() error.run()
error.destroy() error.destroy()
savedialog.destroy() savedialog.destroy()

View File

@ -37,6 +37,7 @@ class TerminalShot(plugin.MenuItem):
savedialog = Gtk.FileChooserDialog(title=_("Save image"), savedialog = Gtk.FileChooserDialog(title=_("Save image"),
action=self.dialog_action, action=self.dialog_action,
buttons=self.dialog_buttons) buttons=self.dialog_buttons)
savedialog.set_transient_for(_widget.get_toplevel())
savedialog.set_do_overwrite_confirmation(True) savedialog.set_do_overwrite_confirmation(True)
savedialog.set_local_only(True) savedialog.set_local_only(True)