2006-08-03 Zsolt Foldvari <zfoldvar@users.sourceforge.net>

* src/plugins/Check.py (cleanup_deleted_name_formats): Change hardcoded
	values with constants.
	* src/GrampsCfg.py: Unused constants cleanup.
	* src/DataViews/_PedigreeView.py (__init__): connection to "active-
	person-changed" signal moved to set_active()
	(set_active, set_inactive): Improve performance of other views.
	* src/NameDisplay.py (name_grouping_data): Change hardcoded values
	with constants.



svn: r7114
This commit is contained in:
Zsolt Foldvari 2006-08-03 14:26:43 +00:00
parent 76be2957b4
commit 5af5a2a3c2
5 changed files with 35 additions and 19 deletions

View File

@ -1,3 +1,13 @@
2006-08-03 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/plugins/Check.py (cleanup_deleted_name_formats): Change hardcoded
values with constants.
* src/GrampsCfg.py: Unused constants cleanup.
* src/DataViews/_PedigreeView.py (__init__): connection to "active-
person-changed" signal moved to set_active()
(set_active, set_inactive): Improve performance of other views.
* src/NameDisplay.py (name_grouping_data): Change hardcoded values
with constants.
2006-08-03 Alex Roitman <shura@gramps-project.org>
* src/DisplayTabs/_BackRefList.py (find_node): Use class name.
* src/DisplayTabs/_BackRefModel.py (__init__, load_model): Add new

View File

@ -409,7 +409,7 @@ class PedigreeView(PageView.PersonNavView):
self.dbstate = dbstate
self.dbstate.connect('database-changed',self.change_db)
self.dbstate.connect('active-changed',self.goto_active_person)
#self.dbstate.connect('active-changed',self.goto_active_person)
self.force_size = 0 # Automatic resize
self.tree_style = 0 # Nice tree
self.show_images = True # Show photos of persons
@ -438,6 +438,16 @@ class PedigreeView(PageView.PersonNavView):
# for PyGtk < 2.4
self.notebook.append_page(frame,gtk.Label(""))
def set_active(self):
PageView.PersonNavView.set_active(self)
self.key_active_changed = self.dbstate.connect('active-changed',
self.goto_active_person)
self.build_tree()
def set_inactive(self):
PageView.PersonNavView.set_inactive(self)
self.dbstate.disconnect(self.key_active_changed)
def get_stock(self):
"""
Returns the name of the stock icon to use for the display.
@ -883,8 +893,8 @@ class PedigreeView(PageView.PersonNavView):
# Add navigation arrows
if lst[0]:
#l = gtk.Button("◀")
l=gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_LEFT, gtk.SHADOW_IN))
l=gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_LEFT, gtk.SHADOW_IN))
childlist = find_children(self.dbstate.db,lst[0][0])
if childlist:
l.connect("clicked",self.on_show_child_menu)
@ -895,7 +905,7 @@ class PedigreeView(PageView.PersonNavView):
table_widget.attach(l,0,1,ymid,ymid+1,0,0,0,0)
#l = gtk.Button("▶")
l = gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
if lst[1]:
l.connect("clicked",self.on_childmenu_changed,lst[1][0].handle)
self.tooltips.set_tip(l, _("Jump to father"))
@ -904,7 +914,7 @@ class PedigreeView(PageView.PersonNavView):
ymid = int(math.floor(ymax/4))
table_widget.attach(l,xmax,xmax+1,ymid-1,ymid+2,0,0,0,0)
l = gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
if lst[2]:
l.connect("clicked",self.on_childmenu_changed,lst[2][0].handle)
self.tooltips.set_tip(l, _("Jump to mother"))

View File

@ -60,10 +60,6 @@ _surname_styles = [
_("Icelandic style"),
]
# button names on the 'name format' editor dialog
INS_BTN_NAME = 'insert'
EDT_BTN_NAME = 'edit'
# column numbers for the 'name format' model
COL_NUM = 0
COL_NAME = 1

View File

@ -367,14 +367,14 @@ class NameDisplay:
return db.get_name_group_mapping(pn.first_name)
def name_grouping_data(self, db, pn):
if pn[12]:
return pn[12]
sv = pn[13]
if pn[_GROUP]:
return pn[_GROUP]
sv = pn[_SORT]
if sv == Name.LNFN or sv == Name.DEF:
return db.get_name_group_mapping(pn[5])
return db.get_name_group_mapping(pn[_SURNAME])
elif sv == Name.PTFN:
return db.get_name_group_mapping(pn[10])
return db.get_name_group_mapping(pn[_PATRONYM])
else:
return db.get_name_group_mapping(pn[4])
return db.get_name_group_mapping(pn[_FIRSTNAME])
displayer = NameDisplay()

View File

@ -244,10 +244,10 @@ class CheckIntegrity:
p_changed = False
name = person.get_primary_name()
if name.get_sort_as() in deleted_name_formats:
name.set_sort_as(0)
name.set_sort_as(RelLib.Name.DEF)
p_changed = True
if name.get_display_as() in deleted_name_formats:
name.set_display_as(0)
name.set_display_as(RelLib.Name.DEF)
p_changed = True
if p_changed:
person.set_primary_name(name)
@ -256,10 +256,10 @@ class CheckIntegrity:
name_list = []
for name in person.get_alternate_names():
if name.get_sort_as() in deleted_name_formats:
name.set_sort_as(0)
name.set_sort_as(RelLib.Name.DEF)
a_changed = True
if name.get_display_as() in deleted_name_formats:
name.set_display_as(0)
name.set_display_as(RelLib.Name.DEF)
a_changed = True
name_list.append(name)
if a_changed: