Added support for marriage types, along with more translation information

svn: r60
This commit is contained in:
Don Allingham 2001-05-25 02:37:40 +00:00
parent f55040fea3
commit 0ce5ae5ff4
21 changed files with 2116 additions and 509 deletions

View File

@ -89,6 +89,8 @@ usetabs = 0
hide_altnames = 0 hide_altnames = 0
lastfile = None lastfile = None
nameof = utils.normal_name nameof = utils.normal_name
display_attr = 0
attr_name = ""
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -132,6 +134,8 @@ def loadConfig(call):
global hide_altnames global hide_altnames
global lastfile global lastfile
global nameof global nameof
global display_attr
global attr_name
global _druid global _druid
global _name_format global _name_format
global _callback global _callback
@ -139,6 +143,9 @@ def loadConfig(call):
_callback = call _callback = call
lastfile = gnome.config.get_string("/gramps/data/LastFile") lastfile = gnome.config.get_string("/gramps/data/LastFile")
usetabs = gnome.config.get_bool("/gramps/config/UseTabs") usetabs = gnome.config.get_bool("/gramps/config/UseTabs")
display_attr = gnome.config.get_bool("/gramps/config/DisplayAttr")
attr_name = gnome.config.get_string("/gramps/config/DisplayAttrName")
hide_altnames = gnome.config.get_bool("/gramps/config/DisplayAltNames") hide_altnames = gnome.config.get_bool("/gramps/config/DisplayAltNames")
autoload = gnome.config.get_bool("/gramps/config/autoLoad") autoload = gnome.config.get_bool("/gramps/config/autoLoad")
dateFormat = gnome.config.get_int("/gramps/config/dateFormat") dateFormat = gnome.config.get_int("/gramps/config/dateFormat")
@ -163,6 +170,12 @@ def loadConfig(call):
ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0)) ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0))
ListColors.evenbg = get_config_color(EVENBGCOLOR,(0xffff,0xffff,0xffff)) ListColors.evenbg = get_config_color(EVENBGCOLOR,(0xffff,0xffff,0xffff))
if display_attr == None:
display_attr = 0
if attr_name == None:
attr_name = ""
if autoload == None: if autoload == None:
autoload = 1 autoload = 1
if usetabs == None: if usetabs == None:
@ -252,16 +265,22 @@ def on_propertybox_apply(obj,page):
global nameof global nameof
global owner global owner
global usetabs global usetabs
global display_attr
global attr_name
global hide_altnames global hide_altnames
if page != -1: if page != -1:
return return
autoload = prefsTop.get_widget("autoload").get_active() autoload = prefsTop.get_widget("autoload").get_active()
display_attr = prefsTop.get_widget("attr_display").get_active()
attr_name = string.strip(prefsTop.get_widget("attr_name").get_text())
usetabs = prefsTop.get_widget("usetabs").get_active() usetabs = prefsTop.get_widget("usetabs").get_active()
hide_altnames = prefsTop.get_widget("display_altnames").get_active() hide_altnames = prefsTop.get_widget("display_altnames").get_active()
gnome.config.set_bool("/gramps/config/UseTabs",usetabs) gnome.config.set_bool("/gramps/config/UseTabs",usetabs)
gnome.config.set_bool("/gramps/config/DisplayAttr",display_attr)
gnome.config.set_string("/gramps/config/DisplayAttrName",attr_name)
gnome.config.set_bool("/gramps/config/autoLoad",autoload) gnome.config.set_bool("/gramps/config/autoLoad",autoload)
gnome.config.set_bool("/gramps/config/DisplayAltNames",hide_altnames) gnome.config.set_bool("/gramps/config/DisplayAltNames",hide_altnames)
@ -389,9 +408,14 @@ def display_preferences_box():
pbox = prefsTop.get_widget("propertybox") pbox = prefsTop.get_widget("propertybox")
auto = prefsTop.get_widget("autoload") auto = prefsTop.get_widget("autoload")
tabs = prefsTop.get_widget("usetabs") tabs = prefsTop.get_widget("usetabs")
display_attr_obj = prefsTop.get_widget("attr_display")
display_altnames = prefsTop.get_widget("display_altnames") display_altnames = prefsTop.get_widget("display_altnames")
auto.set_active(autoload) auto.set_active(autoload)
tabs.set_active(usetabs) tabs.set_active(usetabs)
display_attr_obj.set_active(display_attr)
prefsTop.get_widget("attr_name").set_text(attr_name)
display_altnames.set_active(hide_altnames) display_altnames.set_active(hide_altnames)
date_option = prefsTop.get_widget("date_format") date_option = prefsTop.get_widget("date_format")

