Fix 'Extract Info from names' tool; unclosed window, bad parent

Gtk deprecation warnings, and add window size/position config.
This commit is contained in:
prculley 2017-02-06 13:50:06 -06:00
parent 28bf8479fd
commit e8c6ad2542
2 changed files with 8 additions and 9 deletions

View File

@ -3,10 +3,8 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkDialog" id="patchnames">
<property name="visible">True</property>
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="default_width">500</property>
<property name="default_height">450</property>
<property name="type_hint">dialog</property>
<signal name="delete-event" handler="on_delete_event" swapped="no"/>
<child internal-child="vbox">

View File

@ -109,13 +109,13 @@ class PatchNames(tool.BatchTool, ManagedWindow):
tool.BatchTool.__init__(self, dbstate, user, options_class, name)
if self.fail:
self.close()
return
winprefix = Gtk.Dialog(_("Default prefix and connector settings"),
self.uistate.window,
Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT,
(_('_OK'), Gtk.ResponseType.ACCEPT))
winprefix = Gtk.Dialog(title=_("Default prefix and connector settings"),
transient_for=self.uistate.window,
modal=True, destroy_with_parent=True)
winprefix.add_button(_('_OK'), Gtk.ResponseType.ACCEPT)
winprefix.vbox.set_spacing(5)
hboxpref = Gtk.Box()
label = Gtk.Label(label=_('Prefixes to search for:'))
@ -138,8 +138,8 @@ class PatchNames(tool.BatchTool, ManagedWindow):
self.connsbox.set_text(', '.join(CONNECTOR_LIST_NONSPLIT))
hboxconns.pack_start(self.connsbox, True, True, 0)
winprefix.vbox.pack_start(hboxconns, True, True, 0)
winprefix.show_all()
winprefix.resize(700, 100)
winprefix.show_all()
response = winprefix.run()
self.prefix_list = self.prefixbox.get_text().split(',')
@ -387,6 +387,7 @@ class PatchNames(tool.BatchTool, ManagedWindow):
self.list = self.top.get_object("list")
self.set_window(window, self.top.get_object('title'), self.label)
self.setup_configs("interface.patchnames", 680, 400)
self.model = Gtk.ListStore(GObject.TYPE_BOOLEAN, GObject.TYPE_STRING,
GObject.TYPE_STRING, GObject.TYPE_STRING,