* src/PeopleModel.py: disable bold due to gtk tree bug
* src/PeopleView.py: disable bold due to gtk tree bug * src/plugins/CountAncestors.py: Handle duplicates properly svn: r3666
This commit is contained in:
parent
fb2ef63eee
commit
0ce203ad2c
@ -1,3 +1,8 @@
|
|||||||
|
2004-10-23 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
|
* src/PeopleModel.py: disable bold due to gtk tree bug
|
||||||
|
* src/PeopleView.py: disable bold due to gtk tree bug
|
||||||
|
* src/plugins/CountAncestors.py: Handle duplicates properly
|
||||||
|
|
||||||
2004-10-22 Don Allingham <dallingham@users.sourceforge.net>
|
2004-10-22 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
* src/GrampsBSDDB.py: thumbnail handing in the database
|
* src/GrampsBSDDB.py: thumbnail handing in the database
|
||||||
* src/GrampsDbBase.py: add set_thumbnail_image and
|
* src/GrampsDbBase.py: add set_thumbnail_image and
|
||||||
|
@ -315,7 +315,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return node
|
return node
|
||||||
|
|
||||||
def column_header_bold(self,node):
|
def column_header_bold(self,node):
|
||||||
return pango.WEIGHT_BOLD
|
return pango.WEIGHT_NORMAL #BOLD
|
||||||
|
|
||||||
def column_header_view(self,node):
|
def column_header_view(self,node):
|
||||||
return self.top_visible.has_key(node)
|
return self.top_visible.has_key(node)
|
||||||
|
@ -94,8 +94,7 @@ class PeopleView:
|
|||||||
for column in self.columns:
|
for column in self.columns:
|
||||||
self.person_tree.remove_column(column)
|
self.person_tree.remove_column(column)
|
||||||
|
|
||||||
column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0,
|
column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0)
|
||||||
weight=PeopleModel.COLUMN_BOLD)
|
|
||||||
column.set_resizable(gtk.TRUE)
|
column.set_resizable(gtk.TRUE)
|
||||||
column.set_min_width(225)
|
column.set_min_width(225)
|
||||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
||||||
|
@ -30,6 +30,7 @@ from gettext import gettext as _
|
|||||||
from gnome.ui import *
|
from gnome.ui import *
|
||||||
import gtk
|
import gtk
|
||||||
import gtk.glade
|
import gtk.glade
|
||||||
|
from sets import Set
|
||||||
|
|
||||||
def report(database,person):
|
def report(database,person):
|
||||||
try:
|
try:
|
||||||
@ -48,24 +49,25 @@ class CountAncestors:
|
|||||||
topDialog.signal_autoconnect({
|
topDialog.signal_autoconnect({
|
||||||
"destroy_passed_object" : Utils.destroy_passed_object,
|
"destroy_passed_object" : Utils.destroy_passed_object,
|
||||||
})
|
})
|
||||||
thisgen = []
|
thisgen = Set()
|
||||||
allgen = []
|
allgen = 0
|
||||||
thisgen.append(person.get_handle())
|
thisgen.add(person.get_handle())
|
||||||
|
|
||||||
title = _("Number of ancestors of \"%s\" by generation") % person.get_primary_name().get_name()
|
title = _("Number of ancestors of \"%s\" by generation") % person.get_primary_name().get_name()
|
||||||
text = text + title + ':\n'
|
text += title + ':\n'
|
||||||
thisgensize = 1
|
thisgensize = 1
|
||||||
gen = 1
|
gen = 1
|
||||||
while thisgensize > 0:
|
while thisgensize > 0:
|
||||||
thisgensize = 0
|
thisgensize = 0
|
||||||
if thisgen:
|
if thisgen:
|
||||||
thisgensize = len( thisgen )
|
thisgensize = len( thisgen )
|
||||||
gen = gen - 1
|
gen -= 1
|
||||||
if thisgensize == 1 :
|
if thisgensize == 1 :
|
||||||
text = text + _("Generation %d has 1 individual.\n") % (gen)
|
text += _("Generation %d has 1 individual.\n") % (gen)
|
||||||
else:
|
else:
|
||||||
text = text + _("Generation %d has %d individuals.\n") % (gen, thisgensize)
|
text += _("Generation %d has %d individuals.\n") % (gen, thisgensize)
|
||||||
temp = thisgen
|
temp = thisgen
|
||||||
thisgen = []
|
thisgen = Set()
|
||||||
for person_handle in temp:
|
for person_handle in temp:
|
||||||
person = database.get_person_from_handle(person_handle)
|
person = database.get_person_from_handle(person_handle)
|
||||||
family_handle = person.get_main_parents_family_handle()
|
family_handle = person.get_main_parents_family_handle()
|
||||||
@ -74,12 +76,12 @@ class CountAncestors:
|
|||||||
father_handle = family.get_father_handle()
|
father_handle = family.get_father_handle()
|
||||||
mother_handle = family.get_mother_handle()
|
mother_handle = family.get_mother_handle()
|
||||||
if father_handle:
|
if father_handle:
|
||||||
thisgen.append(father_handle)
|
thisgen.add(father_handle)
|
||||||
if mother_handle:
|
if mother_handle:
|
||||||
thisgen.append(mother_handle)
|
thisgen.add(mother_handle)
|
||||||
allgen = allgen + thisgen
|
allgen += len(thisgen)
|
||||||
|
|
||||||
text = text + _("Total ancestors in generations %d to -1 is %d.\n") % (gen, len(allgen))
|
text += _("Total ancestors in generations %d to -1 is %d.\n") % (gen, allgen)
|
||||||
|
|
||||||
top = topDialog.get_widget("summary")
|
top = topDialog.get_widget("summary")
|
||||||
textwindow = topDialog.get_widget("textwindow")
|
textwindow = topDialog.get_widget("textwindow")
|
||||||
|
Loading…
Reference in New Issue
Block a user