View File

@ -80,7 +80,7 @@
<widget> <widget>
<class>GtkTable</class> <class>GtkTable</class>
<name>table14</name> <name>table14</name>
<rows>3</rows> <rows>4</rows>
<columns>2</columns> <columns>2</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
@ -100,8 +100,8 @@
<child> <child>
<left_attach>0</left_attach> <left_attach>0</left_attach>
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>2</top_attach> <top_attach>3</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>4</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -176,6 +176,7 @@
<widget> <widget>
<class>GtkEntry</class> <class>GtkEntry</class>
<name>birthDate</name> <name>birthDate</name>
<width>250</width>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
@ -232,8 +233,8 @@
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>2</top_attach> <top_attach>3</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>4</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
@ -308,6 +309,7 @@
<widget> <widget>
<class>GtkEntry</class> <class>GtkEntry</class>
<name>deathDate</name> <name>deathDate</name>
<width>250</width>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
@ -356,35 +358,6 @@
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>
<label>Photo</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GnomePixmap</class>
<name>personPix</name>
<width>200</width>
<height>200</height>
</widget>
</widget>
<widget> <widget>
<class>GtkFrame</class> <class>GtkFrame</class>
<name>frame2</name> <name>frame2</name>
@ -737,6 +710,169 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>
<label>Photo</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GnomePixmap</class>
<name>personPix</name>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame6</name>
<label>Indentification</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkTable</class>
<name>table18</name>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkLabel</class>
<name>gid</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>user_data</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label152</name>
<label>gramps ID : </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>user_label</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
</widget> </widget>
</widget> </widget>

View File

@ -174,6 +174,20 @@ class EditPerson:
birth = person.getBirth() birth = person.getBirth()
death = person.getDeath() death = person.getDeath()
self.get_widget("gid").set_text(str(person.getId()))
if Config.display_attr:
self.get_widget("user_label").set_text("%s : " % Config.attr_name)
val = ""
for attr in self.person.getAttributeList():
if attr.getType() == Config.attr_name:
val = attr.getValue()
break
self.get_widget("user_data").set_text(val)
else:
self.get_widget("user_label").hide()
self.get_widget("user_data").hide()
# initial values # initial values
self.get_widget("activepersonTitle").set_text(Config.nameof(person)) self.get_widget("activepersonTitle").set_text(Config.nameof(person))
self.suffix.set_text(name.getSuffix()) self.suffix.set_text(name.getSuffix())
@ -1015,7 +1029,7 @@ def on_apply_person_clicked(obj):
if error == 1: if error == 1:
msg = _("Changing the gender caused problems with marriage information.") msg = _("Changing the gender caused problems with marriage information.")
msg2 = _("Please check the person's marriages.") msg2 = _("Please check the person's marriages.")
GnomeErrorDialog(msg + msg2) GnomeErrorDialog(msg + '\n' + msg2)
text = edit_person_obj.notes_field.get_chars(0,-1) text = edit_person_obj.notes_field.get_chars(0,-1)
if text != person.getNote(): if text != person.getNote():

View File

