* src/Exporter.py: Keep track of added extra pages.

* src/plugins/WriteGedcom.py: Switch from radiobuttons to menu
for the encoding choice.
* src/plugins/gedcomexport.glade: Clean up interface.


svn: r3267
This commit is contained in:
Alex Roitman 2004-07-12 21:29:15 +00:00
parent 9d96849481
commit 52510afa71
4 changed files with 227 additions and 206 deletions

View File

@ -1,3 +1,9 @@
2004-07-12 Alex Roitman <shura@alex.neuro.umn.edu>
* src/Exporter.py: Keep track of added extra pages.
* src/plugins/WriteGedcom.py: Switch from radiobuttons to menu
for the encoding choice.
* src/plugins/gedcomexport.glade: Clean up interface.
2004-07-11 Don Allingham <dallingham@users.sourceforge.net>
* src/FamilyView.py: handle deleting of parent properly
* src/plugins/WriteGedcom.py: revert to using GRAMPS ID values

View File

@ -82,6 +82,7 @@ class Exporter:
self.build_exports()
self.confirm_label = gtk.Label()
self.extra_pages = []
self.w = gtk.Window()
@ -257,7 +258,8 @@ class Exporter:
table.attach(button,0,2,2*ix,2*ix+1)
label = gtk.Label(description)
label.set_line_wrap(gtk.TRUE)
table.attach(label,1,2,2*ix+1,2*ix+2)
label.set_alignment(0,0.5)
table.attach(label,1,2,2*ix+1,2*ix+2,xpadding=24)
box.add(table)
box.show_all()
@ -265,9 +267,25 @@ class Exporter:
return p
def build_options(self,obj,obj2):
"""
Build an extra page with the options specific for the chosen format.
If there's already a page (or pages) for this format in
self.empty_pages then do nothing, otherwise add a page.
If the chosen format does not have options then remove all
extra pages that are already there (from previous user passes
through the druid).
"""
ix = self.get_selected_format_index()
if self.exports[ix][3]:
title = self.exports[ix][3][0]
for (ep_ix,ep) in self.extra_pages:
if ep_ix == ix:
return
else:
ep.destroy()
self.extra_pages.remove((ep_ix,ep))
option_box_class = self.exports[ix][3][1]
self.option_box_instance = option_box_class(self.person)
@ -277,8 +295,13 @@ class Exporter:
p.set_background(self.bg_color)
p.set_logo(self.logo)
p.append_item("",self.option_box_instance.get_option_box(),"")
self.extra_pages.append((ix,p))
self.d.insert_page(self.file_sel_page,p)
p.show_all()
else:
for (ep_ix,ep) in self.extra_pages:
ep.destroy()
self.extra_pages = []
def build_file_sel_page(self):
"""

View File

@ -379,6 +379,9 @@ class GedcomWriterOptionBox:
"gnu_free" : self.gnu_free,
"standard_copyright" : self.standard_copyright,
"no_copyright" : self.no_copyright,
"ansel" : self.ansel,
"ansi" : self.ansi,
"unicode" : self.uncd,
"on_restrict_toggled": self.on_restrict_toggled,
})
@ -434,6 +437,15 @@ class GedcomWriterOptionBox:
def no_copyright(self,obj):
self.copy = 2
def ansel(self,obj):
self.cnvtxt = ansel_utf8.utf8_to_ansel
def uncd(self,obj):
self.cnvtxt = keep_utf8
def ansi(self,obj):
self.cnvtxt = iso8859
def on_restrict_toggled(self,restrict):
active = restrict.get_active ()
map (lambda x: x.set_sensitive (active),
@ -471,13 +483,6 @@ class GedcomWriterOptionBox:
self.prefix = self.target_ged.get_prefix()
self.source_refs = self.target_ged.get_source_refs()
if self.topDialog.get_widget("ansel").get_active():
self.cnvtxt = ansel_utf8.utf8_to_ansel
elif self.topDialog.get_widget("ansi").get_active():
self.cnvtxt = iso8859
else:
self.cnvtxt = keep_utf8
self.nl = self.cnvtxt(self.target_ged.get_endl())
# glade_file = "%s/gedcomexport.glade" % os.path.dirname(__file__)

View File

@ -91,14 +91,14 @@
<widget class="GtkTable" id="table3">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">12</property>
<property name="n_rows">10</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<widget class="GtkLabel" id="label8">
<widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Encoding&lt;/b&gt;</property>
<property name="use_underline">False</property>
@ -121,53 +121,6 @@
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="ansel">
<property name="border_width">2</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_ANSEL</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</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">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radiobutton2">
<property name="border_width">2</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_UNICODE</property>
<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>
<property name="group">ansel</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>
<child>
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
@ -185,33 +138,55 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</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>
<child>
<widget class="GtkLabel" id="label6">
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Copyright:</property>
<property name="label" translatable="yes">_Filter:</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.001</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">copyright</property>
<property name="mnemonic_widget">filter</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkOptionMenu" id="filter">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="history">-1</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget1">
<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">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -235,30 +210,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkOptionMenu" id="filter">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="history">-1</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget1">
<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">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -287,8 +240,33 @@
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="label" translatable="yes">_Copyright:</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.001</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">copyright</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -304,7 +282,7 @@
<widget class="GtkMenu" id="menu1">
<child>
<widget class="GtkMenuItem" id="standard_copyright1">
<widget class="GtkMenuItem" id="standard_copyright">
<property name="visible">True</property>
<property name="label" translatable="yes">Standard Copyright</property>
<property name="use_underline">True</property>
@ -335,8 +313,8 @@
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -358,8 +336,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -382,8 +360,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -398,42 +376,6 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<widget class="GtkCheckButton" id="living">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Living as first name</property>
<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">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkDrawingArea" id="drawingarea1">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="notes">
<property name="visible">True</property>
@ -477,105 +419,150 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="living">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Use _Living as first name</property>
<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">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkDrawingArea" id="drawingarea1">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">shrink|fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="images">
<widget class="GtkOptionMenu" id="encoding">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Reference images from path: </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<property name="history">0</property>
<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>
<child>
<widget class="GtkMenu" id="menu2">
<child>
<widget class="GtkMenuItem" id="ansel">
<property name="visible">True</property>
<property name="label" translatable="yes">_ANSEL</property>
<property name="use_underline">True</property>
<signal name="activate" handler="ansel" last_modification_time="Mon, 12 Jul 2004 20:33:33 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="unicode">
<property name="visible">True</property>
<property name="label" translatable="yes">_UNICODE</property>
<property name="use_underline">True</property>
<signal name="activate" handler="unicode" last_modification_time="Mon, 12 Jul 2004 20:36:01 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="ansi">
<property name="visible">True</property>
<property name="label" translatable="yes">AN_SI (ISO-8859-1)</property>
<property name="use_underline">True</property>
<signal name="activate" handler="ansi" last_modification_time="Mon, 12 Jul 2004 20:36:01 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</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>
<child>
<widget class="GtkRadioButton" id="ansi">
<property name="border_width">2</property>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">AN_SI (ISO-8859-1)</property>
<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>
<property name="group">ansel</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkCheckButton" id="images">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">R_eference images from path: </property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<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">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Filter:</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>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>