Bug 2888: Export plugins - convert from libglade to gtkbuilder
svn: r12456
This commit is contained in:
parent
f2d12e5c89
commit
29ff457d25
@ -68,8 +68,13 @@ def build_filter_model(space, local = [], default=""):
|
|||||||
|
|
||||||
model = gtk.ListStore(gobject.TYPE_STRING, object)
|
model = gtk.ListStore(gobject.TYPE_STRING, object)
|
||||||
|
|
||||||
flist = local + SystemFilters.get_filters(space) + \
|
if isinstance(space, basestring):
|
||||||
CustomFilters.get_filters(space)
|
flist = local + SystemFilters.get_filters(space) + \
|
||||||
|
CustomFilters.get_filters(space)
|
||||||
|
elif isinstance(space, (list, tuple)):
|
||||||
|
flist = space
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
for filt in flist:
|
for filt in flist:
|
||||||
model.append(row=[filt.get_name(), filt])
|
model.append(row=[filt.get_name(), filt])
|
||||||
|
|||||||
@ -1,355 +1,302 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
<interface>
|
||||||
|
<requires lib="gtk+" version="2.16"/>
|
||||||
<glade-interface>
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
<requires lib="gnome"/>
|
<object class="GtkDialog" id="csvExport">
|
||||||
|
<property name="visible">True</property>
|
||||||
<widget class="GtkDialog" id="csvExport">
|
<property name="modal">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="default_width">400</property>
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="type_hint">dialog</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="has_separator">False</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<child internal-child="vbox">
|
||||||
<property name="modal">True</property>
|
<object class="GtkVBox" id="dialog-vbox1">
|
||||||
<property name="default_width">400</property>
|
<property name="visible">True</property>
|
||||||
<property name="resizable">True</property>
|
<property name="spacing">8</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<child>
|
||||||
<property name="decorated">True</property>
|
<object class="GtkVBox" id="vbox1">
|
||||||
<property name="skip_taskbar_hint">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="skip_pager_hint">False</property>
|
<child>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
<object class="GtkEventBox" id="eventbox1">
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<property name="visible">True</property>
|
||||||
<property name="focus_on_map">True</property>
|
<child>
|
||||||
<property name="urgency_hint">False</property>
|
<object class="GtkTable" id="table3">
|
||||||
<property name="has_separator">False</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">12</property>
|
||||||
<child internal-child="vbox">
|
<property name="n_rows">4</property>
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
<property name="n_columns">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="spacing">8</property>
|
<child>
|
||||||
|
<object class="GtkLabel" id="label9">
|
||||||
<child internal-child="action_area">
|
<property name="visible">True</property>
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
<property name="xalign">0</property>
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes"><b>Options</b></property>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkButton" id="cancel">
|
<property name="right_attach">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="can_default">True</property>
|
<property name="y_options"></property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label">gtk-cancel</property>
|
</child>
|
||||||
<property name="use_stock">True</property>
|
<child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="focus_on_click">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="response_id">0</property>
|
<property name="xalign">0</property>
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
<property name="label" translatable="yes">Filt_er:</property>
|
||||||
</widget>
|
<property name="use_underline">True</property>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="left_attach">1</property>
|
||||||
<widget class="GtkButton" id="ok">
|
<property name="right_attach">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="can_default">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="label">gtk-ok</property>
|
<property name="y_options"></property>
|
||||||
<property name="use_stock">True</property>
|
</packing>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
</child>
|
||||||
<property name="focus_on_click">True</property>
|
<child>
|
||||||
<property name="response_id">0</property>
|
<object class="GtkTable" id="table4">
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
<property name="visible">True</property>
|
||||||
</widget>
|
<property name="n_rows">5</property>
|
||||||
</child>
|
<property name="n_columns">2</property>
|
||||||
|
<property name="column_spacing">12</property>
|
||||||
<child>
|
<property name="row_spacing">6</property>
|
||||||
<widget class="GtkButton" id="button1">
|
<child>
|
||||||
<property name="visible">True</property>
|
<object class="GtkCheckButton" id="marriages">
|
||||||
<property name="can_default">True</property>
|
<property name="label" translatable="yes">_Marriages</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label">gtk-help</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="active">True</property>
|
||||||
<property name="response_id">-11</property>
|
<property name="draw_indicator">True</property>
|
||||||
<signal name="clicked" handler="on_help_clicked" last_modification_time="Tue, 02 Dec 2003 01:53:26 GMT"/>
|
</object>
|
||||||
</widget>
|
<packing>
|
||||||
</child>
|
<property name="left_attach">1</property>
|
||||||
</widget>
|
<property name="right_attach">2</property>
|
||||||
<packing>
|
<property name="top_attach">1</property>
|
||||||
<property name="padding">0</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="expand">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="fill">False</property>
|
<property name="y_options"></property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
</packing>
|
||||||
</packing>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="children">
|
||||||
<child>
|
<property name="label" translatable="yes">Chil_dren</property>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="spacing">0</property>
|
<property name="use_underline">True</property>
|
||||||
|
<property name="active">True</property>
|
||||||
<child>
|
<property name="draw_indicator">True</property>
|
||||||
<widget class="GtkEventBox" id="eventbox1">
|
</object>
|
||||||
<property name="visible">True</property>
|
<packing>
|
||||||
<property name="visible_window">True</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="above_child">False</property>
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
<child>
|
<property name="bottom_attach">3</property>
|
||||||
<widget class="GtkTable" id="table3">
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="border_width">12</property>
|
<property name="y_options"></property>
|
||||||
<property name="visible">True</property>
|
</packing>
|
||||||
<property name="n_rows">4</property>
|
</child>
|
||||||
<property name="n_columns">3</property>
|
<child>
|
||||||
<property name="homogeneous">False</property>
|
<object class="GtkCheckButton" id="individuals">
|
||||||
<property name="row_spacing">6</property>
|
<property name="label" translatable="yes">I_ndividuals</property>
|
||||||
<property name="column_spacing">12</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
<child>
|
<property name="receives_default">False</property>
|
||||||
<widget class="GtkLabel" id="label9">
|
<property name="use_underline">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="active">True</property>
|
||||||
<property name="label" translatable="yes"><b>Options</b></property>
|
<property name="draw_indicator">True</property>
|
||||||
<property name="use_underline">False</property>
|
</object>
|
||||||
<property name="use_markup">True</property>
|
<packing>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="wrap">False</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="selectable">False</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="xalign">0</property>
|
<property name="y_options"></property>
|
||||||
<property name="yalign">0.5</property>
|
</packing>
|
||||||
<property name="xpad">0</property>
|
</child>
|
||||||
<property name="ypad">0</property>
|
<child>
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
<object class="GtkDrawingArea" id="drawingarea1">
|
||||||
<property name="width_chars">-1</property>
|
<property name="visible">True</property>
|
||||||
<property name="single_line_mode">False</property>
|
</object>
|
||||||
<property name="angle">0</property>
|
<packing>
|
||||||
</widget>
|
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
|
||||||
<packing>
|
<property name="y_options">GTK_FILL</property>
|
||||||
<property name="left_attach">0</property>
|
</packing>
|
||||||
<property name="right_attach">3</property>
|
</child>
|
||||||
<property name="top_attach">0</property>
|
<child>
|
||||||
<property name="bottom_attach">1</property>
|
<object class="GtkCheckButton" id="translate_headers">
|
||||||
<property name="x_options">fill</property>
|
<property name="label" translatable="yes">Translate _Headers</property>
|
||||||
<property name="y_options"></property>
|
<property name="visible">True</property>
|
||||||
</packing>
|
<property name="can_focus">True</property>
|
||||||
</child>
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
<child>
|
<property name="active">True</property>
|
||||||
<widget class="GtkLabel" id="label1">
|
<property name="draw_indicator">True</property>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="label" translatable="yes">Filt_er:</property>
|
<packing>
|
||||||
<property name="use_underline">True</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="wrap">False</property>
|
<property name="bottom_attach">5</property>
|
||||||
<property name="selectable">False</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="xalign">0</property>
|
<property name="y_options"></property>
|
||||||
<property name="yalign">0.5</property>
|
</packing>
|
||||||
<property name="xpad">0</property>
|
</child>
|
||||||
<property name="ypad">0</property>
|
<child>
|
||||||
<property name="mnemonic_widget">filter</property>
|
<placeholder/>
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
</child>
|
||||||
<property name="width_chars">-1</property>
|
<child>
|
||||||
<property name="single_line_mode">False</property>
|
<placeholder/>
|
||||||
<property name="angle">0</property>
|
</child>
|
||||||
</widget>
|
<child>
|
||||||
<packing>
|
<placeholder/>
|
||||||
<property name="left_attach">1</property>
|
</child>
|
||||||
<property name="right_attach">2</property>
|
<child>
|
||||||
<property name="top_attach">1</property>
|
<placeholder/>
|
||||||
<property name="bottom_attach">2</property>
|
</child>
|
||||||
<property name="x_options">fill</property>
|
<child>
|
||||||
<property name="y_options"></property>
|
<placeholder/>
|
||||||
</packing>
|
</child>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="left_attach">1</property>
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
<property name="right_attach">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="history">-1</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
<child internal-child="menu">
|
</child>
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
<child>
|
||||||
<property name="visible">True</property>
|
<object class="GtkLabel" id="label10">
|
||||||
</widget>
|
<property name="visible">True</property>
|
||||||
</child>
|
<property name="xalign">0</property>
|
||||||
</widget>
|
<property name="label" translatable="yes">Export:</property>
|
||||||
<packing>
|
<property name="use_underline">True</property>
|
||||||
<property name="left_attach">2</property>
|
</object>
|
||||||
<property name="right_attach">3</property>
|
<packing>
|
||||||
<property name="top_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="x_options">fill</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="y_options"></property>
|
<property name="bottom_attach">3</property>
|
||||||
</packing>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</child>
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
<child>
|
</child>
|
||||||
<widget class="GtkTable" id="table4">
|
<child>
|
||||||
<property name="visible">True</property>
|
<object class="GtkComboBox" id="filter">
|
||||||
<property name="n_rows">5</property>
|
<property name="visible">True</property>
|
||||||
<property name="n_columns">2</property>
|
<property name="model">liststore1</property>
|
||||||
<property name="homogeneous">False</property>
|
<child>
|
||||||
<property name="row_spacing">6</property>
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
<property name="column_spacing">12</property>
|
<attributes>
|
||||||
|
<attribute name="text">0</attribute>
|
||||||
<child>
|
</attributes>
|
||||||
<widget class="GtkCheckButton" id="marriages">
|
</child>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="can_focus">True</property>
|
<packing>
|
||||||
<property name="label" translatable="yes">_Marriages</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="active">True</property>
|
</packing>
|
||||||
<property name="inconsistent">False</property>
|
</child>
|
||||||
<property name="draw_indicator">True</property>
|
<child>
|
||||||
</widget>
|
<placeholder/>
|
||||||
<packing>
|
</child>
|
||||||
<property name="left_attach">1</property>
|
<child>
|
||||||
<property name="right_attach">2</property>
|
<placeholder/>
|
||||||
<property name="top_attach">1</property>
|
</child>
|
||||||
<property name="bottom_attach">2</property>
|
<child>
|
||||||
<property name="x_options">fill</property>
|
<placeholder/>
|
||||||
<property name="y_options"></property>
|
</child>
|
||||||
</packing>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkCheckButton" id="children">
|
<property name="expand">False</property>
|
||||||
<property name="visible">True</property>
|
<property name="position">0</property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label" translatable="yes">Chil_dren</property>
|
</child>
|
||||||
<property name="use_underline">True</property>
|
</object>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<packing>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="expand">False</property>
|
||||||
<property name="active">True</property>
|
<property name="position">1</property>
|
||||||
<property name="inconsistent">False</property>
|
</packing>
|
||||||
<property name="draw_indicator">True</property>
|
</child>
|
||||||
</widget>
|
<child internal-child="action_area">
|
||||||
<packing>
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
<property name="left_attach">1</property>
|
<property name="visible">True</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="layout_style">end</property>
|
||||||
<property name="top_attach">2</property>
|
<child>
|
||||||
<property name="bottom_attach">3</property>
|
<object class="GtkButton" id="cancel">
|
||||||
<property name="x_options">fill</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="y_options"></property>
|
<property name="visible">True</property>
|
||||||
</packing>
|
<property name="can_focus">True</property>
|
||||||
</child>
|
<property name="can_default">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
<child>
|
<property name="use_stock">True</property>
|
||||||
<widget class="GtkCheckButton" id="individuals">
|
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="can_focus">True</property>
|
<packing>
|
||||||
<property name="label" translatable="yes">I_ndividuals</property>
|
<property name="expand">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="fill">False</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="position">0</property>
|
||||||
<property name="focus_on_click">True</property>
|
</packing>
|
||||||
<property name="active">True</property>
|
</child>
|
||||||
<property name="inconsistent">False</property>
|
<child>
|
||||||
<property name="draw_indicator">True</property>
|
<object class="GtkButton" id="ok">
|
||||||
</widget>
|
<property name="label">gtk-ok</property>
|
||||||
<packing>
|
<property name="visible">True</property>
|
||||||
<property name="left_attach">1</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="can_default">True</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="bottom_attach">1</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="x_options">fill</property>
|
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
||||||
<property name="y_options"></property>
|
</object>
|
||||||
</packing>
|
<packing>
|
||||||
</child>
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
<child>
|
<property name="position">1</property>
|
||||||
<widget class="GtkDrawingArea" id="drawingarea1">
|
</packing>
|
||||||
<property name="visible">True</property>
|
</child>
|
||||||
</widget>
|
<child>
|
||||||
<packing>
|
<object class="GtkButton" id="button1">
|
||||||
<property name="left_attach">0</property>
|
<property name="label">gtk-help</property>
|
||||||
<property name="right_attach">1</property>
|
<property name="visible">True</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="bottom_attach">1</property>
|
<property name="can_default">True</property>
|
||||||
<property name="x_options">shrink|fill</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="y_options">fill</property>
|
<property name="use_stock">True</property>
|
||||||
</packing>
|
<signal name="clicked" handler="on_help_clicked"/>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="expand">False</property>
|
||||||
<widget class="GtkCheckButton" id="translate_headers">
|
<property name="fill">False</property>
|
||||||
<property name="visible">True</property>
|
<property name="position">2</property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label" translatable="yes">Translate _Headers</property>
|
</child>
|
||||||
<property name="use_underline">True</property>
|
</object>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<packing>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="fill">False</property>
|
||||||
<property name="active">True</property>
|
<property name="pack_type">end</property>
|
||||||
<property name="inconsistent">False</property>
|
<property name="position">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
</packing>
|
||||||
</widget>
|
</child>
|
||||||
<packing>
|
</object>
|
||||||
<property name="left_attach">1</property>
|
</child>
|
||||||
<property name="right_attach">2</property>
|
<action-widgets>
|
||||||
<property name="top_attach">4</property>
|
<action-widget response="0">cancel</action-widget>
|
||||||
<property name="bottom_attach">5</property>
|
<action-widget response="0">ok</action-widget>
|
||||||
<property name="x_options">fill</property>
|
<action-widget response="-11">button1</action-widget>
|
||||||
<property name="y_options"></property>
|
</action-widgets>
|
||||||
</packing>
|
</object>
|
||||||
</child>
|
<object class="GtkListStore" id="liststore1">
|
||||||
</widget>
|
<columns>
|
||||||
<packing>
|
<!-- column-name gchararray1 -->
|
||||||
<property name="left_attach">1</property>
|
<column type="gchararray"/>
|
||||||
<property name="right_attach">3</property>
|
</columns>
|
||||||
<property name="top_attach">3</property>
|
</object>
|
||||||
<property name="bottom_attach">4</property>
|
</interface>
|
||||||
<property name="x_options">fill</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label10">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Export:</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="use_markup">False</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
||||||
<property name="wrap">False</property>
|
|
||||||
<property name="selectable">False</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
|
||||||
<property name="ypad">0</property>
|
|
||||||
<property name="mnemonic_widget">filter</property>
|
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
|
||||||
<property name="width_chars">-1</property>
|
|
||||||
<property name="single_line_mode">False</property>
|
|
||||||
<property name="angle">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="bottom_attach">3</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
</glade-interface>
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ import codecs
|
|||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gtk import glade
|
import gtk
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -55,13 +55,20 @@ log = logging.getLogger(".ExportCSV")
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gen.lib
|
import gen.lib
|
||||||
from Filters import GenericFilter, Rules, build_filter_menu
|
from Filters import GenericFilter, Rules, build_filter_model
|
||||||
import Utils
|
import Utils
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
import gen.proxy
|
import gen.proxy
|
||||||
import DateHandler
|
import DateHandler
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Constants
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
_GLADE_FILE = "ExportCsv.glade"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# The function that does the exporting
|
# The function that does the exporting
|
||||||
@ -172,10 +179,13 @@ class CSVWriterOptionBox:
|
|||||||
self.translate_headers = 1
|
self.translate_headers = 1
|
||||||
|
|
||||||
def get_option_box(self):
|
def get_option_box(self):
|
||||||
glade_file = os.path.join(os.path.dirname(__file__), "ExportCsv.glade")
|
glade_file = os.path.join(
|
||||||
|
os.path.split(__file__)[0],
|
||||||
|
_GLADE_FILE)
|
||||||
|
|
||||||
self.topDialog = glade.XML(glade_file,"csvExport","gramps")
|
self.topDialog = gtk.Builder()
|
||||||
filter_obj = self.topDialog.get_widget("filter")
|
self.topDialog.add_from_file(glade_file)
|
||||||
|
self.filters = self.topDialog.get_object("filter")
|
||||||
|
|
||||||
all = GenericFilter()
|
all = GenericFilter()
|
||||||
all.set_name(_("Entire Database"))
|
all.set_name(_("Entire Database"))
|
||||||
@ -206,21 +216,22 @@ class CSVWriterOptionBox:
|
|||||||
|
|
||||||
from Filters import CustomFilters
|
from Filters import CustomFilters
|
||||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
self.filter_menu = build_filter_menu(the_filters)
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_obj.set_menu(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
the_box = self.topDialog.get_widget('vbox1')
|
the_box = self.topDialog.get_object('vbox1')
|
||||||
the_parent = self.topDialog.get_widget('dialog-vbox1')
|
the_parent = self.topDialog.get_object('dialog-vbox1')
|
||||||
the_parent.remove(the_box)
|
the_parent.remove(the_box)
|
||||||
self.topDialog.get_widget("csvExport").destroy()
|
self.topDialog.get_object("csvExport").destroy()
|
||||||
return the_box
|
return the_box
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.include_individuals = self.topDialog.get_widget("individuals").get_active()
|
self.include_individuals = self.topDialog.get_object("individuals").get_active()
|
||||||
self.include_marriages = self.topDialog.get_widget("marriages").get_active()
|
self.include_marriages = self.topDialog.get_object("marriages").get_active()
|
||||||
self.include_children = self.topDialog.get_widget("children").get_active()
|
self.include_children = self.topDialog.get_object("children").get_active()
|
||||||
self.translate_headers = self.topDialog.get_widget("translate_headers").get_active()
|
self.translate_headers = self.topDialog.get_object("translate_headers").get_active()
|
||||||
self.cfilter = self.filter_menu.get_active().get_data("filter")
|
self.cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -406,7 +417,9 @@ class CSVWriter:
|
|||||||
family = self.db.get_family_from_handle(key)
|
family = self.db.get_family_from_handle(key)
|
||||||
if family:
|
if family:
|
||||||
marriage_id = family.get_gramps_id()
|
marriage_id = family.get_gramps_id()
|
||||||
sortorder.append( (sortable_string_representation(marriage_id), key) )
|
sortorder.append(
|
||||||
|
(sortable_string_representation(marriage_id), key)
|
||||||
|
)
|
||||||
sortorder.sort() # will sort on tuples
|
sortorder.sort() # will sort on tuples
|
||||||
flist = [data[1] for data in sortorder]
|
flist = [data[1] for data in sortorder]
|
||||||
###########################
|
###########################
|
||||||
|
|||||||
@ -1,229 +1,194 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
<interface>
|
||||||
|
<requires lib="gtk+" version="2.16"/>
|
||||||
<glade-interface>
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
|
<object class="GtkDialog" id="top">
|
||||||
<widget class="GtkDialog" id="top">
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="modal">True</property>
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="default_width">480</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type_hint">dialog</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="has_separator">False</property>
|
||||||
<property name="modal">True</property>
|
<child internal-child="vbox">
|
||||||
<property name="default_width">480</property>
|
<object class="GtkVBox" id="dialog-vbox1">
|
||||||
<property name="resizable">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="spacing">8</property>
|
||||||
<property name="decorated">True</property>
|
<child>
|
||||||
<property name="skip_taskbar_hint">False</property>
|
<object class="GtkVBox" id="vbox1">
|
||||||
<property name="skip_pager_hint">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
<child>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<object class="GtkLabel" id="title">
|
||||||
<property name="has_separator">False</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="ypad">6</property>
|
||||||
<child internal-child="vbox">
|
<property name="justify">center</property>
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
</object>
|
||||||
<property name="visible">True</property>
|
<packing>
|
||||||
<property name="homogeneous">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="spacing">8</property>
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
<child internal-child="action_area">
|
</packing>
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
</child>
|
||||||
<property name="visible">True</property>
|
<child>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<object class="GtkTable" id="table3">
|
||||||
|
<property name="visible">True</property>
|
||||||
<child>
|
<property name="border_width">12</property>
|
||||||
<widget class="GtkButton" id="cancel">
|
<property name="n_rows">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="n_columns">3</property>
|
||||||
<property name="can_default">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="label">gtk-cancel</property>
|
<child>
|
||||||
<property name="use_stock">True</property>
|
<object class="GtkLabel" id="label9">
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="visible">True</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="xalign">0</property>
|
||||||
<property name="response_id">0</property>
|
<property name="label" translatable="yes"><b>Options</b></property>
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
<property name="use_markup">True</property>
|
||||||
</widget>
|
</object>
|
||||||
</child>
|
<packing>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
<child>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<widget class="GtkButton" id="ok">
|
<property name="y_options"></property>
|
||||||
<property name="visible">True</property>
|
</packing>
|
||||||
<property name="can_default">True</property>
|
</child>
|
||||||
<property name="can_focus">True</property>
|
<child>
|
||||||
<property name="label">gtk-ok</property>
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="use_stock">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="xalign">0</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="label" translatable="yes">Filt_er:</property>
|
||||||
<property name="response_id">0</property>
|
<property name="use_underline">True</property>
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
</object>
|
||||||
</widget>
|
<packing>
|
||||||
</child>
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
<child>
|
<property name="top_attach">1</property>
|
||||||
<widget class="GtkButton" id="button1">
|
<property name="bottom_attach">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
|
||||||
<property name="can_default">True</property>
|
<property name="y_options"></property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label">gtk-help</property>
|
</child>
|
||||||
<property name="use_stock">True</property>
|
<child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<object class="GtkCheckButton" id="restrict">
|
||||||
<property name="focus_on_click">True</property>
|
<property name="label" translatable="yes">_Restrict data on living people</property>
|
||||||
<property name="response_id">-11</property>
|
<property name="visible">True</property>
|
||||||
<signal name="clicked" handler="on_help_clicked" last_modification_time="Tue, 02 Dec 2003 02:01:12 GMT"/>
|
<property name="can_focus">True</property>
|
||||||
</widget>
|
<property name="receives_default">False</property>
|
||||||
</child>
|
<property name="use_underline">True</property>
|
||||||
</widget>
|
<property name="active">True</property>
|
||||||
<packing>
|
<property name="draw_indicator">True</property>
|
||||||
<property name="padding">0</property>
|
</object>
|
||||||
<property name="expand">False</property>
|
<packing>
|
||||||
<property name="fill">True</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
<property name="right_attach">3</property>
|
||||||
</packing>
|
<property name="top_attach">2</property>
|
||||||
</child>
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
<child>
|
<property name="y_options"></property>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
</packing>
|
||||||
<property name="visible">True</property>
|
</child>
|
||||||
<property name="homogeneous">False</property>
|
<child>
|
||||||
<property name="spacing">0</property>
|
<object class="GtkComboBox" id="filter">
|
||||||
|
<property name="visible">True</property>
|
||||||
<child>
|
<property name="model">liststore1</property>
|
||||||
<widget class="GtkLabel" id="title">
|
<child>
|
||||||
<property name="visible">True</property>
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
<property name="label" translatable="yes"></property>
|
<attributes>
|
||||||
<property name="use_underline">False</property>
|
<attribute name="text">0</attribute>
|
||||||
<property name="use_markup">False</property>
|
</attributes>
|
||||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
</child>
|
||||||
<property name="wrap">False</property>
|
</object>
|
||||||
<property name="selectable">False</property>
|
<packing>
|
||||||
<property name="xalign">0.5</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="xpad">0</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="ypad">6</property>
|
<property name="bottom_attach">2</property>
|
||||||
</widget>
|
<property name="y_options">GTK_FILL</property>
|
||||||
<packing>
|
</packing>
|
||||||
<property name="padding">0</property>
|
</child>
|
||||||
<property name="expand">False</property>
|
<child>
|
||||||
<property name="fill">False</property>
|
<placeholder/>
|
||||||
</packing>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
|
<placeholder/>
|
||||||
<child>
|
</child>
|
||||||
<widget class="GtkTable" id="table3">
|
</object>
|
||||||
<property name="border_width">12</property>
|
<packing>
|
||||||
<property name="visible">True</property>
|
<property name="position">1</property>
|
||||||
<property name="n_rows">3</property>
|
</packing>
|
||||||
<property name="n_columns">3</property>
|
</child>
|
||||||
<property name="homogeneous">False</property>
|
</object>
|
||||||
<property name="row_spacing">6</property>
|
<packing>
|
||||||
<property name="column_spacing">12</property>
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
<child>
|
</child>
|
||||||
<widget class="GtkLabel" id="label9">
|
<child internal-child="action_area">
|
||||||
<property name="visible">True</property>
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
<property name="label" translatable="yes"><b>Options</b></property>
|
<property name="visible">True</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="layout_style">end</property>
|
||||||
<property name="use_markup">True</property>
|
<child>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<object class="GtkButton" id="cancel">
|
||||||
<property name="wrap">False</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="selectable">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="can_default">True</property>
|
||||||
<property name="xpad">0</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="ypad">0</property>
|
<property name="use_stock">True</property>
|
||||||
</widget>
|
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
||||||
<packing>
|
</object>
|
||||||
<property name="left_attach">0</property>
|
<packing>
|
||||||
<property name="right_attach">3</property>
|
<property name="expand">False</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="fill">False</property>
|
||||||
<property name="bottom_attach">1</property>
|
<property name="position">0</property>
|
||||||
<property name="x_options">fill</property>
|
</packing>
|
||||||
<property name="y_options"></property>
|
</child>
|
||||||
</packing>
|
<child>
|
||||||
</child>
|
<object class="GtkButton" id="ok">
|
||||||
|
<property name="label">gtk-ok</property>
|
||||||
<child>
|
<property name="visible">True</property>
|
||||||
<widget class="GtkLabel" id="label1">
|
<property name="can_focus">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="can_default">True</property>
|
||||||
<property name="label" translatable="yes">Filt_er:</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="use_markup">False</property>
|
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
</object>
|
||||||
<property name="wrap">False</property>
|
<packing>
|
||||||
<property name="selectable">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="fill">False</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="position">1</property>
|
||||||
<property name="xpad">0</property>
|
</packing>
|
||||||
<property name="ypad">0</property>
|
</child>
|
||||||
<property name="mnemonic_widget">filter</property>
|
<child>
|
||||||
</widget>
|
<object class="GtkButton" id="button1">
|
||||||
<packing>
|
<property name="label">gtk-help</property>
|
||||||
<property name="left_attach">1</property>
|
<property name="visible">True</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="can_default">True</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="x_options">shrink|fill</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="y_options"></property>
|
<signal name="clicked" handler="on_help_clicked"/>
|
||||||
</packing>
|
</object>
|
||||||
</child>
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
<child>
|
<property name="fill">False</property>
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
<property name="position">2</property>
|
||||||
<property name="visible">True</property>
|
</packing>
|
||||||
<property name="can_focus">True</property>
|
</child>
|
||||||
<property name="history">-1</property>
|
</object>
|
||||||
|
<packing>
|
||||||
<child internal-child="menu">
|
<property name="expand">False</property>
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
<property name="pack_type">end</property>
|
||||||
<property name="visible">True</property>
|
<property name="position">0</property>
|
||||||
</widget>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</object>
|
||||||
<packing>
|
</child>
|
||||||
<property name="left_attach">2</property>
|
<action-widgets>
|
||||||
<property name="right_attach">3</property>
|
<action-widget response="0">cancel</action-widget>
|
||||||
<property name="top_attach">1</property>
|
<action-widget response="0">ok</action-widget>
|
||||||
<property name="bottom_attach">2</property>
|
<action-widget response="-11">button1</action-widget>
|
||||||
<property name="y_options"></property>
|
</action-widgets>
|
||||||
</packing>
|
</object>
|
||||||
</child>
|
<object class="GtkListStore" id="liststore1">
|
||||||
|
<columns>
|
||||||
<child>
|
<!-- column-name gchararray1 -->
|
||||||
<widget class="GtkCheckButton" id="restrict">
|
<column type="gchararray"/>
|
||||||
<property name="visible">True</property>
|
</columns>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label" translatable="yes">_Restrict data on living people</property>
|
</interface>
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
|
||||||
<property name="focus_on_click">True</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
<property name="inconsistent">False</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="bottom_attach">3</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
</glade-interface>
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ log = logging.getLogger(".WriteFtree")
|
|||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gtk import glade
|
import gtk
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -52,11 +52,18 @@ from gtk import glade
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Utils
|
import Utils
|
||||||
from Filters import GenericFilter, Rules, build_filter_menu
|
from Filters import GenericFilter, Rules, build_filter_model
|
||||||
import Errors
|
import Errors
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Constants
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
_GLADE_FILE = "ExportFtree.glade"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# writeData
|
# writeData
|
||||||
@ -76,12 +83,14 @@ class FtreeWriterOptionBox:
|
|||||||
self.restrict = True
|
self.restrict = True
|
||||||
|
|
||||||
def get_option_box(self):
|
def get_option_box(self):
|
||||||
glade_file = os.path.join(os.path.dirname(__file__),
|
glade_file = os.path.join(
|
||||||
"ExportFtree.glade")
|
os.path.split(__file__)[0],
|
||||||
|
_GLADE_FILE)
|
||||||
|
|
||||||
self.top = glade.XML(glade_file, "top", "gramps")
|
self.top = gtk.Builder()
|
||||||
|
self.top.add_from_file(glade_file)
|
||||||
|
|
||||||
filter_obj = self.top.get_widget("filter")
|
self.filters = self.top.get_object("filter")
|
||||||
|
|
||||||
all = GenericFilter()
|
all = GenericFilter()
|
||||||
all.set_name(_("Entire Database"))
|
all.set_name(_("Entire Database"))
|
||||||
@ -112,18 +121,19 @@ class FtreeWriterOptionBox:
|
|||||||
|
|
||||||
from Filters import CustomFilters
|
from Filters import CustomFilters
|
||||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
self.filter_menu = build_filter_menu(the_filters)
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_obj.set_menu(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
the_box = self.top.get_widget("vbox1")
|
the_box = self.top.get_object("vbox1")
|
||||||
the_parent = self.top.get_widget('dialog-vbox1')
|
the_parent = self.top.get_object('dialog-vbox1')
|
||||||
the_parent.remove(the_box)
|
the_parent.remove(the_box)
|
||||||
self.top.get_widget("top").destroy()
|
self.top.get_object("top").destroy()
|
||||||
return the_box
|
return the_box
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.restrict = self.top.get_widget("restrict").get_active()
|
self.restrict = self.top.get_object("restrict").get_active()
|
||||||
self.cfilter = self.filter_menu.get_active().get_data("filter")
|
self.cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -156,7 +166,9 @@ class FtreeWriter:
|
|||||||
self.plist[p] = 1
|
self.plist[p] = 1
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for p in self.option_box.cfilter.apply(self.db, self.db.get_person_handles(sort_handles=False)):
|
for p in self.option_box.cfilter.apply(
|
||||||
|
self.db, self.db.get_person_handles(sort_handles=False)
|
||||||
|
):
|
||||||
self.plist[p] = 1
|
self.plist[p] = 1
|
||||||
except Errors.FilterError, msg:
|
except Errors.FilterError, msg:
|
||||||
(m1, m2) = msg.messages()
|
(m1, m2) = msg.messages()
|
||||||
@ -191,10 +203,7 @@ class FtreeWriter:
|
|||||||
pn = self.db.get_person_from_handle(key).get_primary_name()
|
pn = self.db.get_person_from_handle(key).get_primary_name()
|
||||||
sn = pn.get_surname()
|
sn = pn.get_surname()
|
||||||
items = pn.get_first_name().split()
|
items = pn.get_first_name().split()
|
||||||
if len(items) > 0:
|
n = ("%s %s" % (items[0], sn)) if items else sn
|
||||||
n = "%s %s" % (items[0], sn)
|
|
||||||
else:
|
|
||||||
n = sn
|
|
||||||
|
|
||||||
count = -1
|
count = -1
|
||||||
if n in name_map:
|
if n in name_map:
|
||||||
@ -217,17 +226,16 @@ class FtreeWriter:
|
|||||||
self.update()
|
self.update()
|
||||||
p = self.db.get_person_from_handle(key)
|
p = self.db.get_person_from_handle(key)
|
||||||
name = id_name[key]
|
name = id_name[key]
|
||||||
father = ""
|
father = mother = email = web = ""
|
||||||
mother = ""
|
|
||||||
email = ""
|
|
||||||
web = ""
|
|
||||||
|
|
||||||
family_handle = p.get_main_parents_family_handle()
|
family_handle = p.get_main_parents_family_handle()
|
||||||
if family_handle:
|
if family_handle:
|
||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
if family.get_father_handle() and family.get_father_handle() in id_map:
|
if family.get_father_handle() and \
|
||||||
|
family.get_father_handle() in id_map:
|
||||||
father = id_map[family.get_father_handle()]
|
father = id_map[family.get_father_handle()]
|
||||||
if family.get_mother_handle() and family.get_mother_handle() in id_map:
|
if family.get_mother_handle() and \
|
||||||
|
family.get_mother_handle() in id_map:
|
||||||
mother = id_map[family.get_mother_handle()]
|
mother = id_map[family.get_mother_handle()]
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -291,14 +299,17 @@ def get_name(name, count):
|
|||||||
|
|
||||||
if (name.suffix == ""):
|
if (name.suffix == ""):
|
||||||
if name.prefix:
|
if name.prefix:
|
||||||
return "%s %s %s%s" % (name.first_name, name.prefix, name.surname, val)
|
return "%s %s %s%s" % (name.first_name, name.prefix,
|
||||||
|
name.surname, val)
|
||||||
else:
|
else:
|
||||||
return "%s %s%s" % (name.first_name, name.surname, val)
|
return "%s %s%s" % (name.first_name, name.surname, val)
|
||||||
else:
|
else:
|
||||||
if name.prefix:
|
if name.prefix:
|
||||||
return "%s %s %s%s, %s" % (name.first_name, name.prefix, name.surname, val, name.suffix)
|
return "%s %s %s%s, %s" % (name.first_name, name.prefix,
|
||||||
|
name.surname, val, name.suffix)
|
||||||
else:
|
else:
|
||||||
return "%s %s%s, %s" % (name.first_name, name.surname, val, name.suffix)
|
return "%s %s%s, %s" % (name.first_name,
|
||||||
|
name.surname, val, name.suffix)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,386 +1,333 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
<interface>
|
||||||
|
<requires lib="gtk+" version="2.16"/>
|
||||||
<glade-interface>
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
|
<object class="GtkDialog" id="genewebExport">
|
||||||
<widget class="GtkDialog" id="genewebExport">
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="modal">True</property>
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="default_width">400</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type_hint">dialog</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="has_separator">False</property>
|
||||||
<property name="modal">True</property>
|
<child internal-child="vbox">
|
||||||
<property name="default_width">400</property>
|
<object class="GtkVBox" id="dialog-vbox1">
|
||||||
<property name="resizable">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="spacing">8</property>
|
||||||
<property name="decorated">True</property>
|
<child>
|
||||||
<property name="skip_taskbar_hint">False</property>
|
<object class="GtkVBox" id="vbox1">
|
||||||
<property name="skip_pager_hint">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
<child>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<object class="GtkTable" id="table3">
|
||||||
<property name="has_separator">False</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">12</property>
|
||||||
<child internal-child="vbox">
|
<property name="n_rows">6</property>
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
<property name="n_columns">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="spacing">8</property>
|
<child>
|
||||||
|
<object class="GtkLabel" id="label9">
|
||||||
<child internal-child="action_area">
|
<property name="visible">True</property>
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
<property name="xalign">0</property>
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes"><b>Options</b></property>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkButton" id="cancel">
|
<property name="right_attach">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="can_default">True</property>
|
<property name="y_options"></property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label">gtk-cancel</property>
|
</child>
|
||||||
<property name="use_stock">True</property>
|
<child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="focus_on_click">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="response_id">0</property>
|
<property name="xalign">0</property>
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
<property name="label" translatable="yes">Filt_er:</property>
|
||||||
</widget>
|
<property name="use_underline">True</property>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="left_attach">1</property>
|
||||||
<widget class="GtkButton" id="ok">
|
<property name="right_attach">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="can_default">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="label">gtk-ok</property>
|
<property name="y_options"></property>
|
||||||
<property name="use_stock">True</property>
|
</packing>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
</child>
|
||||||
<property name="focus_on_click">True</property>
|
<child>
|
||||||
<property name="response_id">0</property>
|
<object class="GtkCheckButton" id="private">
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
<property name="label" translatable="yes">_Do not include records marked private</property>
|
||||||
</widget>
|
<property name="visible">True</property>
|
||||||
</child>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
<child>
|
<property name="border_width">3</property>
|
||||||
<widget class="GtkButton" id="button1">
|
<property name="use_underline">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="active">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label">gtk-help</property>
|
<packing>
|
||||||
<property name="use_stock">True</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="response_id">-11</property>
|
<property name="bottom_attach">3</property>
|
||||||
<signal name="clicked" handler="on_help_clicked" last_modification_time="Tue, 02 Dec 2003 01:53:26 GMT"/>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</widget>
|
<property name="y_options"></property>
|
||||||
</child>
|
</packing>
|
||||||
</widget>
|
</child>
|
||||||
<packing>
|
<child>
|
||||||
<property name="padding">0</property>
|
<object class="GtkCheckButton" id="restrict">
|
||||||
<property name="expand">False</property>
|
<property name="label" translatable="yes">_Restrict data on living people</property>
|
||||||
<property name="fill">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
<property name="can_focus">True</property>
|
||||||
</packing>
|
<property name="receives_default">False</property>
|
||||||
</child>
|
<property name="border_width">3</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
<child>
|
<property name="active">True</property>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
<property name="draw_indicator">True</property>
|
||||||
<property name="visible">True</property>
|
<signal name="toggled" handler="on_restrict_toggled"/>
|
||||||
<property name="homogeneous">False</property>
|
</object>
|
||||||
<property name="spacing">0</property>
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
<child>
|
<property name="right_attach">3</property>
|
||||||
<widget class="GtkTable" id="table3">
|
<property name="top_attach">3</property>
|
||||||
<property name="border_width">12</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="n_rows">6</property>
|
<property name="y_options"></property>
|
||||||
<property name="n_columns">3</property>
|
</packing>
|
||||||
<property name="homogeneous">False</property>
|
</child>
|
||||||
<property name="row_spacing">6</property>
|
<child>
|
||||||
<property name="column_spacing">12</property>
|
<object class="GtkTable" id="table4">
|
||||||
|
<property name="visible">True</property>
|
||||||
<child>
|
<property name="n_rows">3</property>
|
||||||
<widget class="GtkLabel" id="label9">
|
<property name="n_columns">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="label" translatable="yes"><b>Options</b></property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="use_underline">False</property>
|
<child>
|
||||||
<property name="use_markup">True</property>
|
<object class="GtkCheckButton" id="notes">
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="label" translatable="yes">Exclude _notes</property>
|
||||||
<property name="wrap">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="selectable">False</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="xpad">0</property>
|
<property name="active">True</property>
|
||||||
<property name="ypad">0</property>
|
<property name="draw_indicator">True</property>
|
||||||
</widget>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">1</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options">fill</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
<child>
|
<object class="GtkCheckButton" id="sources">
|
||||||
<widget class="GtkLabel" id="label1">
|
<property name="label" translatable="yes">Exclude _sources</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">Filt_er:</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="active">True</property>
|
||||||
<property name="wrap">False</property>
|
<property name="draw_indicator">True</property>
|
||||||
<property name="selectable">False</property>
|
</object>
|
||||||
<property name="xalign">0</property>
|
<packing>
|
||||||
<property name="yalign">0.5</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="xpad">0</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="ypad">0</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="mnemonic_widget">filter</property>
|
<property name="bottom_attach">3</property>
|
||||||
</widget>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<packing>
|
<property name="y_options"></property>
|
||||||
<property name="left_attach">1</property>
|
</packing>
|
||||||
<property name="right_attach">2</property>
|
</child>
|
||||||
<property name="top_attach">1</property>
|
<child>
|
||||||
<property name="bottom_attach">2</property>
|
<object class="GtkCheckButton" id="living">
|
||||||
<property name="x_options">fill</property>
|
<property name="label" translatable="yes">Use _Living as first name</property>
|
||||||
<property name="y_options"></property>
|
<property name="visible">True</property>
|
||||||
</packing>
|
<property name="can_focus">True</property>
|
||||||
</child>
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
<child>
|
<property name="active">True</property>
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
<property name="draw_indicator">True</property>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="can_focus">True</property>
|
<packing>
|
||||||
<property name="history">-1</property>
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
<child internal-child="menu">
|
<property name="x_options">GTK_FILL</property>
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
<property name="y_options"></property>
|
||||||
<property name="visible">True</property>
|
</packing>
|
||||||
</widget>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
</widget>
|
<object class="GtkDrawingArea" id="drawingarea1">
|
||||||
<packing>
|
<property name="visible">True</property>
|
||||||
<property name="left_attach">2</property>
|
</object>
|
||||||
<property name="right_attach">3</property>
|
<packing>
|
||||||
<property name="top_attach">1</property>
|
<property name="x_options">GTK_SHRINK | GTK_FILL</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="y_options">GTK_FILL</property>
|
||||||
<property name="x_options">fill</property>
|
</packing>
|
||||||
<property name="y_options"></property>
|
</child>
|
||||||
</packing>
|
<child>
|
||||||
</child>
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkCheckButton" id="private">
|
<placeholder/>
|
||||||
<property name="border_width">3</property>
|
</child>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="can_focus">True</property>
|
<packing>
|
||||||
<property name="label" translatable="yes">_Do not include records marked private</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="bottom_attach">5</property>
|
||||||
<property name="active">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="inconsistent">False</property>
|
</packing>
|
||||||
<property name="draw_indicator">True</property>
|
</child>
|
||||||
</widget>
|
<child>
|
||||||
<packing>
|
<object class="GtkHBox" id="hbox1">
|
||||||
<property name="left_attach">1</property>
|
<property name="visible">True</property>
|
||||||
<property name="right_attach">3</property>
|
<child>
|
||||||
<property name="top_attach">2</property>
|
<object class="GtkCheckButton" id="images">
|
||||||
<property name="bottom_attach">3</property>
|
<property name="label" translatable="yes">Reference i_mages from path: </property>
|
||||||
<property name="x_options">fill</property>
|
<property name="visible">True</property>
|
||||||
<property name="y_options"></property>
|
<property name="can_focus">True</property>
|
||||||
</packing>
|
<property name="receives_default">False</property>
|
||||||
</child>
|
<property name="use_underline">True</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
<child>
|
</object>
|
||||||
<widget class="GtkCheckButton" id="restrict">
|
<packing>
|
||||||
<property name="border_width">3</property>
|
<property name="expand">False</property>
|
||||||
<property name="visible">True</property>
|
<property name="fill">False</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="position">0</property>
|
||||||
<property name="label" translatable="yes">_Restrict data on living people</property>
|
</packing>
|
||||||
<property name="use_underline">True</property>
|
</child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<child>
|
||||||
<property name="focus_on_click">True</property>
|
<object class="GtkEntry" id="images_path">
|
||||||
<property name="active">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="inconsistent">False</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="text" translatable="yes">media</property>
|
||||||
<signal name="toggled" handler="on_restrict_toggled" last_modification_time="Tue, 22 Jul 2003 09:50:16 GMT"/>
|
</object>
|
||||||
</widget>
|
<packing>
|
||||||
<packing>
|
<property name="position">1</property>
|
||||||
<property name="left_attach">1</property>
|
</packing>
|
||||||
<property name="right_attach">3</property>
|
</child>
|
||||||
<property name="top_attach">3</property>
|
</object>
|
||||||
<property name="bottom_attach">4</property>
|
<packing>
|
||||||
<property name="x_options">fill</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="y_options"></property>
|
<property name="right_attach">3</property>
|
||||||
</packing>
|
<property name="top_attach">5</property>
|
||||||
</child>
|
<property name="bottom_attach">6</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
<child>
|
</packing>
|
||||||
<widget class="GtkTable" id="table4">
|
</child>
|
||||||
<property name="visible">True</property>
|
<child>
|
||||||
<property name="n_rows">3</property>
|
<object class="GtkComboBox" id="filter">
|
||||||
<property name="n_columns">2</property>
|
<property name="visible">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="model">liststore1</property>
|
||||||
<property name="row_spacing">6</property>
|
<child>
|
||||||
<property name="column_spacing">12</property>
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
|
<attributes>
|
||||||
<child>
|
<attribute name="text">0</attribute>
|
||||||
<widget class="GtkCheckButton" id="notes">
|
</attributes>
|
||||||
<property name="visible">True</property>
|
</child>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label" translatable="yes">Exclude _notes</property>
|
<packing>
|
||||||
<property name="use_underline">True</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="active">True</property>
|
<property name="y_options">GTK_FILL</property>
|
||||||
<property name="inconsistent">False</property>
|
</packing>
|
||||||
<property name="draw_indicator">True</property>
|
</child>
|
||||||
</widget>
|
<child>
|
||||||
<packing>
|
<placeholder/>
|
||||||
<property name="left_attach">1</property>
|
</child>
|
||||||
<property name="right_attach">2</property>
|
<child>
|
||||||
<property name="top_attach">1</property>
|
<placeholder/>
|
||||||
<property name="bottom_attach">2</property>
|
</child>
|
||||||
<property name="x_options">fill</property>
|
<child>
|
||||||
<property name="y_options"></property>
|
<placeholder/>
|
||||||
</packing>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
|
<placeholder/>
|
||||||
<child>
|
</child>
|
||||||
<widget class="GtkCheckButton" id="sources">
|
<child>
|
||||||
<property name="visible">True</property>
|
<placeholder/>
|
||||||
<property name="can_focus">True</property>
|
</child>
|
||||||
<property name="label" translatable="yes">Exclude _sources</property>
|
</object>
|
||||||
<property name="use_underline">True</property>
|
<packing>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="expand">False</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="fill">False</property>
|
||||||
<property name="active">True</property>
|
<property name="pack_type">end</property>
|
||||||
<property name="inconsistent">False</property>
|
<property name="position">0</property>
|
||||||
<property name="draw_indicator">True</property>
|
</packing>
|
||||||
</widget>
|
</child>
|
||||||
<packing>
|
</object>
|
||||||
<property name="left_attach">1</property>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="position">1</property>
|
||||||
<property name="top_attach">2</property>
|
</packing>
|
||||||
<property name="bottom_attach">3</property>
|
</child>
|
||||||
<property name="x_options">fill</property>
|
<child internal-child="action_area">
|
||||||
<property name="y_options"></property>
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
</packing>
|
<property name="visible">True</property>
|
||||||
</child>
|
<property name="layout_style">end</property>
|
||||||
|
<child>
|
||||||
<child>
|
<object class="GtkButton" id="cancel">
|
||||||
<widget class="GtkCheckButton" id="living">
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Use _Living as first name</property>
|
<property name="can_default">True</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="focus_on_click">True</property>
|
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
||||||
<property name="active">True</property>
|
</object>
|
||||||
<property name="inconsistent">False</property>
|
<packing>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="expand">False</property>
|
||||||
</widget>
|
<property name="fill">False</property>
|
||||||
<packing>
|
<property name="position">0</property>
|
||||||
<property name="left_attach">1</property>
|
</packing>
|
||||||
<property name="right_attach">2</property>
|
</child>
|
||||||
<property name="top_attach">0</property>
|
<child>
|
||||||
<property name="bottom_attach">1</property>
|
<object class="GtkButton" id="ok">
|
||||||
<property name="x_options">fill</property>
|
<property name="label">gtk-ok</property>
|
||||||
<property name="y_options"></property>
|
<property name="visible">True</property>
|
||||||
</packing>
|
<property name="can_focus">True</property>
|
||||||
</child>
|
<property name="can_default">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
<child>
|
<property name="use_stock">True</property>
|
||||||
<widget class="GtkDrawingArea" id="drawingarea1">
|
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
</widget>
|
<packing>
|
||||||
<packing>
|
<property name="expand">False</property>
|
||||||
<property name="left_attach">0</property>
|
<property name="fill">False</property>
|
||||||
<property name="right_attach">1</property>
|
<property name="position">1</property>
|
||||||
<property name="top_attach">0</property>
|
</packing>
|
||||||
<property name="bottom_attach">1</property>
|
</child>
|
||||||
<property name="x_options">shrink|fill</property>
|
<child>
|
||||||
<property name="y_options">fill</property>
|
<object class="GtkButton" id="button1">
|
||||||
</packing>
|
<property name="label">gtk-help</property>
|
||||||
</child>
|
<property name="visible">True</property>
|
||||||
</widget>
|
<property name="can_focus">True</property>
|
||||||
<packing>
|
<property name="can_default">True</property>
|
||||||
<property name="left_attach">1</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="top_attach">4</property>
|
<signal name="clicked" handler="on_help_clicked"/>
|
||||||
<property name="bottom_attach">5</property>
|
</object>
|
||||||
<property name="x_options">fill</property>
|
<packing>
|
||||||
</packing>
|
<property name="expand">False</property>
|
||||||
</child>
|
<property name="fill">False</property>
|
||||||
|
<property name="position">2</property>
|
||||||
<child>
|
</packing>
|
||||||
<widget class="GtkHBox" id="hbox1">
|
</child>
|
||||||
<property name="visible">True</property>
|
</object>
|
||||||
<property name="homogeneous">False</property>
|
<packing>
|
||||||
<property name="spacing">0</property>
|
<property name="expand">False</property>
|
||||||
|
<property name="pack_type">end</property>
|
||||||
<child>
|
<property name="position">0</property>
|
||||||
<widget class="GtkCheckButton" id="images">
|
</packing>
|
||||||
<property name="visible">True</property>
|
</child>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label" translatable="yes">Reference i_mages from path: </property>
|
</child>
|
||||||
<property name="use_underline">True</property>
|
<action-widgets>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<action-widget response="0">cancel</action-widget>
|
||||||
<property name="focus_on_click">True</property>
|
<action-widget response="0">ok</action-widget>
|
||||||
<property name="active">False</property>
|
<action-widget response="-11">button1</action-widget>
|
||||||
<property name="inconsistent">False</property>
|
</action-widgets>
|
||||||
<property name="draw_indicator">True</property>
|
</object>
|
||||||
</widget>
|
<object class="GtkListStore" id="liststore1"/>
|
||||||
<packing>
|
</interface>
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkEntry" id="images_path">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="editable">True</property>
|
|
||||||
<property name="visibility">True</property>
|
|
||||||
<property name="max_length">0</property>
|
|
||||||
<property name="text" translatable="yes">media</property>
|
|
||||||
<property name="has_frame">True</property>
|
|
||||||
<property name="invisible_char" translatable="yes">*</property>
|
|
||||||
<property name="activates_default">False</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">5</property>
|
|
||||||
<property name="bottom_attach">6</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
</glade-interface>
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ from gettext import gettext as _
|
|||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gtk import glade
|
import gtk
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -53,12 +53,19 @@ log = logging.getLogger(".WriteGeneWeb")
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gen.lib
|
import gen.lib
|
||||||
from Filters import GenericFilter, Rules, build_filter_menu
|
from Filters import GenericFilter, Rules, build_filter_model
|
||||||
#import const
|
#import const
|
||||||
import Utils
|
import Utils
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Constants
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
_GLADE_FILE = "ExportGeneWeb.glade"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -77,15 +84,17 @@ class GeneWebWriterOptionBox:
|
|||||||
self.restrict = 1
|
self.restrict = 1
|
||||||
self.private = 1
|
self.private = 1
|
||||||
|
|
||||||
glade_file = os.path.join(os.path.dirname(__file__),
|
glade_file = os.path.join(
|
||||||
"ExportGeneWeb.glade")
|
os.path.split(__file__)[0],
|
||||||
|
_GLADE_FILE)
|
||||||
self.topDialog = glade.XML(glade_file, "genewebExport", "gramps")
|
|
||||||
self.topDialog.signal_autoconnect({
|
self.topDialog = gtk.Builder()
|
||||||
|
self.topDialog.add_from_file(glade_file)
|
||||||
|
self.topDialog.connect_signals({
|
||||||
"on_restrict_toggled": self.on_restrict_toggled
|
"on_restrict_toggled": self.on_restrict_toggled
|
||||||
})
|
})
|
||||||
|
|
||||||
filter_obj = self.topDialog.get_widget("filter")
|
self.filters = self.topDialog.get_object("filter")
|
||||||
self.copy = 0
|
self.copy = 0
|
||||||
|
|
||||||
all = GenericFilter()
|
all = GenericFilter()
|
||||||
@ -117,37 +126,38 @@ class GeneWebWriterOptionBox:
|
|||||||
|
|
||||||
from Filters import CustomFilters
|
from Filters import CustomFilters
|
||||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
self.filter_menu = build_filter_menu(the_filters)
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_obj.set_menu(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
the_box = self.topDialog.get_widget('vbox1')
|
the_box = self.topDialog.get_object('vbox1')
|
||||||
the_parent = self.topDialog.get_widget('dialog-vbox1')
|
the_parent = self.topDialog.get_object('dialog-vbox1')
|
||||||
the_parent.remove(the_box)
|
the_parent.remove(the_box)
|
||||||
self.topDialog.get_widget("genewebExport").destroy()
|
self.topDialog.get_object("genewebExport").destroy()
|
||||||
return the_box
|
return the_box
|
||||||
|
|
||||||
def on_restrict_toggled(self, restrict):
|
def on_restrict_toggled(self, restrict):
|
||||||
active = restrict.get_active ()
|
active = restrict.get_active ()
|
||||||
for x in [self.topDialog.get_widget("living"),
|
for x in [self.topDialog.get_object("living"),
|
||||||
self.topDialog.get_widget("notes"),
|
self.topDialog.get_object("notes"),
|
||||||
self.topDialog.get_widget("sources")]:
|
self.topDialog.get_object("sources")]:
|
||||||
x.set_sensitive(active)
|
x.set_sensitive(active)
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.restrict = self.topDialog.get_widget("restrict").get_active()
|
self.restrict = self.topDialog.get_object("restrict").get_active()
|
||||||
self.living = (self.restrict and
|
self.living = (self.restrict and
|
||||||
self.topDialog.get_widget("living").get_active())
|
self.topDialog.get_object("living").get_active())
|
||||||
self.exclnotes = (self.restrict and
|
self.exclnotes = (self.restrict and
|
||||||
self.topDialog.get_widget("notes").get_active())
|
self.topDialog.get_object("notes").get_active())
|
||||||
self.exclsrcs = (self.restrict and
|
self.exclsrcs = (self.restrict and
|
||||||
self.topDialog.get_widget("sources").get_active())
|
self.topDialog.get_object("sources").get_active())
|
||||||
self.private = self.topDialog.get_widget("private").get_active()
|
self.private = self.topDialog.get_object("private").get_active()
|
||||||
|
|
||||||
self.cfilter = self.filter_menu.get_active().get_data("filter")
|
self.cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||||
|
|
||||||
self.images = self.topDialog.get_widget ("images").get_active ()
|
self.images = self.topDialog.get_object ("images").get_active ()
|
||||||
if self.images:
|
if self.images:
|
||||||
images_path = self.topDialog.get_widget ("images_path")
|
images_path = self.topDialog.get_object ("images_path")
|
||||||
self.images_path = unicode(images_path.get_text ())
|
self.images_path = unicode(images_path.get_text ())
|
||||||
else:
|
else:
|
||||||
self.images_path = ""
|
self.images_path = ""
|
||||||
@ -263,7 +273,14 @@ class GeneWebWriter:
|
|||||||
mother_handle = family.get_mother_handle()
|
mother_handle = family.get_mother_handle()
|
||||||
if mother_handle:
|
if mother_handle:
|
||||||
mother = self.db.get_person_from_handle(mother_handle)
|
mother = self.db.get_person_from_handle(mother_handle)
|
||||||
self.writeln("fam %s %s +%s %s %s" % (self.get_ref_name(father), self.get_full_person_info_fam(father), self.get_wedding_data(family), self.get_ref_name(mother), self.get_full_person_info_fam(mother)))
|
self.writeln("fam %s %s +%s %s %s" %
|
||||||
|
(self.get_ref_name(father),
|
||||||
|
self.get_full_person_info_fam(father),
|
||||||
|
self.get_wedding_data(family),
|
||||||
|
self.get_ref_name(mother),
|
||||||
|
self.get_full_person_info_fam(mother)
|
||||||
|
)
|
||||||
|
)
|
||||||
self.write_witness( family)
|
self.write_witness( family)
|
||||||
self.write_sources( family.get_source_references())
|
self.write_sources( family.get_source_references())
|
||||||
self.write_children( family, father)
|
self.write_children( family, father)
|
||||||
@ -273,8 +290,7 @@ class GeneWebWriter:
|
|||||||
note = ""
|
note = ""
|
||||||
for notehandle in notelist:
|
for notehandle in notelist:
|
||||||
noteobj = self.db.get_note_from_handle(notehandle)
|
noteobj = self.db.get_note_from_handle(notehandle)
|
||||||
note += noteobj.get()
|
note += noteobj.get() + " "
|
||||||
note += " "
|
|
||||||
if note and note != "":
|
if note and note != "":
|
||||||
note = note.replace('\n\r',' ')
|
note = note.replace('\n\r',' ')
|
||||||
note = note.replace('\r\n',' ')
|
note = note.replace('\r\n',' ')
|
||||||
@ -296,15 +312,20 @@ class GeneWebWriter:
|
|||||||
if w_list:
|
if w_list:
|
||||||
for witness in w_list:
|
for witness in w_list:
|
||||||
if witness and witness.type == gen.lib.Event.ID:
|
if witness and witness.type == gen.lib.Event.ID:
|
||||||
person = self.db.get_person_from_handle(witness.get_value())
|
person = self.db.get_person_from_handle(
|
||||||
|
witness.get_value())
|
||||||
if person:
|
if person:
|
||||||
gender = ""
|
gender = ""
|
||||||
if person.get_gender() == gen.lib.Person.MALE:
|
if person.get_gender() == gen.lib.Person.MALE:
|
||||||
gender = "h"
|
gender = "h"
|
||||||
elif person.get_gender() == gen.lib.Person.FEMALE:
|
elif person.get_gender() == gen.lib.Person.FEMALE:
|
||||||
gender = "f"
|
gender = "f"
|
||||||
self.writeln("wit %s %s %s" % (gender, self.get_ref_name(person), self.get_full_person_info_fam(person)))
|
self.writeln("wit %s %s %s" %
|
||||||
|
(gender,
|
||||||
|
self.get_ref_name(person),
|
||||||
|
self.get_full_person_info_fam(person)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def write_sources(self,reflist):
|
def write_sources(self,reflist):
|
||||||
if self.restrict and self.exclnotes:
|
if self.restrict and self.exclnotes:
|
||||||
@ -316,7 +337,9 @@ class GeneWebWriter:
|
|||||||
if sbase:
|
if sbase:
|
||||||
source = self.db.get_source_from_handle(sbase)
|
source = self.db.get_source_from_handle(sbase)
|
||||||
if source:
|
if source:
|
||||||
self.writeln( "src %s" % (self.rem_spaces(source.get_title())))
|
self.writeln( "src %s" %
|
||||||
|
(self.rem_spaces(source.get_title()))
|
||||||
|
)
|
||||||
|
|
||||||
def write_children(self,family, father):
|
def write_children(self,family, father):
|
||||||
father_lastname = father.get_primary_name().get_surname()
|
father_lastname = father.get_primary_name().get_surname()
|
||||||
@ -331,7 +354,12 @@ class GeneWebWriter:
|
|||||||
gender = "h"
|
gender = "h"
|
||||||
elif child.get_gender() == gen.lib.Person.FEMALE:
|
elif child.get_gender() == gen.lib.Person.FEMALE:
|
||||||
gender = "f"
|
gender = "f"
|
||||||
self.writeln("- %s %s %s" % (gender, self.get_child_ref_name(child, father_lastname), self.get_full_person_info_child(child)))
|
self.writeln("- %s %s %s" %
|
||||||
|
(gender,
|
||||||
|
self.get_child_ref_name(child, father_lastname),
|
||||||
|
self.get_full_person_info_child(child)
|
||||||
|
)
|
||||||
|
)
|
||||||
self.writeln("end")
|
self.writeln("end")
|
||||||
|
|
||||||
def write_notes(self,family, father, mother):
|
def write_notes(self,family, father, mother):
|
||||||
@ -452,24 +480,24 @@ class GeneWebWriter:
|
|||||||
def get_ref_name(self,person):
|
def get_ref_name(self,person):
|
||||||
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
||||||
firstname = _("Living")
|
firstname = _("Living")
|
||||||
if not (Utils.probably_alive(person,self.db) and self.restrict and self.living):
|
if not (Utils.probably_alive(person,self.db) and \
|
||||||
|
self.restrict and self.living):
|
||||||
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
||||||
if person.get_handle() not in self.person_ids:
|
if person.get_handle() not in self.person_ids:
|
||||||
self.person_ids[person.get_handle()] = len(self.person_ids)
|
self.person_ids[person.get_handle()] = len(self.person_ids)
|
||||||
ret = "%s %s.%d" % (surname, firstname, self.person_ids[person.get_handle()])
|
return "%s %s.%d" % (surname, firstname,
|
||||||
return ret
|
self.person_ids[person.get_handle()])
|
||||||
|
|
||||||
def get_child_ref_name(self,person,father_lastname):
|
def get_child_ref_name(self,person,father_lastname):
|
||||||
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
||||||
firstname = _("Living")
|
firstname = _("Living")
|
||||||
if not (Utils.probably_alive(person,self.db) and self.restrict and self.living):
|
if not (Utils.probably_alive(person,self.db) and \
|
||||||
|
self.restrict and self.living):
|
||||||
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
||||||
if person.get_handle() not in self.person_ids:
|
if person.get_handle() not in self.person_ids:
|
||||||
self.person_ids[person.get_handle()] = len(self.person_ids)
|
self.person_ids[person.get_handle()] = len(self.person_ids)
|
||||||
if surname != father_lastname:
|
ret = "%s.%d" % (firstname, self.person_ids[person.get_handle()])
|
||||||
ret = "%s.%d %s" % (firstname, self.person_ids[person.get_handle()], surname)
|
if surname != father_lastname: ret += " " + surname
|
||||||
else:
|
|
||||||
ret = "%s.%d" % (firstname, self.person_ids[person.get_handle()])
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def get_wedding_data(self,family):
|
def get_wedding_data(self,family):
|
||||||
|
|||||||
@ -1,188 +1,162 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
<interface>
|
||||||
|
<requires lib="gtk+" version="2.16"/>
|
||||||
<glade-interface>
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
|
<object class="GtkDialog" id="calendarExport">
|
||||||
<widget class="GtkDialog" id="calendarExport">
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="modal">True</property>
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="default_width">400</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type_hint">dialog</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="has_separator">False</property>
|
||||||
<property name="modal">True</property>
|
<child internal-child="vbox">
|
||||||
<property name="default_width">400</property>
|
<object class="GtkVBox" id="dialog-vbox1">
|
||||||
<property name="resizable">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="spacing">8</property>
|
||||||
<property name="decorated">True</property>
|
<child>
|
||||||
<property name="skip_taskbar_hint">False</property>
|
<object class="GtkVBox" id="vbox1">
|
||||||
<property name="skip_pager_hint">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
<child>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<object class="GtkTable" id="table3">
|
||||||
<property name="has_separator">False</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">12</property>
|
||||||
<child internal-child="vbox">
|
<property name="n_rows">2</property>
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
<property name="n_columns">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="spacing">8</property>
|
<child>
|
||||||
|
<object class="GtkLabel" id="label9">
|
||||||
<child internal-child="action_area">
|
<property name="visible">True</property>
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
<property name="xalign">0</property>
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes"><b>Options</b></property>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkButton" id="cancel">
|
<property name="right_attach">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="can_default">True</property>
|
<property name="y_options"></property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label">gtk-cancel</property>
|
</child>
|
||||||
<property name="use_stock">True</property>
|
<child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="focus_on_click">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="response_id">0</property>
|
<property name="xalign">0</property>
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
<property name="label" translatable="yes">Filt_er:</property>
|
||||||
</widget>
|
<property name="use_underline">True</property>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="left_attach">1</property>
|
||||||
<widget class="GtkButton" id="ok">
|
<property name="right_attach">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="can_default">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="label">gtk-ok</property>
|
<property name="y_options"></property>
|
||||||
<property name="use_stock">True</property>
|
</packing>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
</child>
|
||||||
<property name="focus_on_click">True</property>
|
<child>
|
||||||
<property name="response_id">0</property>
|
<object class="GtkComboBox" id="filter">
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
<property name="visible">True</property>
|
||||||
</widget>
|
<property name="model">liststore1</property>
|
||||||
</child>
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
<child>
|
<attributes>
|
||||||
<widget class="GtkButton" id="button1">
|
<attribute name="text">0</attribute>
|
||||||
<property name="visible">True</property>
|
</attributes>
|
||||||
<property name="can_default">True</property>
|
</child>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label">gtk-help</property>
|
<packing>
|
||||||
<property name="use_stock">True</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="focus_on_click">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="response_id">-11</property>
|
<property name="bottom_attach">2</property>
|
||||||
<signal name="clicked" handler="on_help_clicked" last_modification_time="Tue, 02 Dec 2003 01:53:26 GMT"/>
|
</packing>
|
||||||
</widget>
|
</child>
|
||||||
</child>
|
<child>
|
||||||
</widget>
|
<placeholder/>
|
||||||
<packing>
|
</child>
|
||||||
<property name="padding">0</property>
|
</object>
|
||||||
<property name="expand">False</property>
|
<packing>
|
||||||
<property name="fill">True</property>
|
<property name="expand">False</property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
<property name="fill">False</property>
|
||||||
</packing>
|
<property name="pack_type">end</property>
|
||||||
</child>
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
<child>
|
</child>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
</object>
|
||||||
<property name="visible">True</property>
|
<packing>
|
||||||
<property name="homogeneous">False</property>
|
<property name="position">1</property>
|
||||||
<property name="spacing">0</property>
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child internal-child="action_area">
|
||||||
<widget class="GtkTable" id="table3">
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
<property name="border_width">12</property>
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="layout_style">end</property>
|
||||||
<property name="n_rows">2</property>
|
<child>
|
||||||
<property name="n_columns">3</property>
|
<object class="GtkButton" id="cancel">
|
||||||
<property name="homogeneous">False</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="visible">True</property>
|
||||||
<property name="column_spacing">12</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
<child>
|
<property name="receives_default">False</property>
|
||||||
<widget class="GtkLabel" id="label9">
|
<property name="use_stock">True</property>
|
||||||
<property name="visible">True</property>
|
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
||||||
<property name="label" translatable="yes"><b>Options</b></property>
|
</object>
|
||||||
<property name="use_underline">False</property>
|
<packing>
|
||||||
<property name="use_markup">True</property>
|
<property name="expand">False</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="fill">False</property>
|
||||||
<property name="wrap">False</property>
|
<property name="position">0</property>
|
||||||
<property name="selectable">False</property>
|
</packing>
|
||||||
<property name="xalign">0</property>
|
</child>
|
||||||
<property name="yalign">0.5</property>
|
<child>
|
||||||
<property name="xpad">0</property>
|
<object class="GtkButton" id="ok">
|
||||||
<property name="ypad">0</property>
|
<property name="label">gtk-ok</property>
|
||||||
</widget>
|
<property name="visible">True</property>
|
||||||
<packing>
|
<property name="can_focus">True</property>
|
||||||
<property name="left_attach">0</property>
|
<property name="can_default">True</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="bottom_attach">1</property>
|
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
||||||
<property name="x_options">fill</property>
|
</object>
|
||||||
<property name="y_options"></property>
|
<packing>
|
||||||
</packing>
|
<property name="expand">False</property>
|
||||||
</child>
|
<property name="fill">False</property>
|
||||||
|
<property name="position">1</property>
|
||||||
<child>
|
</packing>
|
||||||
<widget class="GtkLabel" id="label1">
|
</child>
|
||||||
<property name="visible">True</property>
|
<child>
|
||||||
<property name="label" translatable="yes">Filt_er:</property>
|
<object class="GtkButton" id="button1">
|
||||||
<property name="use_underline">True</property>
|
<property name="label">gtk-help</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="wrap">False</property>
|
<property name="can_default">True</property>
|
||||||
<property name="selectable">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="yalign">0.5</property>
|
<signal name="clicked" handler="on_help_clicked"/>
|
||||||
<property name="xpad">0</property>
|
</object>
|
||||||
<property name="ypad">0</property>
|
<packing>
|
||||||
<property name="mnemonic_widget">filter</property>
|
<property name="expand">False</property>
|
||||||
</widget>
|
<property name="fill">False</property>
|
||||||
<packing>
|
<property name="position">2</property>
|
||||||
<property name="left_attach">1</property>
|
</packing>
|
||||||
<property name="right_attach">2</property>
|
</child>
|
||||||
<property name="top_attach">1</property>
|
</object>
|
||||||
<property name="bottom_attach">2</property>
|
<packing>
|
||||||
<property name="x_options">fill</property>
|
<property name="expand">False</property>
|
||||||
<property name="y_options"></property>
|
<property name="pack_type">end</property>
|
||||||
</packing>
|
<property name="position">0</property>
|
||||||
</child>
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
</object>
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
</child>
|
||||||
<property name="visible">True</property>
|
<action-widgets>
|
||||||
<property name="can_focus">True</property>
|
<action-widget response="0">cancel</action-widget>
|
||||||
<property name="history">-1</property>
|
<action-widget response="0">ok</action-widget>
|
||||||
|
<action-widget response="-11">button1</action-widget>
|
||||||
<child internal-child="menu">
|
</action-widgets>
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
</object>
|
||||||
<property name="visible">True</property>
|
<object class="GtkListStore" id="liststore1">
|
||||||
</widget>
|
<columns>
|
||||||
</child>
|
<!-- column-name gchararray1 -->
|
||||||
</widget>
|
<column type="gchararray"/>
|
||||||
<packing>
|
</columns>
|
||||||
<property name="left_attach">2</property>
|
</object>
|
||||||
<property name="right_attach">3</property>
|
</interface>
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
</glade-interface>
|
|
||||||
|
|||||||
@ -39,7 +39,6 @@ from gettext import gettext as _
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gtk
|
import gtk
|
||||||
from gtk import glade
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -54,13 +53,20 @@ log = logging.getLogger(".ExportVCal")
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from Filters import GenericFilter, Rules, build_filter_menu
|
from Filters import GenericFilter, Rules, build_filter_model
|
||||||
import Utils
|
import Utils
|
||||||
from gen.lib import Date, EventType
|
from gen.lib import Date, EventType
|
||||||
import Errors
|
import Errors
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Constants
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
_GLADE_FILE = "ExportVCalendar.glade"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -75,15 +81,16 @@ class CalendarWriterOptionBox:
|
|||||||
def __init__(self, person):
|
def __init__(self, person):
|
||||||
self.person = person
|
self.person = person
|
||||||
|
|
||||||
glade_file = os.path.join(os.path.dirname(__file__),
|
glade_file = os.path.join(
|
||||||
"ExportVCalendar.glade")
|
os.path.split(__file__)[0],
|
||||||
|
_GLADE_FILE)
|
||||||
|
|
||||||
self.topDialog = glade.XML(glade_file, "calendarExport", "gramps")
|
self.topDialog = gtk.Builder()
|
||||||
|
self.topDialog.add_from_file(glade_file)
|
||||||
self.copy = 0
|
self.copy = 0
|
||||||
self.filter_menu = gtk.Menu()
|
|
||||||
|
|
||||||
def get_option_box(self):
|
def get_option_box(self):
|
||||||
filter_obj = self.topDialog.get_widget("filter")
|
self.filters = self.topDialog.get_object("filter")
|
||||||
|
|
||||||
everyone_filter = GenericFilter()
|
everyone_filter = GenericFilter()
|
||||||
everyone_filter.set_name(_("Entire Database"))
|
everyone_filter.set_name(_("Entire Database"))
|
||||||
@ -114,18 +121,18 @@ class CalendarWriterOptionBox:
|
|||||||
|
|
||||||
from Filters import CustomFilters
|
from Filters import CustomFilters
|
||||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
self.filter_menu = build_filter_menu(the_filters)
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_obj.set_menu(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
the_box = self.topDialog.get_widget('vbox1')
|
the_box = self.topDialog.get_object('vbox1')
|
||||||
the_parent = self.topDialog.get_widget('dialog-vbox1')
|
the_parent = self.topDialog.get_object('dialog-vbox1')
|
||||||
the_parent.remove(the_box)
|
the_parent.remove(the_box)
|
||||||
self.topDialog.get_widget("calendarExport").destroy()
|
self.topDialog.get_object("calendarExport").destroy()
|
||||||
return the_box
|
return the_box
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.cfilter = self.filter_menu.get_active().get_data("filter")
|
self.cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||||
|
|
||||||
|
|
||||||
class CalendarWriter:
|
class CalendarWriter:
|
||||||
def __init__(self, database, cl=0, filename="", option_box=None,
|
def __init__(self, database, cl=0, filename="", option_box=None,
|
||||||
@ -160,7 +167,8 @@ class CalendarWriter:
|
|||||||
self.plist[p] = 1
|
self.plist[p] = 1
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for p in self.option_box.cfilter.apply(self.db, self.db.get_person_handles(sort_handles=False)):
|
for p in self.option_box.cfilter.apply(self.db,
|
||||||
|
self.db.get_person_handles(sort_handles=False)):
|
||||||
self.plist[p] = 1
|
self.plist[p] = 1
|
||||||
except Errors.FilterError, msg:
|
except Errors.FilterError, msg:
|
||||||
(m1, m2) = msg.messages()
|
(m1, m2) = msg.messages()
|
||||||
@ -257,10 +265,13 @@ class CalendarWriter:
|
|||||||
place_handle = birth.get_place_handle()
|
place_handle = birth.get_place_handle()
|
||||||
if place_handle:
|
if place_handle:
|
||||||
place = self.db.get_place_from_handle(place_handle)
|
place = self.db.get_place_from_handle(place_handle)
|
||||||
self.write_vevent(_("Birth of %s") % person.get_primary_name().get_name(), b_date, place.get_title())
|
self.write_vevent(_("Birth of %s") %
|
||||||
|
person.get_primary_name().get_name(),
|
||||||
|
b_date, place.get_title())
|
||||||
else:
|
else:
|
||||||
self.write_vevent(_("Birth of %s")
|
self.write_vevent(_("Birth of %s") %
|
||||||
% person.get_primary_name().get_name(), b_date)
|
person.get_primary_name().get_name(),
|
||||||
|
b_date)
|
||||||
|
|
||||||
death_ref = person.get_death_ref()
|
death_ref = person.get_death_ref()
|
||||||
if death_ref:
|
if death_ref:
|
||||||
@ -270,9 +281,14 @@ class CalendarWriter:
|
|||||||
place_handle = death.get_place_handle()
|
place_handle = death.get_place_handle()
|
||||||
if place_handle:
|
if place_handle:
|
||||||
place = self.db.get_place_from_handle(place_handle)
|
place = self.db.get_place_from_handle(place_handle)
|
||||||
self.write_vevent(_("Death of %s") % person.get_primary_name().get_name(), d_date, place.get_title())
|
self.write_vevent(_("Death of %s") %
|
||||||
|
person.get_primary_name().get_name(),
|
||||||
|
d_date,
|
||||||
|
place.get_title())
|
||||||
else:
|
else:
|
||||||
self.write_vevent(_("Death of %s") % person.get_primary_name().get_name(), d_date)
|
self.write_vevent(_("Death of %s") %
|
||||||
|
person.get_primary_name().get_name(),
|
||||||
|
d_date)
|
||||||
|
|
||||||
|
|
||||||
def format_single_date(self, subdate, thisyear, cal):
|
def format_single_date(self, subdate, thisyear, cal):
|
||||||
@ -359,4 +375,4 @@ plugin = ExportPlugin(name = _('vC_alendar'),
|
|||||||
export_function = exportData,
|
export_function = exportData,
|
||||||
extension = "vcs",
|
extension = "vcs",
|
||||||
config = _config )
|
config = _config )
|
||||||
pmgr.register_plugin(plugin)
|
pmgr.register_plugin(plugin)
|
||||||
|
|||||||
@ -1,188 +1,155 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
<interface>
|
||||||
|
<requires lib="gtk+" version="2.16"/>
|
||||||
<glade-interface>
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
|
<object class="GtkDialog" id="vcardExport">
|
||||||
<widget class="GtkDialog" id="vcardExport">
|
<property name="visible">True</property>
|
||||||
<property name="visible">True</property>
|
<property name="modal">True</property>
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="default_width">400</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type_hint">dialog</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="has_separator">False</property>
|
||||||
<property name="modal">True</property>
|
<child internal-child="vbox">
|
||||||
<property name="default_width">400</property>
|
<object class="GtkVBox" id="dialog-vbox1">
|
||||||
<property name="resizable">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="spacing">8</property>
|
||||||
<property name="decorated">True</property>
|
<child>
|
||||||
<property name="skip_taskbar_hint">False</property>
|
<object class="GtkVBox" id="vbox1">
|
||||||
<property name="skip_pager_hint">False</property>
|
<property name="visible">True</property>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
<child>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<object class="GtkTable" id="table3">
|
||||||
<property name="has_separator">False</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">12</property>
|
||||||
<child internal-child="vbox">
|
<property name="n_rows">2</property>
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
<property name="n_columns">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="column_spacing">12</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="row_spacing">6</property>
|
||||||
<property name="spacing">8</property>
|
<child>
|
||||||
|
<object class="GtkLabel" id="label9">
|
||||||
<child internal-child="action_area">
|
<property name="visible">True</property>
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
<property name="xalign">0</property>
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes"><b>Options</b></property>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="use_markup">True</property>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkButton" id="cancel">
|
<property name="right_attach">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="can_default">True</property>
|
<property name="y_options"></property>
|
||||||
<property name="can_focus">True</property>
|
</packing>
|
||||||
<property name="label">gtk-cancel</property>
|
</child>
|
||||||
<property name="use_stock">True</property>
|
<child>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="focus_on_click">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="response_id">0</property>
|
<property name="xalign">0</property>
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
<property name="label" translatable="yes">Filt_er:</property>
|
||||||
</widget>
|
<property name="use_underline">True</property>
|
||||||
</child>
|
</object>
|
||||||
|
<packing>
|
||||||
<child>
|
<property name="left_attach">1</property>
|
||||||
<widget class="GtkButton" id="ok">
|
<property name="right_attach">2</property>
|
||||||
<property name="visible">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="can_default">True</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="label">gtk-ok</property>
|
<property name="y_options"></property>
|
||||||
<property name="use_stock">True</property>
|
</packing>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
</child>
|
||||||
<property name="focus_on_click">True</property>
|
<child>
|
||||||
<property name="response_id">0</property>
|
<object class="GtkComboBox" id="filter">
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
<property name="visible">True</property>
|
||||||
</widget>
|
<property name="model">liststore1</property>
|
||||||
</child>
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
<child>
|
<attributes>
|
||||||
<widget class="GtkButton" id="button1">
|
<attribute name="text">0</attribute>
|
||||||
<property name="visible">True</property>
|
</attributes>
|
||||||
<property name="can_default">True</property>
|
</child>
|
||||||
<property name="can_focus">True</property>
|
</object>
|
||||||
<property name="label">gtk-help</property>
|
<packing>
|
||||||
<property name="use_stock">True</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="focus_on_click">True</property>
|
</packing>
|
||||||
<property name="response_id">-11</property>
|
</child>
|
||||||
<signal name="clicked" handler="on_help_clicked" last_modification_time="Tue, 02 Dec 2003 01:53:26 GMT"/>
|
<child>
|
||||||
</widget>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="padding">0</property>
|
<property name="expand">False</property>
|
||||||
<property name="expand">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="pack_type">end</property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
<child>
|
<packing>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
<property name="position">1</property>
|
||||||
<property name="visible">True</property>
|
</packing>
|
||||||
<property name="homogeneous">False</property>
|
</child>
|
||||||
<property name="spacing">0</property>
|
<child internal-child="action_area">
|
||||||
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
<child>
|
<property name="visible">True</property>
|
||||||
<widget class="GtkTable" id="table3">
|
<property name="layout_style">end</property>
|
||||||
<property name="border_width">12</property>
|
<child>
|
||||||
<property name="visible">True</property>
|
<object class="GtkButton" id="cancel">
|
||||||
<property name="n_rows">2</property>
|
<property name="label">gtk-cancel</property>
|
||||||
<property name="n_columns">3</property>
|
<property name="visible">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="can_default">True</property>
|
||||||
<property name="column_spacing">12</property>
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
<child>
|
<signal name="clicked" handler="destroy_passed_object" object="gedcomExport"/>
|
||||||
<widget class="GtkLabel" id="label9">
|
</object>
|
||||||
<property name="visible">True</property>
|
<packing>
|
||||||
<property name="label" translatable="yes"><b>Options</b></property>
|
<property name="expand">False</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="use_markup">True</property>
|
<property name="position">0</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
</packing>
|
||||||
<property name="wrap">False</property>
|
</child>
|
||||||
<property name="selectable">False</property>
|
<child>
|
||||||
<property name="xalign">0</property>
|
<object class="GtkButton" id="ok">
|
||||||
<property name="yalign">0.5</property>
|
<property name="label">gtk-ok</property>
|
||||||
<property name="xpad">0</property>
|
<property name="visible">True</property>
|
||||||
<property name="ypad">0</property>
|
<property name="can_focus">True</property>
|
||||||
</widget>
|
<property name="can_default">True</property>
|
||||||
<packing>
|
<property name="receives_default">False</property>
|
||||||
<property name="left_attach">0</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="right_attach">3</property>
|
<signal name="clicked" handler="on_ok_clicked" object="gedcomExport"/>
|
||||||
<property name="top_attach">0</property>
|
</object>
|
||||||
<property name="bottom_attach">1</property>
|
<packing>
|
||||||
<property name="x_options">fill</property>
|
<property name="expand">False</property>
|
||||||
<property name="y_options"></property>
|
<property name="fill">False</property>
|
||||||
</packing>
|
<property name="position">1</property>
|
||||||
</child>
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label1">
|
<object class="GtkButton" id="button1">
|
||||||
<property name="visible">True</property>
|
<property name="label">gtk-help</property>
|
||||||
<property name="label" translatable="yes">Filt_er:</property>
|
<property name="visible">True</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="can_default">True</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="wrap">False</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="selectable">False</property>
|
<signal name="clicked" handler="on_help_clicked"/>
|
||||||
<property name="xalign">0</property>
|
</object>
|
||||||
<property name="yalign">0.5</property>
|
<packing>
|
||||||
<property name="xpad">0</property>
|
<property name="expand">False</property>
|
||||||
<property name="ypad">0</property>
|
<property name="fill">False</property>
|
||||||
<property name="mnemonic_widget">filter</property>
|
<property name="position">2</property>
|
||||||
</widget>
|
</packing>
|
||||||
<packing>
|
</child>
|
||||||
<property name="left_attach">1</property>
|
</object>
|
||||||
<property name="right_attach">2</property>
|
<packing>
|
||||||
<property name="top_attach">1</property>
|
<property name="expand">False</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="pack_type">end</property>
|
||||||
<property name="x_options">fill</property>
|
<property name="position">0</property>
|
||||||
<property name="y_options"></property>
|
</packing>
|
||||||
</packing>
|
</child>
|
||||||
</child>
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<action-widgets>
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
<action-widget response="0">cancel</action-widget>
|
||||||
<property name="visible">True</property>
|
<action-widget response="0">ok</action-widget>
|
||||||
<property name="can_focus">True</property>
|
<action-widget response="-11">button1</action-widget>
|
||||||
<property name="history">-1</property>
|
</action-widgets>
|
||||||
|
</object>
|
||||||
<child internal-child="menu">
|
<object class="GtkListStore" id="liststore1"/>
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
</interface>
|
||||||
<property name="visible">True</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
|
|
||||||
</glade-interface>
|
|
||||||
|
|||||||
@ -45,19 +45,26 @@ log = logging.getLogger(".ExportVCard")
|
|||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gtk import glade
|
import gtk
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from Filters import GenericFilter, Rules, build_filter_menu
|
from Filters import GenericFilter, Rules, build_filter_model
|
||||||
from gen.lib import Date
|
from gen.lib import Date
|
||||||
import Errors
|
import Errors
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Constants
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
_GLADE_FILE = "ExportVCard.glade"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -74,12 +81,14 @@ class CardWriterOptionBox:
|
|||||||
|
|
||||||
def get_option_box(self):
|
def get_option_box(self):
|
||||||
|
|
||||||
glade_file = os.path.join(os.path.dirname(__file__),
|
glade_file = os.path.join(
|
||||||
"ExportVCard.glade")
|
os.path.split(__file__)[0],
|
||||||
|
_GLADE_FILE)
|
||||||
|
|
||||||
self.topDialog = glade.XML(glade_file,"vcardExport","gramps")
|
self.topDialog = gtk.Builder()
|
||||||
|
self.topDialog.add_from_file(glade_file)
|
||||||
|
|
||||||
filter_obj = self.topDialog.get_widget("filter")
|
self.filters = self.topDialog.get_object("filter")
|
||||||
self.copy = 0
|
self.copy = 0
|
||||||
|
|
||||||
all = GenericFilter()
|
all = GenericFilter()
|
||||||
@ -111,17 +120,18 @@ class CardWriterOptionBox:
|
|||||||
|
|
||||||
from Filters import CustomFilters
|
from Filters import CustomFilters
|
||||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
self.filter_menu = build_filter_menu(the_filters)
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_obj.set_menu(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
the_box = self.topDialog.get_widget('vbox1')
|
the_box = self.topDialog.get_object('vbox1')
|
||||||
the_parent = self.topDialog.get_widget('dialog-vbox1')
|
the_parent = self.topDialog.get_object('dialog-vbox1')
|
||||||
the_parent.remove(the_box)
|
the_parent.remove(the_box)
|
||||||
self.topDialog.get_widget("vcardExport").destroy()
|
self.topDialog.get_object("vcardExport").destroy()
|
||||||
return the_box
|
return the_box
|
||||||
|
|
||||||
def parse_options(self):
|
def parse_options(self):
|
||||||
self.cfilter = self.filter_menu.get_active().get_data("filter")
|
self.cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||||
|
|
||||||
class CardWriter:
|
class CardWriter:
|
||||||
def __init__(self, database, cl=0, filename="", option_box=None,
|
def __init__(self, database, cl=0, filename="", option_box=None,
|
||||||
@ -204,7 +214,14 @@ class CardWriter:
|
|||||||
prname = person.get_primary_name()
|
prname = person.get_primary_name()
|
||||||
|
|
||||||
self.writeln("FN:%s" % prname.get_regular_name())
|
self.writeln("FN:%s" % prname.get_regular_name())
|
||||||
self.writeln("N:%s;%s;%s;%s;%s" % (prname.get_surname(), prname.get_first_name(), person.get_nick_name(), prname.get_surname_prefix(), prname.get_suffix()))
|
self.writeln("N:%s;%s;%s;%s;%s" %
|
||||||
|
(prname.get_surname(),
|
||||||
|
prname.get_first_name(),
|
||||||
|
person.get_nick_name(),
|
||||||
|
prname.get_surname_prefix(),
|
||||||
|
prname.get_suffix()
|
||||||
|
)
|
||||||
|
)
|
||||||
if prname.get_title():
|
if prname.get_title():
|
||||||
self.writeln("TITLE:%s" % prname.get_title())
|
self.writeln("TITLE:%s" % prname.get_title())
|
||||||
|
|
||||||
@ -233,10 +250,8 @@ class CardWriter:
|
|||||||
zip = address.get_postal_code()
|
zip = address.get_postal_code()
|
||||||
country = address.get_country()
|
country = address.get_country()
|
||||||
if street or city or state or zip or country:
|
if street or city or state or zip or country:
|
||||||
self.writeln("ADR:%s;%s;%s;%s;%s;%s;%s" % (postbox, ext,
|
self.writeln("ADR:%s;%s;%s;%s;%s;%s;%s" %
|
||||||
street, city,
|
(postbox, ext, street, city,state, zip, country))
|
||||||
state, zip,
|
|
||||||
country))
|
|
||||||
|
|
||||||
phone = address.get_phone()
|
phone = address.get_phone()
|
||||||
if phone:
|
if phone:
|
||||||
|
|||||||
@ -148,16 +148,14 @@ class EventComparison(Tool.Tool,ManagedWindow.ManagedWindow):
|
|||||||
all.set_name(_("Entire Database"))
|
all.set_name(_("Entire Database"))
|
||||||
all.add_rule(Rules.Person.Everyone([]))
|
all.add_rule(Rules.Person.Everyone([]))
|
||||||
|
|
||||||
# the following three lines appear to be unnecessary.
|
the_filters = [all]
|
||||||
# variable "the_filters" is not used anywhere else
|
from Filters import CustomFilters
|
||||||
# commenting out for now
|
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||||
#the_filters = [all]
|
|
||||||
#from Filters import CustomFilters
|
|
||||||
#the_filters.extend(CustomFilters.get_filters('Person'))
|
|
||||||
|
|
||||||
self.filter_menu = build_filter_model('Person')
|
self.filter_menu = build_filter_model(the_filters)
|
||||||
filter_num = self.options.handler.options_dict['filter']
|
filter_num = self.options.handler.options_dict['filter']
|
||||||
self.filters.set_model(self.filter_menu)
|
self.filters.set_model(self.filter_menu)
|
||||||
|
self.filters.set_active(0)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user