@ -269,6 +269,8 @@ class GrampsParser(handler.ContentHandler):
self.family = self.db.findFamily(attrs["id"],self.fmap) self.family = self.db.findFamily(attrs["id"],self.fmap)
else: else:
self.family = self.db.findFamilyNoMap(attrs["id"]) self.family = self.db.findFamilyNoMap(attrs["id"])
if attrs.has_key("type"):
self.family.setRelationship(attrs["type"])
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #

View File

@ -84,6 +84,7 @@ class Marriage:
"on_photolist_button_press_event" : on_photolist_button_press_event, "on_photolist_button_press_event" : on_photolist_button_press_event,
"on_addphoto_clicked" : on_add_photo_clicked, "on_addphoto_clicked" : on_add_photo_clicked,
"on_deletephoto_clicked" : on_delete_photo_clicked, "on_deletephoto_clicked" : on_delete_photo_clicked,
"on_close_marriage_editor" : on_close_marriage_editor,
"destroy_passed_object" : utils.destroy_passed_object "destroy_passed_object" : utils.destroy_passed_object
}) })
@ -100,18 +101,28 @@ class Marriage:
self.place_field = self.get_widget("marriagePlace") self.place_field = self.get_widget("marriagePlace")
self.name_field = self.get_widget("marriageEventName") self.name_field = self.get_widget("marriageEventName")
self.descr_field = self.get_widget("marriageDescription") self.descr_field = self.get_widget("marriageDescription")
self.type_field = self.get_widget("marriage_type")
self.notes_field = self.get_widget("marriageNotes")
# set initial data # set initial data
mevent_list = self.get_widget("marriageEvent") mevent_list = self.get_widget("marriageEvent")
mevent_list.set_popdown_strings(const.marriageEvents) mevent_list.set_popdown_strings(const.marriageEvents)
self.name_field.set_text("") self.name_field.set_text("")
self.load_images() self.load_images()
self.type_field.set_popdown_strings(const.familyRelations)
self.type_field.entry.set_text(family.getRelationship())
# stored object data # stored object data
top_window.set_data(MARRIAGE,self) top_window.set_data(MARRIAGE,self)
self.event_list.set_data(MARRIAGE,self) self.event_list.set_data(MARRIAGE,self)
self.event_list.set_data(INDEX,-1) self.event_list.set_data(INDEX,-1)
# set notes data
self.notes_field.set_point(0)
self.notes_field.insert_defaults(family.getNote())
self.notes_field.set_word_wrap(1)
self.redraw_events() self.redraw_events()
top_window.show() top_window.show()
@ -201,6 +212,26 @@ class Marriage:
def get_widget(self,name): def get_widget(self,name):
return self.top.get_widget(name) return self.top.get_widget(name)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_close_marriage_editor(obj):
family_obj = obj.get_data(MARRIAGE)
relation = family_obj.type_field.entry.get_text()
if relation != family_obj.family.getRelationship():
family_obj.family.setRelationship(relation)
utils.modified()
text = family_obj.notes_field.get_chars(0,-1)
if text != family_obj.family.getNote():
family_obj.family.setNote(text)
utils.modified()
utils.destroy_passed_object(family_obj.get_widget("marriageEditor"))
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# on_add_clicked - creates a new event from the data displayed in the # on_add_clicked - creates a new event from the data displayed in the

View File

@ -50,7 +50,8 @@ class OpenOfficeDoc(TextDoc):
def open(self,filename): def open(self,filename):
import time import time
print filename
t = time.localtime(time.time()) t = time.localtime(time.time())
self.time = "%04d-%02d-%02dT%02d:%02d:%02d" % \ self.time = "%04d-%02d-%02dT%02d:%02d:%02d" % \
(t[0],t[1],t[2],t[3],t[4],t[5]) (t[0],t[1],t[2],t[3],t[4],t[5])

View File

