diff --git a/src/EditPerson.py b/src/EditPerson.py index 423ed8af5..7ad5ff573 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -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() diff --git a/src/EditPlace.py b/src/EditPlace.py index 698c7e36a..ad1eea553 100644 --- a/src/EditPlace.py +++ b/src/EditPlace.py @@ -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): diff --git a/src/EditSource.py b/src/EditSource.py index 761fc4a0b..cafe5f824 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -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: diff --git a/src/StartupDialog.py b/src/StartupDialog.py index 1e1cab870..1c56b1fe6 100644 --- a/src/StartupDialog.py +++ b/src/StartupDialog.py @@ -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) diff --git a/src/config.glade b/src/config.glade index 825f89efe..3ea61d73c 100644 --- a/src/config.glade +++ b/src/config.glade @@ -28,20 +28,20 @@ druid1 cancel - destroy_passed_object + on_cancel_clicked initDruid - Sat, 17 Mar 2001 16:14:12 GMT + Thu, 31 Jan 2002 03:26:17 GMT + + + destroy + destroy_event + initDruid + Thu, 31 Jan 2002 03:41:51 GMT GnomeDruidPageStart druidpagestart1 - - cancel - destroy_passed_object - initDruid - Sat, 23 Dec 2000 22:53:01 GMT - Getting Started Welcome to Gramps, the Genealogical Research and Analysis Management Programming System. @@ -65,12 +65,6 @@ information. GnomeDruidPageStandard druidpagestandard1 - - cancel - destroy_passed_object - initDruid - Sat, 23 Dec 2000 22:54:10 GMT - Researcher Information 125,104,74 225,220,197 @@ -342,7 +336,7 @@ anytime in the program's preference settings GtkEntry - dresname + name True changed @@ -371,7 +365,7 @@ anytime in the program's preference settings GtkEntry - dresaddr + addr True changed @@ -400,7 +394,7 @@ anytime in the program's preference settings GtkEntry - drescity + city True changed @@ -429,7 +423,7 @@ anytime in the program's preference settings GtkEntry - dresstate + state True changed @@ -458,7 +452,7 @@ anytime in the program's preference settings GtkEntry - drescountry + country True changed @@ -487,7 +481,7 @@ anytime in the program's preference settings GtkEntry - drespostal + postal True changed @@ -516,7 +510,7 @@ anytime in the program's preference settings GtkEntry - dresphone + phone True changed @@ -545,7 +539,7 @@ anytime in the program's preference settings GtkEntry - dresemail + email True changed @@ -576,20 +570,328 @@ anytime in the program's preference settings + + GnomeDruidPageStandard + druidpagestandard3 + Numerical Date Formats + 125,104,74 + 225,220,197 + 225,220,197 + gramps.png + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox3 + False + 0 + + 0 + True + True + + + + GtkVBox + vbox25 + False + 0 + + 0 + True + True + + + + GtkLabel + label143 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 5 + 25 + + 0 + False + False + + + + + GtkHBox + hbox2 + True + 0 + + 0 + True + True + + + + Placeholder + + + + GtkVBox + vbox26 + 20 + False + 0 + + 0 + False + False + + + + GtkRadioButton + num_us + True + + False + True + numdate + + 0 + False + False + + + + + GtkRadioButton + num_eu + True + + False + True + numdate + + 0 + False + False + + + + + GtkRadioButton + num_iso + True + + False + True + numdate + + 0 + False + False + + + + + + Placeholder + + + + + + + + GnomeDruidPageStandard + druidpagestandard4 + Alternate Calendar Support + 125,104,74 + 225,220,197 + 225,220,197 + gramps.png + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox4 + False + 0 + + 0 + True + True + + + + GtkVBox + vbox27 + False + 0 + + 0 + True + True + + + + GtkLabel + label144 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 25 + + 0 + False + False + + + + + GtkHBox + hbox3 + False + 0 + + 0 + False + False + + + + Placeholder + + + + GtkCheckButton + altcal + 20 + True + + False + True + + 0 + True + False + + + + + Placeholder + + + + + + + + GnomeDruidPageStandard + druidpagestandard2 + LDS Extensions + 125,104,74 + 225,220,197 + 225,220,197 + gramps.png + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox2 + False + 0 + + 0 + True + True + + + + GtkVBox + vbox24 + False + 0 + + 0 + True + True + + + + GtkLabel + label142 + + GTK_JUSTIFY_FILL + False + 0.5 + 0.5 + 5 + 25 + + 0 + False + False + + + + + GtkHBox + hbox1 + False + 0 + + 0 + False + False + + + + Placeholder + + + + GtkCheckButton + enable_lds + 20 + True + + False + True + + 50 + True + False + + + + + Placeholder + + + + + + GnomeDruidPageFinish druidpagefinish1 - - cancel - destroy_passed_object - initDruid - Sat, 23 Dec 2000 22:52:41 GMT - finish - on_initDruid_finish + on_finish initDruid - Sun, 24 Dec 2000 00:38:03 GMT + Thu, 31 Jan 2002 03:15:53 GMT Complete GRAMPS is an Open Source project. Its success diff --git a/src/const.py b/src/const.py index 0433f1946..fed557c6b 100644 --- a/src/const.py +++ b/src/const.py @@ -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.") diff --git a/src/docgen/PdfDoc.py b/src/docgen/PdfDoc.py index bde2e4733..244a80ba8 100644 --- a/src/docgen/PdfDoc.py +++ b/src/docgen/PdfDoc.py @@ -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 + )