PatchNames.py: convert to use gtkbuilder instead of libglade

svn: r12419
This commit is contained in:
Gerald Britton 2009-04-09 19:04:38 +00:00
parent db1884afc9
commit eec911dc0d
2 changed files with 232 additions and 249 deletions

View File

@ -37,7 +37,6 @@ import re
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import gobject
#-------------------------------------------------------------------------
@ -202,17 +201,17 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
base = os.path.dirname(__file__)
glade_file = os.path.join(base, "patchnames.glade")
self.top = glade.XML(glade_file, "top", "gramps")
window = self.top.get_widget('top')
self.top.signal_autoconnect({
self.top = gtk.Builder()
self.top.add_from_file(glade_file)
window = self.top.get_object('top')
self.top.connect_signals({
"destroy_passed_object" : self.close,
"on_ok_clicked" : self.on_ok_clicked,
"on_help_clicked" : self.on_help_clicked,
})
self.list = self.top.get_widget("list")
self.set_window(window, self.top.get_widget('title'), self.label)
self.list = self.top.get_object("list")
self.set_window(window, self.top.get_object('title'), self.label)
self.model = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,

View File

@ -1,11 +1,9 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkDialog" id="top">
<?xml version="1.0"?>
<!--*- mode: xml -*-->
<interface>
<object class="GtkDialog" id="top">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="title" translatable="yes"/>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@ -19,21 +17,18 @@
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Thu, 24 Mar 2005 06:19:34 GMT"/>
<signal handler="on_delete_event" last_modification_time="Thu, 24 Mar 2005 06:19:34 GMT" name="delete_event"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="helpbutton1">
<object class="GtkButton" id="helpbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -41,13 +36,11 @@
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
<signal name="clicked" handler="on_help_clicked" last_modification_time="Thu, 24 Mar 2005 05:34:31 GMT"/>
</widget>
<signal handler="on_help_clicked" last_modification_time="Thu, 24 Mar 2005 05:34:31 GMT" name="clicked"/>
</object>
</child>
<child>
<widget class="GtkButton" id="button6">
<object class="GtkButton" id="button6">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -55,23 +48,19 @@
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="top" last_modification_time="Wed, 16 Apr 2003 05:06:50 GMT"/>
</widget>
<signal handler="destroy_passed_object" last_modification_time="Wed, 16 Apr 2003 05:06:50 GMT" name="clicked" object="top"/>
</object>
</child>
<child>
<widget class="GtkButton" id="button5">
<object class="GtkButton" id="button5">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_ok_clicked" object="top" last_modification_time="Wed, 16 Apr 2003 05:07:24 GMT"/>
<signal handler="on_ok_clicked" last_modification_time="Wed, 16 Apr 2003 05:07:24 GMT" name="clicked" object="top"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@ -81,15 +70,13 @@
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox1">
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-ok</property>
<property name="icon_size">4</property>
@ -97,16 +84,15 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">_Accept and close</property>
<property name="use_underline">True</property>
@ -118,20 +104,20 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</object>
</child>
</widget>
</object>
</child>
</widget>
</object>
</child>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
@ -139,18 +125,16 @@
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox2">
<object class="GtkVBox" id="vbox2">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<object class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="label" translatable="yes"/>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -160,16 +144,15 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</object>
<packing>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Below is a list of the nicknames, titles and family name prefixes that GRAMPS can extract from the
current database. If you accept the changes, GRAMPS will modify the entries
@ -183,62 +166,63 @@ that have been selected.</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">10</property>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="list">
<object class="GtkTreeView" id="list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</object>
</child>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox2">
<object class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">6</property>
</widget>
</object>
<packing>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</object>
</child>
</widget>
</glade-interface>
<action-widgets>
<action-widget response="-11">helpbutton1</action-widget>
<action-widget response="0">button6</action-widget>
<action-widget response="0">button5</action-widget>
</action-widgets>
</object>
</interface>