@ -22,23 +22,33 @@ from TextDoc import *
import reportlab.platypus.tables import reportlab.platypus.tables
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Image from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Image
from reportlab.rl_config import defaultPageSize
from reportlab.lib.units import cm from reportlab.lib.units import cm
from reportlab.lib.colors import Color from reportlab.lib.colors import Color
from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
import reportlab.lib.styles import reportlab.lib.styles
from latin_utf8 import latin_to_utf8
try: try:
import PIL.Image import PIL.Image
no_pil = 0 no_pil = 0
except: except:
no_pil = 1 no_pil = 1
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def page_def(canvas,doc): def page_def(canvas,doc):
canvas.saveState() canvas.saveState()
canvas.restoreState() canvas.restoreState()
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def make_color(color): def make_color(color):
return Color(float(color[0])/255.0, float(color[1])/255.0, return Color(float(color[0])/255.0, float(color[1])/255.0,
float(color[2])/255.0) float(color[2])/255.0)
@ -112,6 +122,7 @@ class PdfDoc(TextDoc):
def end_paragraph(self): def end_paragraph(self):
if self.in_table == 0 and self.image == 0: if self.in_table == 0 and self.image == 0:
print self.text
self.story.append(Paragraph(self.text,self.current_para)) self.story.append(Paragraph(self.text,self.current_para))
self.story.append(Spacer(1,0.25*cm)) self.story.append(Spacer(1,0.25*cm))
else: else:
@ -220,5 +231,5 @@ class PdfDoc(TextDoc):
pass pass
def write_text(self,text): def write_text(self,text):
self.text = self.text + text self.text = self.text + text

View File

@ -179,12 +179,6 @@ class Name:
else: else:
return "%s %s, %s" % (self.FirstName, self.Surname, self.Suffix) return "%s %s, %s" % (self.FirstName, self.Surname, self.Suffix)
def getNote(self):
return self.note
def setNote(self,text):
self.note = text
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -458,9 +452,17 @@ class Family:
self.Children = [] self.Children = []
self.Marriage = None self.Marriage = None
self.Divorce = None self.Divorce = None
self.type = ""
self.EventList = [] self.EventList = []
self.id = -1 self.id = -1
self.photoList = [] self.photoList = []
self.note = ""
def getNote(self):
return self.note
def setNote(self,text):
self.note = text
def setId(self,id) : def setId(self,id) :
self.id = id self.id = id
@ -468,6 +470,12 @@ class Family:
def getId(self) : def getId(self) :
return self.id return self.id
def setRelationship(self,type):
self.type = type
def getRelationship(self):
return self.type
def setFather(self,person): def setFather(self,person):
self.Father = person self.Father = person
@ -691,6 +699,12 @@ class RelDataBase:
map[attr.getType()] = 1 map[attr.getType()] = 1
return map.keys() return map.keys()
def getFamilyRelationTypes(self):
map = {}
for family in self.familyMap.values():
map[family.getRelationship()] = 1
return map.keys()
def findPerson(self,idVal,map): def findPerson(self,idVal,map):
if map.has_key(idVal): if map.has_key(idVal):
person = self.personMap[map[idVal]] person = self.personMap[map[idVal]]

View File

