Collect more information at startup
svn: r738
This commit is contained in:
parent
41eea1db48
commit
bcc4f65f61
@ -70,13 +70,8 @@ pycode_tgts = [('url', 0, 0),
|
||||
#-------------------------------------------------------------------------
|
||||
class EditPerson:
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# __init__ - Creates an edit window. Associates a person with the
|
||||
# window.
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def __init__(self,person,db,callback=None):
|
||||
"""Creates an edit window. Associates a person with the window."""
|
||||
self.person = person
|
||||
self.db = db
|
||||
self.callback = callback
|
||||
@ -573,18 +568,14 @@ class EditPerson:
|
||||
"""redraws the address list for the person"""
|
||||
utils.redraw_list(self.plist,self.addr_list,disp_addr)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# redraw_event_list - Update both the birth and death place combo
|
||||
# boxes for any changes that occurred in the 'Event Edit' window.
|
||||
# Make sure not to allow the editing of a birth event to change
|
||||
# any values in the death event, and vice versa. Since updating a
|
||||
# combo list resets its present value, this code will have to save
|
||||
# and restore the value for the event *not* being edited.
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def redraw_event_list(self):
|
||||
"""redraws the event list for the person"""
|
||||
"""redraw_event_list - Update both the birth and death place combo
|
||||
boxes for any changes that occurred in the 'Event Edit' window.
|
||||
Make sure not to allow the editing of a birth event to change
|
||||
any values in the death event, and vice versa. Since updating a
|
||||
combo list resets its present value, this code will have to save
|
||||
and restore the value for the event *not* being edited."""
|
||||
|
||||
utils.redraw_list(self.elist,self.event_list,disp_event)
|
||||
|
||||
# Remember old combo list input
|
||||
@ -651,10 +642,13 @@ class EditPerson:
|
||||
"""Brings up the EventEditor for a new event"""
|
||||
import EventEdit
|
||||
pname = self.person.getPrimaryName().getName()
|
||||
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,None,None,0)
|
||||
EventEdit.EventEditor(self,pname,const.personalEvents,
|
||||
const.save_fevent,None,None,0)
|
||||
|
||||
def on_edit_birth_clicked(self,obj):
|
||||
"""Brings up the EventEditor for the birth record, event name cannot be changed"""
|
||||
"""Brings up the EventEditor for the birth record, event
|
||||
name cannot be changed"""
|
||||
|
||||
import EventEdit
|
||||
self.update_birth = 1
|
||||
pname = self.person.getPrimaryName().getName()
|
||||
@ -666,11 +660,13 @@ class EditPerson:
|
||||
def_placename = None
|
||||
else:
|
||||
def_placename = self.bpcombo.entry.get_text()
|
||||
EventEdit.EventEditor(self,pname,const.personalEvents,\
|
||||
EventEdit.EventEditor(self,pname,const.personalEvents,
|
||||
const.save_fevent,event,def_placename,1)
|
||||
|
||||
def on_edit_death_clicked(self,obj):
|
||||
"""Brings up the EventEditor for the death record, event name cannot be changed"""
|
||||
"""Brings up the EventEditor for the death record, event
|
||||
name cannot be changed"""
|
||||
|
||||
import EventEdit
|
||||
self.update_death = 1
|
||||
pname = self.person.getPrimaryName().getName()
|
||||
|
@ -388,10 +388,19 @@ def disp_url(url):
|
||||
def disp_loc(loc):
|
||||
return [loc.get_city(),loc.get_county(),loc.get_state(),loc.get_country()]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def src_changed(parent):
|
||||
parent.lists_changed = 1
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DeletePlaceQuery:
|
||||
|
||||
def __init__(self,place,db,update):
|
||||
|
@ -135,11 +135,13 @@ class EditSource:
|
||||
f = p.getFather()
|
||||
m = p.getMother()
|
||||
if f and m:
|
||||
name = _("%s and %s") % (Config.nameof(f),Config.nameof(m))
|
||||
name = _("%(father)s and %(mother)s") % {
|
||||
"father" : Config.nameof(f),
|
||||
"mother" : Config.nameof(m)}
|
||||
elif f:
|
||||
name = "%s" % Config.nameof(f)
|
||||
name = Config.nameof(f)
|
||||
else:
|
||||
name = "%s" % Config.nameof(m)
|
||||
name = Config.nameof(m)
|
||||
for v in p.getEventList():
|
||||
for sref in v.getSourceRefList():
|
||||
if sref.getBase() == self.source:
|
||||
|
@ -31,33 +31,43 @@ class StartupDialog:
|
||||
|
||||
self.druid = libglade.GladeXML(const.configFile,"initDruid")
|
||||
self.druid.signal_autoconnect({
|
||||
"destroy_passed_object" : self.on_cancel_clicked,
|
||||
"on_initDruid_finish" : self.on_finish
|
||||
"on_cancel_clicked" : self.on_cancel_clicked,
|
||||
"destroy_event": self.destroy,
|
||||
"on_finish" : self.on_finish
|
||||
})
|
||||
|
||||
self.rlist = ['name','addr','city','state','country',
|
||||
'postal', 'phone', 'email']
|
||||
|
||||
for tag in self.rlist:
|
||||
val = gnome.config.get_string("/gramps/researcher/%s" % tag)
|
||||
if val != None:
|
||||
self.druid.get_widget(tag).set_text(val)
|
||||
|
||||
def destroy(self,obj):
|
||||
self.task(self.arg)
|
||||
|
||||
def on_finish(self,obj,b):
|
||||
for tag in self.rlist:
|
||||
val = self.druid.get_widget(tag).get_text()
|
||||
gnome.config.set_string("/gramps/researcher/%s" % tag,val)
|
||||
|
||||
if self.druid.get_widget("num_us").get_active():
|
||||
dateFormat = 0
|
||||
elif self.druid.get_widget("num_eu").get_active():
|
||||
dateFormat = 1
|
||||
else:
|
||||
dateFormat = 2
|
||||
gnome.config.set_int("/gramps/config/dateEntry",dateFormat)
|
||||
|
||||
showcal = self.druid.get_widget("altcal").get_active()
|
||||
gnome.config.set_int("/gramps/config/ShowCalendar",showcal)
|
||||
|
||||
lds = self.druid.get_widget("enable_lds").get_active()
|
||||
gnome.config.set_int("/gramps/config/UseLDS",lds)
|
||||
|
||||
name = self.druid.get_widget("dresname").get_text()
|
||||
addr = self.druid.get_widget("dresaddr").get_text()
|
||||
city = self.druid.get_widget("drescity").get_text()
|
||||
state = self.druid.get_widget("dresstate").get_text()
|
||||
country = self.druid.get_widget("drescountry").get_text()
|
||||
postal = self.druid.get_widget("drespostal").get_text()
|
||||
phone = self.druid.get_widget("dresphone").get_text()
|
||||
email = self.druid.get_widget("dresemail").get_text()
|
||||
|
||||
gnome.config.set_string("/gramps/researcher/name",name)
|
||||
gnome.config.set_string("/gramps/researcher/addr",addr)
|
||||
gnome.config.set_string("/gramps/researcher/city",city)
|
||||
gnome.config.set_string("/gramps/researcher/state",state)
|
||||
gnome.config.set_string("/gramps/researcher/country",country)
|
||||
gnome.config.set_string("/gramps/researcher/postal",postal)
|
||||
gnome.config.set_string("/gramps/researcher/phone",phone)
|
||||
gnome.config.set_string("/gramps/researcher/email",email)
|
||||
gnome.config.sync()
|
||||
utils.destroy_passed_object(obj)
|
||||
self.task(self.arg)
|
||||
|
||||
def on_cancel_clicked(self,obj,a):
|
||||
self.task(self.arg)
|
||||
def on_cancel_clicked(self,obj):
|
||||
utils.destroy_passed_object(obj)
|
||||
|
362
src/config.glade
362
src/config.glade
@ -28,20 +28,20 @@
|
||||
<name>druid1</name>
|
||||
<signal>
|
||||
<name>cancel</name>
|
||||
<handler>destroy_passed_object</handler>
|
||||
<handler>on_cancel_clicked</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Sat, 17 Mar 2001 16:14:12 GMT</last_modification_time>
|
||||
<last_modification_time>Thu, 31 Jan 2002 03:26:17 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>destroy</name>
|
||||
<handler>destroy_event</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Thu, 31 Jan 2002 03:41:51 GMT</last_modification_time>
|
||||
</signal>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDruidPageStart</class>
|
||||
<name>druidpagestart1</name>
|
||||
<signal>
|
||||
<name>cancel</name>
|
||||
<handler>destroy_passed_object</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Sat, 23 Dec 2000 22:53:01 GMT</last_modification_time>
|
||||
</signal>
|
||||
<title>Getting Started</title>
|
||||
<text>Welcome to Gramps, the Genealogical Research
|
||||
and Analysis Management Programming System.
|
||||
@ -65,12 +65,6 @@ information.</text>
|
||||
<widget>
|
||||
<class>GnomeDruidPageStandard</class>
|
||||
<name>druidpagestandard1</name>
|
||||
<signal>
|
||||
<name>cancel</name>
|
||||
<handler>destroy_passed_object</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Sat, 23 Dec 2000 22:54:10 GMT</last_modification_time>
|
||||
</signal>
|
||||
<title>Researcher Information</title>
|
||||
<title_color>125,104,74</title_color>
|
||||
<background_color>225,220,197</background_color>
|
||||
@ -342,7 +336,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>dresname</name>
|
||||
<name>name</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -371,7 +365,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>dresaddr</name>
|
||||
<name>addr</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -400,7 +394,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>drescity</name>
|
||||
<name>city</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -429,7 +423,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>dresstate</name>
|
||||
<name>state</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -458,7 +452,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>drescountry</name>
|
||||
<name>country</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -487,7 +481,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>drespostal</name>
|
||||
<name>postal</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -516,7 +510,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>dresphone</name>
|
||||
<name>phone</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -545,7 +539,7 @@ anytime in the program's preference settings</label>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>dresemail</name>
|
||||
<name>email</name>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>changed</name>
|
||||
@ -576,20 +570,328 @@ anytime in the program's preference settings</label>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDruidPageStandard</class>
|
||||
<name>druidpagestandard3</name>
|
||||
<title>Numerical Date Formats</title>
|
||||
<title_color>125,104,74</title_color>
|
||||
<background_color>225,220,197</background_color>
|
||||
<logo_background_color>225,220,197</logo_background_color>
|
||||
<logo_image>gramps.png</logo_image>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>druid-vbox3</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox25</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label143</name>
|
||||
<label>There are three common formats for entering dates in a numerical format.
|
||||
Without some type of indication, GRAMPS cannot correctly tell what
|
||||
format you are using. Please indicate your preferred format for entering
|
||||
numerical dates</label>
|
||||
<justify>GTK_JUSTIFY_LEFT</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>5</xpad>
|
||||
<ypad>25</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox2</name>
|
||||
<homogeneous>True</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox26</name>
|
||||
<border_width>20</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioButton</class>
|
||||
<name>num_us</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>MM/DD/YYYY (United States)</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<group>numdate</group>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioButton</class>
|
||||
<name>num_eu</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>DD/MM/YYYY (European)</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<group>numdate</group>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioButton</class>
|
||||
<name>num_iso</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>YYYY-MM-DD (ISO)</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<group>numdate</group>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDruidPageStandard</class>
|
||||
<name>druidpagestandard4</name>
|
||||
<title>Alternate Calendar Support</title>
|
||||
<title_color>125,104,74</title_color>
|
||||
<background_color>225,220,197</background_color>
|
||||
<logo_background_color>225,220,197</logo_background_color>
|
||||
<logo_image>gramps.png</logo_image>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>druid-vbox4</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox27</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label144</name>
|
||||
<label>By default, all dates stored by GRAMPS use the Gregorian calendar. This
|
||||
is normally sufficient for most users. Support may be enabled for the Julian,
|
||||
French Republican, and Hebrew calendar. If believe you will need one or
|
||||
more of these alternate calendars, enable alternate calendar support.</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>25</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox3</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>altcal</name>
|
||||
<border_width>20</border_width>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Enable support for alternate calendars</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDruidPageStandard</class>
|
||||
<name>druidpagestandard2</name>
|
||||
<title>LDS Extensions</title>
|
||||
<title_color>125,104,74</title_color>
|
||||
<background_color>225,220,197</background_color>
|
||||
<logo_background_color>225,220,197</logo_background_color>
|
||||
<logo_image>gramps.png</logo_image>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>druid-vbox2</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox24</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label142</name>
|
||||
<label>GRAMPS has support for LDS Ordinances, which are special
|
||||
event types related to the Church of Jesus Christ of Latter Day Saints.
|
||||
|
||||
You may choose to either enable or disable this support. You may
|
||||
change this option in the future in the Preferences dialog.</label>
|
||||
<justify>GTK_JUSTIFY_FILL</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>5</xpad>
|
||||
<ypad>25</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>enable_lds</name>
|
||||
<border_width>20</border_width>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Enable LDS Ordinance Support</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>50</padding>
|
||||
<expand>True</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GnomeDruidPageFinish</class>
|
||||
<name>druidpagefinish1</name>
|
||||
<signal>
|
||||
<name>cancel</name>
|
||||
<handler>destroy_passed_object</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Sat, 23 Dec 2000 22:52:41 GMT</last_modification_time>
|
||||
</signal>
|
||||
<signal>
|
||||
<name>finish</name>
|
||||
<handler>on_initDruid_finish</handler>
|
||||
<handler>on_finish</handler>
|
||||
<object>initDruid</object>
|
||||
<last_modification_time>Sun, 24 Dec 2000 00:38:03 GMT</last_modification_time>
|
||||
<last_modification_time>Thu, 31 Jan 2002 03:15:53 GMT</last_modification_time>
|
||||
</signal>
|
||||
<title>Complete</title>
|
||||
<text>GRAMPS is an Open Source project. Its success
|
||||
|
@ -85,7 +85,7 @@ gtkrcFile = "%s/gtkrc" % rootDir
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
progName = "gramps"
|
||||
version = "0.7.1"
|
||||
version = "0.7.2pre"
|
||||
copyright = "© 2001 Donald N. Allingham"
|
||||
authors = ["Donald N. Allingham", "David Hampton"]
|
||||
comments = _("Gramps (Genealogical Research and Analysis Management Programming System) is a personal genealogy program.")
|
||||
|
@ -18,11 +18,21 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# gramps modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from TextDoc import *
|
||||
import Plugins
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# ReportLab python/PDF modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import reportlab.platypus.tables
|
||||
from reportlab.platypus import *
|
||||
from reportlab.lib.units import cm
|
||||
@ -30,8 +40,11 @@ from reportlab.lib.colors import Color
|
||||
from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
|
||||
import reportlab.lib.styles
|
||||
|
||||
from latin_utf8 import latin_to_utf8
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Attempt to load the python imaging library
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
try:
|
||||
import PIL.Image
|
||||
no_pil = 0
|
||||
@ -40,24 +53,18 @@ except:
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
# GrampsDocTemplate
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class GrampsDocTemplate(BaseDocTemplate):
|
||||
|
||||
"""A document template for the ReportLab routines."""
|
||||
|
||||
def build(self,flowables):
|
||||
self._calc() #in case we changed margins sizes etc
|
||||
"""Override the default build routine, to recalculate
|
||||
for any changes in the document (margins, etc.)"""
|
||||
self._calc()
|
||||
BaseDocTemplate.build(self,flowables)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def make_color(color):
|
||||
return Color(float(color[0])/255.0, float(color[1])/255.0,
|
||||
float(color[2])/255.0)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -67,7 +74,7 @@ class PdfDoc(TextDoc):
|
||||
|
||||
def open(self,filename):
|
||||
if filename[-4:] != ".pdf":
|
||||
self.filename = filename + ".pdf"
|
||||
self.filename = "%s.pdf" % filename
|
||||
else:
|
||||
self.filename = filename
|
||||
|
||||
@ -82,8 +89,8 @@ class PdfDoc(TextDoc):
|
||||
topMargin=self.tmargin*cm,
|
||||
bottomMargin=self.bmargin*cm)
|
||||
frameT = Frame(0,0,self.width*cm,self.height*cm,
|
||||
self.lmargin*cm, self.bmargin*cm, \
|
||||
self.rmargin*cm,self.tmargin*cm,\
|
||||
self.lmargin*cm, self.bmargin*cm,
|
||||
self.rmargin*cm,self.tmargin*cm,
|
||||
id='normal')
|
||||
ptemp = PageTemplate(frames=frameT,pagesize=self.pagesize)
|
||||
self.doc.addPageTemplates([ptemp])
|
||||
@ -215,7 +222,6 @@ class PdfDoc(TextDoc):
|
||||
|
||||
def end_cell(self):
|
||||
if self.span == 1:
|
||||
# self.cur_row.append(self.text)
|
||||
self.cur_row.append(Paragraph(self.text,self.current_para))
|
||||
else:
|
||||
self.cur_row.append(self.text)
|
||||
@ -281,4 +287,25 @@ class PdfDoc(TextDoc):
|
||||
def write_text(self,text):
|
||||
self.text = self.text + text
|
||||
|
||||
Plugins.register_text_doc(_("PDF"),PdfDoc,1,1,1)
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Convert an RGB color tulple to a Color instance
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def make_color(color):
|
||||
return Color(float(color[0])/255.0, float(color[1])/255.0,
|
||||
float(color[2])/255.0)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register the document generator with the GRAMPS plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
Plugins.register_text_doc(
|
||||
name=_("PDF"),
|
||||
classref=PdfDoc,
|
||||
table=1,
|
||||
paper=1,
|
||||
style=1
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user