diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade
index fda61daa7..27b912358 100644
--- a/gramps/src/EditPerson.glade
+++ b/gramps/src/EditPerson.glade
@@ -895,7 +895,7 @@
False
True
False
- False
+ True
False
@@ -1294,7 +1294,7 @@
GtkTable
table10
- 4
+ 5
3
False
0
@@ -1469,8 +1469,8 @@
0
1
- 3
- 4
+ 4
+ 5
0
0
False
@@ -1495,8 +1495,8 @@
2
3
- 3
- 4
+ 4
+ 5
3
3
False
@@ -1599,6 +1599,84 @@
1
2
+ 4
+ 5
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label267
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0
+ 0.5
+ 0
+ 3
+
+ 1
+ 2
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ label268
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 3
+
+ 0
+ 1
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ name_type
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+ 2
+ 3
3
4
0
@@ -1708,8 +1786,8 @@
on_name_button_press
Sun, 04 Nov 2001 15:40:59 GMT
- 2
- 450,50
+ 3
+ 350,100,50
GTK_SELECTION_SINGLE
True
GTK_SHADOW_IN
@@ -1718,7 +1796,20 @@
GtkLabel
CList:title
label57
-
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ GtkLabel
+ CList:title
+ label57a
+
GTK_JUSTIFY_CENTER
False
0.5
@@ -5376,7 +5467,7 @@
GtkTable
table23
- 5
+ 6
2
False
0
@@ -5451,8 +5542,8 @@
1
2
- 4
- 5
+ 5
+ 6
3
3
False
@@ -5485,8 +5576,8 @@
0
1
- 4
- 5
+ 5
+ 6
0
0
False
@@ -5506,8 +5597,8 @@
1
2
- 3
- 4
+ 4
+ 5
0
0
False
@@ -5670,6 +5761,70 @@
False
+
+
+ GtkLabel
+ label266
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 8
+
+ 0
+ 1
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkCombo
+ name_type
+ True
+ False
+ False
+ True
+ False
+ Married Name
+Also Known As
+
+
+ 1
+ 2
+ 3
+ 4
+ 3
+ 3
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+ GtkEntry
+ GtkCombo:entry
+ combo-entry2
+ True
+ True
+ True
+ 0
+ Married Name
+
+
diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py
index d0f9e83d7..68569ac0e 100644
--- a/gramps/src/EditPerson.py
+++ b/gramps/src/EditPerson.py
@@ -174,6 +174,7 @@ class EditPerson:
self.alt_given_field = self.get_widget("alt_given")
self.alt_last_field = self.get_widget("alt_last")
self.alt_suffix_field = self.get_widget("alt_suffix")
+ self.name_type_field = self.get_widget("name_type")
self.surname_field = self.get_widget("surname")
self.suffix = self.get_widget("suffix")
self.given = self.get_widget("givenName")
@@ -227,7 +228,7 @@ class EditPerson:
self.gid.set_text(person.getId())
self.gid.set_editable(GrampsCfg.id_edit)
self.event_list.set_column_visibility(3,GrampsCfg.show_detail)
- self.name_list.set_column_visibility(1,GrampsCfg.show_detail)
+ self.name_list.set_column_visibility(2,GrampsCfg.show_detail)
self.attr_list.set_column_visibility(2,GrampsCfg.show_detail)
self.addr_list.set_column_visibility(2,GrampsCfg.show_detail)
@@ -972,6 +973,7 @@ class EditPerson:
self.alt_given_field.set_text(name.getFirstName())
self.alt_last_field.set_text(name.getSurname())
self.alt_suffix_field.set_text(name.getSuffix())
+ self.name_type_field.set_text(name.getType())
self.name_details_field.set_text(Utils.get_detail_text(name))
def on_web_list_select_row(self,obj,row,b,c):
@@ -1350,7 +1352,7 @@ def update_ord(func,ord,date,temple,stat,place):
#
#-------------------------------------------------------------------------
def disp_name(name):
- return [name.getName(),Utils.get_detail_flags(name)]
+ return [name.getName(),name.getType(),Utils.get_detail_flags(name)]
#-------------------------------------------------------------------------
#
diff --git a/gramps/src/GrampsParser.py b/gramps/src/GrampsParser.py
index d7097a2a1..de54476bd 100644
--- a/gramps/src/GrampsParser.py
+++ b/gramps/src/GrampsParser.py
@@ -192,20 +192,20 @@ class GrampsParser:
self.event = Event()
self.event_type = u2l(attrs["type"])
if attrs.has_key("conf"):
- self.conf = int(attrs["conf"])
+ self.event.conf = int(attrs["conf"])
else:
- self.conf = 2
+ self.event.conf = 2
if attrs.has_key("priv"):
self.event.private = int(attrs["priv"])
def start_attribute(self,attrs):
self.attribute = Attribute()
if attrs.has_key("conf"):
- self.conf = int(attrs["conf"])
+ self.attribute.conf = int(attrs["conf"])
else:
- self.conf = 2
+ self.attribute.conf = 2
if attrs.has_key("priv"):
- self.attribute.privacy = int(attrs["priv"])
+ self.attribute.private = int(attrs["priv"])
if attrs.has_key('type'):
self.attribute.setType(u2l(attrs["type"]))
if attrs.has_key('value'):
@@ -225,9 +225,9 @@ class GrampsParser:
self.address = Address()
self.person.addAddress(self.address)
if attrs.has_key("conf"):
- self.conf = int(attrs["conf"])
+ self.address.conf = int(attrs["conf"])
else:
- self.conf = 2
+ self.address.conf = 2
if attrs.has_key("priv"):
self.address.private = int(attrs["priv"])
@@ -311,10 +311,12 @@ class GrampsParser:
def start_name(self,attrs):
self.name = Name()
+ if attrs.has_key("type"):
+ self.name.setType(u2l(attrs["type"]))
if attrs.has_key("conf"):
- self.conf = int(attrs["conf"])
+ self.name.conf = int(attrs["conf"])
else:
- self.conf = 2
+ self.name.conf = 2
if attrs.has_key("priv"):
self.name.private = int(attrs["priv"])
@@ -722,6 +724,8 @@ class GrampsParser:
def stop_aka(self,tag):
self.person.addAlternateName(self.name)
+ if self.name.getType() == "":
+ self.name.setType("Also Known As")
self.name = None
func_map = {
diff --git a/gramps/src/NameEdit.py b/gramps/src/NameEdit.py
index a24e2988f..8993b903d 100644
--- a/gramps/src/NameEdit.py
+++ b/gramps/src/NameEdit.py
@@ -32,6 +32,7 @@ import libglade
#-------------------------------------------------------------------------
import const
import Utils
+import AutoComp
from RelLib import *
from intl import gettext
@@ -52,8 +53,10 @@ class NameEditor:
self.given_field = self.top.get_widget("alt_given")
self.surname_field = self.top.get_widget("alt_last")
self.suffix_field = self.top.get_widget("alt_suffix")
+ self.type_field = self.top.get_widget("name_type")
self.note_field = self.top.get_widget("alt_note")
- Utils.attach_surnames(self.top.get_widget("alt_surname_list"))
+ slist = self.top.get_widget("alt_surname_list")
+ self.combo = AutoComp.AutoCombo(slist,const.surnames)
self.priv = self.top.get_widget("priv")
if self.name:
@@ -70,11 +73,13 @@ class NameEditor:
self.window.editable_enters(self.given_field)
self.window.editable_enters(self.surname_field)
self.window.editable_enters(self.suffix_field)
+ self.window.editable_enters(self.type_field.entry)
if name != None:
self.given_field.set_text(name.getFirstName())
self.surname_field.set_text(name.getSurname())
self.suffix_field.set_text(name.getSuffix())
+ self.type_field.entry.set_text(_(name.getType()))
self.priv.set_active(name.getPrivacy())
self.note_field.set_point(0)
self.note_field.insert_defaults(name.getNote())
@@ -97,19 +102,25 @@ class NameEditor:
suffix = self.suffix_field.get_text()
note = self.note_field.get_chars(0,-1)
priv = self.priv.get_active()
+
+ type = self.type_field.entry.get_text()
+ if const.NameTypesMap.has_key(type):
+ type = const.NameTypesMap[type]
+ else:
+ type = "Also Known As"
if self.name == None:
self.name = Name()
self.name.setSourceRefList(self.srcreflist)
self.parent.nlist.append(self.name)
- self.update_name(first,last,suffix,note,priv)
+ self.update_name(first,last,suffix,type,note,priv)
self.parent.lists_changed = 1
self.parent.redraw_name_list()
Utils.destroy_passed_object(obj)
- def update_name(self,first,last,suffix,note,priv):
+ def update_name(self,first,last,suffix,type,note,priv):
if self.name.getFirstName() != first:
self.name.setFirstName(first)
@@ -126,6 +137,10 @@ class NameEditor:
self.name.setSuffix(suffix)
self.parent.lists_changed = 1
+ if self.name.getType() != type:
+ self.name.setType(type)
+ self.parent.lists_changed = 1
+
if self.name.getNote() != note:
self.name.setNote(note)
self.parent.lists_changed = 1
diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py
index 2304432f0..e18bab2c1 100644
--- a/gramps/src/RelLib.py
+++ b/gramps/src/RelLib.py
@@ -729,11 +729,21 @@ class Name(DataObj):
self.Surname = source.Surname
self.Suffix = source.Suffix
self.Title = source.Title
+ self.type = source.type
else:
self.FirstName = ""
self.Surname = ""
self.Suffix = ""
self.Title = ""
+ self.type = ""
+
+ def setType(self,type):
+ """sets the type of the Name instance"""
+ self.type = type
+
+ def getType(self):
+ """returns the type of the Name instance"""
+ return self.type
def setFirstName(self,name):
"""sets the given name for the Name instance"""
diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py
index 9c2d53761..a96d7c5ea 100644
--- a/gramps/src/WriteXML.py
+++ b/gramps/src/WriteXML.py
@@ -169,14 +169,14 @@ class XmlWriter:
total = len(personList) + len(familyList) + len(placeList) + len(sourceList)
self.g.write('\n')
- self.g.write('\n')
+ self.g.write('\n')
self.g.write("\n")
self.g.write(" \n")
self.g.write(" \n" % len(self.db.getPlaceMap().values()))
self.g.write(" \n")
self.write_line("resname",owner.getName(),3)
@@ -492,7 +492,11 @@ class XmlWriter:
def dump_name(self,label,name,index=1):
sp = " "*index
- self.g.write('%s<%s%s>\n' % (sp,label,conf_priv(name)))
+ type = name.getType()
+ if type:
+ self.g.write('%s<%s type="%s"%s>\n' % (sp,label,type,conf_priv(name)))
+ else:
+ self.g.write('%s<%s%s>\n' % (sp,label,conf_priv(name)))
self.write_line("first",name.getFirstName(),index+1)
self.write_line("last",name.getSurname(),index+1)
self.write_line("suffix",name.getSuffix(),index+1)
diff --git a/gramps/src/const.py b/gramps/src/const.py
index 3d557ddbd..f132a9bc5 100644
--- a/gramps/src/const.py
+++ b/gramps/src/const.py
@@ -857,3 +857,7 @@ lds_ssealing = [
]
+NameTypesMap = {
+ _("Also Known As") : "Also Known As",
+ _("Married") : "Married",
+ }