@ -123,7 +123,7 @@ def dump_my_event(g,name,event):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def write_ref(g,label,person): def write_ref(g,label,person):
if person: if person:
g.write("<" + label + " ref=\"" + str(person.getId()) + "\"/>\n") g.write('<%s ref="%s"/>\n' % (label,str(person.getId())))
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -132,7 +132,20 @@ def write_ref(g,label,person):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def write_id(g,label,person): def write_id(g,label,person):
if person: if person:
g.write("<" + label + " id=\"" + str(person.getId()) + "\">\n") g.write('<%s id="%s">\n' % (label,str(person.getId())))
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def write_family_id(g,family):
if family:
rel = family.getRelationship()
if rel != "":
g.write('<family id="%s" type="%s">\n' % (str(family.getId()),rel))
else:
g.write('<family id="%s">\n' % str(family.getId()))
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -141,7 +154,7 @@ def write_id(g,label,person):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def write_line(g,label,value): def write_line(g,label,value):
if value: if value:
g.write("<" + label + ">" + fix(value) + "</" + label + ">\n") g.write('<%s>%s</%s>\n' % (label,fix(value),label))
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -149,12 +162,12 @@ def write_line(g,label,value):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def dump_name(g,label,name): def dump_name(g,label,name):
g.write("<" + label + ">\n") g.write('<%s>\n' % label)
write_line(g,"first",name.getFirstName()) write_line(g,"first",name.getFirstName())
write_line(g,"last",name.getSurname()) write_line(g,"last",name.getSurname())
write_line(g,"suffix",name.getSuffix()) write_line(g,"suffix",name.getSuffix())
write_line(g,"title",name.getTitle()) write_line(g,"title",name.getTitle())
g.write("</" + label + ">\n") g.write('</%s>\n' % label)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -289,7 +302,7 @@ def exportData(database, filename, callback):
callback(float(count)/float(total)) callback(float(count)/float(total))
count = count + 1 count = count + 1
write_id(g,"family",family) write_family_id(g,family)
write_ref(g,"father",family.getFather()) write_ref(g,"father",family.getFather())
write_ref(g,"mother",family.getMother()) write_ref(g,"mother",family.getMother())
@ -310,6 +323,7 @@ def exportData(database, filename, callback):
for person in family.getChildList(): for person in family.getChildList():
write_ref(g,"child",person) write_ref(g,"child",person)
g.write("</childlist>\n") g.write("</childlist>\n")
writeNote(g,"note",family.getNote())
g.write("</family>\n") g.write("</family>\n")
g.write("</families>\n") g.write("</families>\n")

View File

@ -54,12 +54,42 @@
<widget> <widget>
<class>GtkTable</class> <class>GtkTable</class>
<name>table13</name> <name>table13</name>
<rows>3</rows> <rows>5</rows>
<columns>1</columns> <columns>2</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
<column_spacing>0</column_spacing> <column_spacing>0</column_spacing>
<widget>
<class>GtkEntry</class>
<name>attr_name</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:30 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkCheckButton</class> <class>GtkCheckButton</class>
<name>usetabs</name> <name>usetabs</name>
@ -78,37 +108,8 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>1</top_attach> <top_attach>1</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>2</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>display_altnames</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Sun, 22 Apr 2001 21:20:17 GMT</last_modification_time>
</signal>
<label>Do not display alternate names in person list</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -136,8 +137,66 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>0</top_attach> <top_attach>0</top_attach>
<bottom_attach>1</bottom_attach> <bottom_attach>1</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>display_altnames</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Sun, 22 Apr 2001 21:20:17 GMT</last_modification_time>
</signal>
<label>Do not display alternate names in person list</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>attr_display</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:10 GMT</last_modification_time>
</signal>
<label>Display attribute on Edit Person form</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -1191,7 +1250,7 @@ information.</text>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label141</name> <name>label141</name>
<label>Please enter following information. You can change it at <label>Please enter the following information. You can change it at
anytime in the program's preference settings</label> anytime in the program's preference settings</label>
<justify>GTK_JUSTIFY_LEFT</justify> <justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap> <wrap>False</wrap>

View File

@ -86,7 +86,7 @@ useExceptions= 0
# Constants # Constants
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
picWidth = 200.0 picWidth = 275.0
thumbScale = 100.0 thumbScale = 100.0
indexFile = "data.gramps" indexFile = "data.gramps"
male = _("male") male = _("male")
@ -151,6 +151,13 @@ personalConstantAttributes = {
"Social Security Number": "SSN" "Social Security Number": "SSN"
} }
familyConstantRelations = [
"Married",
"Common Law",
"Partners",
"Unknown"
]
personalEvents = personalConstantEvents.keys() personalEvents = personalConstantEvents.keys()
personalEvents.sort() personalEvents.sort()
@ -159,3 +166,5 @@ personalAttributes.sort()
marriageEvents = familyConstantEvents.keys() marriageEvents = familyConstantEvents.keys()
marriageEvents.sort() marriageEvents.sort()
familyRelations = familyConstantRelations

