various fixes and additions for GEP 021'
svn: r16043
This commit is contained in:
parent
2fa5470b34
commit
209b34f359
@ -1425,12 +1425,13 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
for name in ([person.primary_name]
|
for name in ([person.primary_name]
|
||||||
+ person.alternate_names)
|
+ person.alternate_names)
|
||||||
if name.type.is_custom()])
|
if name.type.is_custom()])
|
||||||
|
all_surn = [] # new list we will use for storage
|
||||||
all_surn = person.primary_name.get_surname_list()
|
all_surn += person.primary_name.get_surname_list()
|
||||||
for asurname in person.alternate_names:
|
for asurname in person.alternate_names:
|
||||||
all_surn += asurname.get_surname_list()
|
all_surn += asurname.get_surname_list()
|
||||||
self.origin_types.update([str(surn.origintype) for surn in all_surn
|
self.origin_types.update([str(surn.origintype) for surn in all_surn
|
||||||
if surn.origintype.is_custom()])
|
if surn.origintype.is_custom()])
|
||||||
|
all_surn = None
|
||||||
|
|
||||||
self.url_types.update([str(url.type) for url in person.urls
|
self.url_types.update([str(url.type) for url in person.urls
|
||||||
if url.type.is_custom()])
|
if url.type.is_custom()])
|
||||||
|
@ -142,6 +142,9 @@ class NameEmbedList(GroupEmbeddedList):
|
|||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
name = gen.lib.Name()
|
name = gen.lib.Name()
|
||||||
|
#the editor requires a surname
|
||||||
|
name.add_surname(gen.lib.Surname())
|
||||||
|
name.set_primary_surname(0)
|
||||||
try:
|
try:
|
||||||
from gui.editors import EditName
|
from gui.editors import EditName
|
||||||
EditName(self.dbstate, self.uistate, self.track,
|
EditName(self.dbstate, self.uistate, self.track,
|
||||||
|
@ -483,26 +483,41 @@ class EditPerson(EditPrimary):
|
|||||||
self.pname = self.obj.get_primary_name()
|
self.pname = self.obj.get_primary_name()
|
||||||
|
|
||||||
self.ntype_field.reinit(self.pname.set_type, self.pname.get_type)
|
self.ntype_field.reinit(self.pname.set_type, self.pname.get_type)
|
||||||
|
self.given.reinit(self.pname.set_first_name, self.pname.get_first_name)
|
||||||
self.prefix_suffix.reinit(
|
self.call.reinit(self.pname.set_call_name, self.pname.get_call_name)
|
||||||
[self.pname.set_surname_prefix, self.pname.set_suffix],
|
self.title.reinit(self.pname.set_title, self.pname.get_title)
|
||||||
[self.pname.get_surname_prefix, self.pname.get_suffix])
|
self.suffix.reinit(self.pname.set_suffix, self.pname.get_suffix)
|
||||||
|
self.nick.reinit(self.pname.set_nick_name, self.pname.get_nick_name)
|
||||||
self.call.reinit(
|
#part of Single Surname section
|
||||||
self.pname.set_call_name,
|
|
||||||
self.pname.get_call_name)
|
|
||||||
|
|
||||||
self.given.reinit(
|
|
||||||
self.pname.set_first_name,
|
|
||||||
self.pname.get_first_name)
|
|
||||||
|
|
||||||
self.patro_title.reinit(
|
|
||||||
[self.pname.set_patronymic, self.pname.set_title],
|
|
||||||
[self.pname.get_patronymic, self.pname.get_title])
|
|
||||||
|
|
||||||
self.surname_field.reinit(
|
self.surname_field.reinit(
|
||||||
self.pname.set_surname,
|
self.pname.get_primary_surname().set_surname,
|
||||||
self.pname.get_surname)
|
self.pname.get_primary_surname().get_surname)
|
||||||
|
|
||||||
|
self.prefix.reinit(
|
||||||
|
self.pname.get_primary_surname().set_prefix,
|
||||||
|
self.pname.get_primary_surname().get_prefix)
|
||||||
|
|
||||||
|
self.ortype_field.reinit(
|
||||||
|
self.pname.get_primary_surname().set_origintype,
|
||||||
|
self.pname.get_primary_surname().get_origintype)
|
||||||
|
|
||||||
|
#remove present surname tab, and put new one based on current prim name
|
||||||
|
msurhbox = self.top.get_object("hboxmultsurnames")
|
||||||
|
msurhbox.remove(self.surntab)
|
||||||
|
self.surntab = SurnameTab(self.dbstate, self.uistate, self.track,
|
||||||
|
self.obj.get_primary_name())
|
||||||
|
msurhbox.pack_start(self.surntab)
|
||||||
|
|
||||||
|
if len(self.pname.get_surname_list()) == 1:
|
||||||
|
self.singlesurn_active = True
|
||||||
|
else:
|
||||||
|
self.singlesurn_active = False
|
||||||
|
if self.singlesurn_active:
|
||||||
|
self.multsurnfr.hide_all()
|
||||||
|
self.singsurnfr.show_all()
|
||||||
|
else:
|
||||||
|
self.singsurnfr.hide_all()
|
||||||
|
self.multsurnfr.show_all()
|
||||||
|
|
||||||
def build_menu_names(self, person):
|
def build_menu_names(self, person):
|
||||||
"""
|
"""
|
||||||
@ -840,11 +855,25 @@ class EditPerson(EditPrimary):
|
|||||||
self.suffix, self.nick, self.surname_field, self.prefix,
|
self.suffix, self.nick, self.surname_field, self.prefix,
|
||||||
self.ortype_field):
|
self.ortype_field):
|
||||||
obj.update()
|
obj.update()
|
||||||
if len(self.obj.get_primary_name().get_surname_list()) > 1:
|
|
||||||
#TODO: multiple surname must be activated if not yet the case
|
#remove present surname tab, and put new one
|
||||||
print 'person editor TODO'
|
msurhbox = self.top.get_object("hboxmultsurnames")
|
||||||
#TODO: update list of surnames
|
msurhbox.remove(self.surntab)
|
||||||
print 'person editor TODO 2'
|
self.surntab = SurnameTab(self.dbstate, self.uistate, self.track,
|
||||||
|
self.obj.get_primary_name())
|
||||||
|
msurhbox.pack_start(self.surntab)
|
||||||
|
|
||||||
|
if len(self.obj.get_primary_name().get_surname_list()) == 1:
|
||||||
|
self.singlesurn_active = True
|
||||||
|
else:
|
||||||
|
self.singlesurn_active = False
|
||||||
|
if self.singlesurn_active:
|
||||||
|
self.multsurnfr.hide_all()
|
||||||
|
self.singsurnfr.show_all()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.singsurnfr.hide_all()
|
||||||
|
self.multsurnfr.show_all()
|
||||||
|
|
||||||
def load_person_image(self):
|
def load_person_image(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user