Option to include link back to index page

svn: r216
This commit is contained in:
Don Allingham 2001-07-01 22:30:45 +00:00
parent 2f830552a3
commit 9deaabe5ea
2 changed files with 39 additions and 2 deletions

View File

@ -81,13 +81,14 @@ class IndividualPage:
#
#
#--------------------------------------------------------------------
def __init__(self,person,photos,restrict,list,dir_name,doc):
def __init__(self,person,photos,restrict,link,list,dir_name,doc):
self.person = person
self.doc = doc
self.list = list
self.alive = probably_alive(person) or restrict
self.photos = (photos == 2) or (photos == 1 and not self.alive)
self.dir = dir_name
self.link = link
tbl = TableStyle()
tbl.set_width(100)
@ -201,6 +202,13 @@ class IndividualPage:
self.write_facts()
self.write_families()
if self.link:
self.doc.start_paragraph("Normal")
self.doc.start_link("index.html")
self.doc.write_text(_("Return to the index of people"))
self.doc.end_link()
self.doc.end_paragraph()
#--------------------------------------------------------------------
#
#
@ -586,6 +594,7 @@ def on_ok_clicked(obj):
restrict = topDialog.get_widget("restrict").get_active()
restrict_photos = topDialog.get_widget("restrict_photos").get_active()
no_photos = topDialog.get_widget("nophotos").get_active()
include_link = topDialog.get_widget("include_link").get_active()
if dir_name == None:
dir_name = os.getcwd()
@ -622,7 +631,8 @@ def on_ok_clicked(obj):
for person in ind_list:
doc = HtmlLinkDoc(styles,templ_name)
idoc = IndividualPage(person,photos,restrict,ind_list,dir_name,doc)
idoc = IndividualPage(person,photos,restrict,include_link, \
ind_list,dir_name,doc)
idoc.create_page()
idoc.close()

View File

@ -379,6 +379,30 @@
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame3</name>
<border_width>10</border_width>
<label>Options</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCheckButton</class>
<name>include_link</name>
<border_width>3</border_width>
<can_focus>True</can_focus>
<label>Include a link to the index page</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>options</name>
@ -401,6 +425,7 @@
<widget>
<class>GtkCheckButton</class>
<name>restrict</name>
<border_width>3</border_width>
<can_focus>True</can_focus>
<label>Restrict information on living people</label>
<active>True</active>
@ -415,6 +440,7 @@
<widget>
<class>GtkCheckButton</class>
<name>nophotos</name>
<border_width>3</border_width>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
@ -434,6 +460,7 @@
<widget>
<class>GtkCheckButton</class>
<name>restrict_photos</name>
<border_width>3</border_width>
<can_focus>True</can_focus>
<label>Do not use photographs for living people</label>
<active>False</active>