View File

@ -547,6 +547,7 @@ def new_database_response(val):
const.personalEvents.sort() const.personalEvents.sort()
const.personalAttributes = const.personalConstantAttributes.keys() const.personalAttributes = const.personalConstantAttributes.keys()
const.personalAttributes.sort() const.personalAttributes.sort()
const.familyRelations = const.familyConstantRelations
database.new() database.new()
topWindow.set_title("Gramps") topWindow.set_title("Gramps")
active_person = None active_person = None
@ -645,14 +646,11 @@ def read_file(filename):
statusbar.set_status(_("Loading %s ...") % filename) statusbar.set_status(_("Loading %s ...") % filename)
try: if load_database(filename) == 1:
if load_database(filename) == 1: topWindow.set_title("%s - %s" % (_("Gramps"),filename))
topWindow.set_title("%s - %s" % (_("Gramps"),filename)) else:
else: statusbar.set_status("")
statusbar.set_status("") Config.save_last_file("")
Config.save_last_file("")
except:
displayError(_("Failure reading %s") % filename)
statusbar.set_progress(0.0) statusbar.set_progress(0.0)
@ -910,7 +908,7 @@ def on_delete_person_clicked(obj):
if not active_person: if not active_person:
return return
topWindow.question(_("Do you really wish to delete %s") % \ topWindow.question(_("Do you really wish to delete %s?") % \
Config.nameof(active_person), delete_person_response) Config.nameof(active_person), delete_person_response)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -1223,6 +1221,9 @@ def revert_query(value):
const.marriageEvents = const.familyConstantEvents.keys() const.marriageEvents = const.familyConstantEvents.keys()
const.marriageEvents.sort() const.marriageEvents.sort()
const.familyRelations = const.familyConstantRelations
file = database.getSavePath() file = database.getSavePath()
database.new() database.new()
read_file(file) read_file(file)
@ -1764,6 +1765,11 @@ def load_database(name):
if type not in const.personalAttributes: if type not in const.personalAttributes:
const.personalAttributes.append(type) const.personalAttributes.append(type)
mylist = database.getFamilyRelationTypes()
for type in mylist:
if type not in const.familyRelations:
const.familyRelations.append(type)
Config.save_last_file(name) Config.save_last_file(name)
Main.get_widget("filter").set_text("") Main.get_widget("filter").set_text("")
active_person = database.getDefaultPerson() active_person = database.getDefaultPerson()
@ -1895,7 +1901,7 @@ def on_edit_bookmarks_activate(obj):
def on_default_person_activate(obj): def on_default_person_activate(obj):
if active_person: if active_person:
name = active_person.getPrimaryName().getRegularName() name = active_person.getPrimaryName().getRegularName()
topWindow.question(_("Do you wish to set %s as the home person") % name, \ topWindow.question(_("Do you wish to set %s as the home person?") % name, \
set_person) set_person)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
<class>GtkVBox</class> <class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name> <child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox5</name> <name>dialog-vbox5</name>
<width>400</width> <width>500</width>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<spacing>8</spacing> <spacing>8</spacing>
<child> <child>
@ -63,9 +63,9 @@
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
<handler>destroy_passed_object</handler> <handler>on_close_marriage_editor</handler>
<object>marriageEditor</object> <object>marriageEditor</object>
<last_modification_time>Sat, 25 Nov 2000 00:55:34 GMT</last_modification_time> <last_modification_time>Thu, 24 May 2001 22:53:21 GMT</last_modification_time>
</signal> </signal>
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button> <stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
</widget> </widget>
@ -85,7 +85,6 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>marriageTitle</name> <name>marriageTitle</name>
<width>0</width>
<label>Marriage/Family Editor</label> <label>Marriage/Family Editor</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -110,6 +109,72 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkHBox</class>
<name>hbox15</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label202</name>
<label>Relationship Type : </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>10</ypad>
<child>
<padding>4</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>marriage_type</name>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<padding>5</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>combo-entry1</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator5</name>
<child>
<padding>5</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget> <widget>
<class>GtkNotebook</class> <class>GtkNotebook</class>
<name>notebook4</name> <name>notebook4</name>
@ -356,6 +421,7 @@
<last_modification_time>Sun, 11 Feb 2001 22:58:04 GMT</last_modification_time> <last_modification_time>Sun, 11 Feb 2001 22:58:04 GMT</last_modification_time>
</signal> </signal>
<label>Source</label> <label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child> <child>
<padding>3</padding> <padding>3</padding>
<expand>False</expand> <expand>False</expand>
@ -479,6 +545,7 @@
<last_modification_time>Sat, 25 Nov 2000 16:52:41 GMT</last_modification_time> <last_modification_time>Sat, 25 Nov 2000 16:52:41 GMT</last_modification_time>
</signal> </signal>
<label>Add</label> <label>Add</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
<widget> <widget>
@ -493,6 +560,7 @@
<last_modification_time>Sat, 25 Nov 2000 16:52:46 GMT</last_modification_time> <last_modification_time>Sat, 25 Nov 2000 16:52:46 GMT</last_modification_time>
</signal> </signal>
<label>Update</label> <label>Update</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
<widget> <widget>
@ -507,6 +575,7 @@
<last_modification_time>Sat, 25 Nov 2000 16:52:55 GMT</last_modification_time> <last_modification_time>Sat, 25 Nov 2000 16:52:55 GMT</last_modification_time>
</signal> </signal>
<label>Delete</label> <label>Delete</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -628,6 +697,7 @@
<last_modification_time>Thu, 29 Mar 2001 13:45:03 GMT</last_modification_time> <last_modification_time>Thu, 29 Mar 2001 13:45:03 GMT</last_modification_time>
</signal> </signal>
<label>Add Photo</label> <label>Add Photo</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
<widget> <widget>
@ -642,6 +712,7 @@
<last_modification_time>Thu, 29 Mar 2001 13:45:15 GMT</last_modification_time> <last_modification_time>Thu, 29 Mar 2001 13:45:15 GMT</last_modification_time>
</signal> </signal>
<label>Delete Photo</label> <label>Delete Photo</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
<widget> <widget>
@ -656,6 +727,7 @@
<last_modification_time>Thu, 29 Mar 2001 13:44:47 GMT</last_modification_time> <last_modification_time>Thu, 29 Mar 2001 13:44:47 GMT</last_modification_time>
</signal> </signal>
<label>Make Primary</label> <label>Make Primary</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget> </widget>
</widget> </widget>
</widget> </widget>

View File

@ -432,7 +432,7 @@ def on_save_clicked(obj):
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def get_description(): def get_description():
return _("Creates a family group report, showing information on a set of parents and their children.") return _("Produces a detailed report on the selected person.")
def get_name(): def get_name():
return _("Generate files/Individual Summary") return _("Generate files/Individual Summary")

View File

@ -68,8 +68,7 @@ def ancestors_of(p1,list):
# #
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def get_name(p1): def get_name_obj(p1):
if p1 == None: if p1 == None:
return None return None
else: else:
@ -874,8 +873,8 @@ class Merge:
f2 = p2.getMainFamily() f2 = p2.getMainFamily()
if f1 and f2: if f1 and f2:
dad1 = get_name(f1.getFather()) dad1 = get_name_obj(f1.getFather())
dad2 = get_name(f2.getFather()) dad2 = get_name_obj(f2.getFather())
value = self.name_match(dad1,dad2) value = self.name_match(dad1,dad2)
@ -884,8 +883,8 @@ class Merge:
chance = chance + value chance = chance + value
mom1 = get_name(f1.getMother()) mom1 = get_name_obj(f1.getMother())
mom2 = get_name(f2.getMother()) mom2 = get_name_obj(f2.getMother())
value = self.name_match(mom1,mom2) value = self.name_match(mom1,mom2)
if value == -1: if value == -1:
@ -902,8 +901,8 @@ class Merge:
if father1 == father2: if father1 == father2:
chance = chance + 1 chance = chance + 1
else: else:
fname1 = get_name(father1) fname1 = get_name_obj(father1)
fname2 = get_name(father2) fname2 = get_name_obj(father2)
value = self.name_match(fname1,fname2) value = self.name_match(fname1,fname2)
if value != -1: if value != -1:
chance = chance + value chance = chance + value
@ -914,8 +913,8 @@ class Merge:
if mother1 == mother2: if mother1 == mother2:
chance = chance + 1 chance = chance + 1
else: else:
mname1 = get_name(mother1) mname1 = get_name_obj(mother1)
mname2 = get_name(mother2) mname2 = get_name_obj(mother2)
value = self.name_match(mname1,mname2) value = self.name_match(mname1,mname2)
if value != -1: if value != -1:
chance = chance + value chance = chance + value

View File

@ -15,7 +15,7 @@
<widget> <widget>
<class>GtkDialog</class> <class>GtkDialog</class>
<name>filters</name> <name>filters</name>
<title>Gramps - Event Correlation</title> <title>Gramps - Event Comparison</title>
<type>GTK_WINDOW_DIALOG</type> <type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_NONE</position> <position>GTK_WIN_POS_NONE</position>
<modal>False</modal> <modal>False</modal>

View File

@ -15,7 +15,7 @@
<widget> <widget>
<class>GtkWindow</class> <class>GtkWindow</class>
<name>status</name> <name>status</name>
<title>GEDCOM import status</title> <title>GEDCOM Import Status</title>
<type>GTK_WINDOW_TOPLEVEL</type> <type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_CENTER</position> <position>GTK_WIN_POS_CENTER</position>
<modal>False</modal> <modal>False</modal>
@ -92,7 +92,7 @@
<widget> <widget>
<class>GtkWindow</class> <class>GtkWindow</class>
<name>gedcomImport</name> <name>gedcomImport</name>
<title>Gramps - GEDCOM import</title> <title>Gramps - GEDCOM Import</title>
<type>GTK_WINDOW_TOPLEVEL</type> <type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_CENTER</position> <position>GTK_WIN_POS_CENTER</position>
<modal>True</modal> <modal>True</modal>

View File

@ -204,7 +204,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label8</name> <name>label8</name>
<label>Birth date : </label> <label>Birth Date : </label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -230,7 +230,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label12</name> <name>label12</name>
<label>Death date : </label> <label>Death Date : </label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -856,7 +856,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label13</name> <name>label13</name>
<label>Death date : </label> <label>Death Date : </label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -960,7 +960,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label9</name> <name>label9</name>
<label>Birth date : </label> <label>Birth Date : </label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1579,7 +1579,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label44</name> <name>label44</name>
<label>Please be patient. This may take a while.</label> <label>Please be patient. This may take a while.</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>True</wrap> <wrap>True</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>

View File

@ -72,7 +72,7 @@
<widget> <widget>
<class>GtkButton</class> <class>GtkButton</class>
<name>button3</name> <name>button3</name>
<tooltip>Close window</tooltip> <tooltip>Close Window</tooltip>
<can_default>True</can_default> <can_default>True</can_default>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>

File diff suppressed because it is too large Load Diff