* src/RelLib.py (GenderStats.guess_gender): back out
incorrect patch * src/Witness.py: handle new_name error * src/SelectPerson.py: remove unused crud left over from 1.0, grab handle instead of GRAMPS ID svn: r3525
This commit is contained in:
parent
aab141fb5c
commit
de4853eeec
@ -1,3 +1,10 @@
|
|||||||
|
2004-08-31 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
|
* src/RelLib.py (GenderStats.guess_gender): back out
|
||||||
|
incorrect patch
|
||||||
|
* src/Witness.py: handle new_name error
|
||||||
|
* src/SelectPerson.py: remove unused crud left over from
|
||||||
|
1.0, grab handle instead of GRAMPS ID
|
||||||
|
|
||||||
2004-08-31 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-08-31 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/Sources.py (SourceTab.redraw, SourceSelector.redraw):
|
* src/Sources.py (SourceTab.redraw, SourceSelector.redraw):
|
||||||
Use gramps ID instead of handle for display.
|
Use gramps ID instead of handle for display.
|
||||||
|
@ -118,7 +118,6 @@ class PeopleView:
|
|||||||
import time
|
import time
|
||||||
t = time.time()
|
t = time.time()
|
||||||
self.person_model = PeopleModel.PeopleModel(self.parent.db)
|
self.person_model = PeopleModel.PeopleModel(self.parent.db)
|
||||||
print "new",time.time() - t
|
|
||||||
#self.sort_model = self.person_model.filter_new()
|
#self.sort_model = self.person_model.filter_new()
|
||||||
self.sort_model = self.person_model
|
self.sort_model = self.person_model
|
||||||
self.person_tree.set_model(self.sort_model)
|
self.person_tree.set_model(self.sort_model)
|
||||||
@ -177,7 +176,6 @@ class PeopleView:
|
|||||||
self.parent.mhistory.remove(del_id)
|
self.parent.mhistory.remove(del_id)
|
||||||
|
|
||||||
def apply_filter_clicked(self):
|
def apply_filter_clicked(self):
|
||||||
print "Applying Filter"
|
|
||||||
mi = self.parent.filter_list.get_menu().get_active()
|
mi = self.parent.filter_list.get_menu().get_active()
|
||||||
self.DataFilter = mi.get_data("filter")
|
self.DataFilter = mi.get_data("filter")
|
||||||
if self.DataFilter.need_param:
|
if self.DataFilter.need_param:
|
||||||
@ -185,7 +183,6 @@ class PeopleView:
|
|||||||
self.DataFilter.set_parameter(qual)
|
self.DataFilter.set_parameter(qual)
|
||||||
self.apply_filter()
|
self.apply_filter()
|
||||||
self.goto_active_person()
|
self.goto_active_person()
|
||||||
print "Done"
|
|
||||||
|
|
||||||
def add_to_person_list(self,person,change=0):
|
def add_to_person_list(self,person,change=0):
|
||||||
self.apply_filter_clicked()
|
self.apply_filter_clicked()
|
||||||
|
@ -2227,10 +2227,10 @@ class GenderStats:
|
|||||||
return Person.female
|
return Person.female
|
||||||
|
|
||||||
if male > (2 * female):
|
if male > (2 * female):
|
||||||
return Person.female
|
return Person.male
|
||||||
|
|
||||||
if female > (2 * male):
|
if female > (2 * male):
|
||||||
return Person.male
|
return Person.female
|
||||||
|
|
||||||
return Person.unknown
|
return Person.unknown
|
||||||
|
|
||||||
|
@ -53,46 +53,28 @@ import PeopleModel
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class SelectPerson:
|
class SelectPerson:
|
||||||
|
|
||||||
def __init__(self,db,title,flabel="",filter=None,parent_window=None):
|
def __init__(self,db,title,parent_window=None):
|
||||||
|
|
||||||
self.renderer = gtk.CellRendererText()
|
self.renderer = gtk.CellRendererText()
|
||||||
self.db = db
|
self.db = db
|
||||||
self.filter = filter
|
|
||||||
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
||||||
self.top = self.glade.get_widget('select_person')
|
self.top = self.glade.get_widget('select_person')
|
||||||
title_label = self.glade.get_widget('title')
|
title_label = self.glade.get_widget('title')
|
||||||
self.filter_select = self.glade.get_widget('filter')
|
|
||||||
self.plist = self.glade.get_widget('plist')
|
self.plist = self.glade.get_widget('plist')
|
||||||
self.notebook = self.glade.get_widget('notebook')
|
self.notebook = self.glade.get_widget('notebook')
|
||||||
if filter:
|
|
||||||
self.use_filter = 1
|
|
||||||
else:
|
|
||||||
self.use_filter = 0
|
self.use_filter = 0
|
||||||
|
|
||||||
Utils.set_titles(self.top,title_label,title)
|
Utils.set_titles(self.top,title_label,title)
|
||||||
|
|
||||||
self.model = PeopleModel.PeopleModel(self.db)
|
self.model = PeopleModel.PeopleModel(self.db)
|
||||||
|
|
||||||
if filter:
|
|
||||||
self.filter_select.set_label(flabel)
|
|
||||||
self.filter_select.connect('toggled',self.redraw_cb)
|
|
||||||
self.filter_select.show()
|
|
||||||
self.filter_select.set_active(1)
|
|
||||||
else:
|
|
||||||
self.filter_select.hide()
|
|
||||||
|
|
||||||
self.add_columns(self.plist)
|
self.add_columns(self.plist)
|
||||||
self.redraw()
|
|
||||||
self.plist.set_model(self.model)
|
self.plist.set_model(self.model)
|
||||||
self.top.show()
|
self.top.show()
|
||||||
|
|
||||||
if parent_window:
|
if parent_window:
|
||||||
self.top.set_transient_for(parent_window)
|
self.top.set_transient_for(parent_window)
|
||||||
|
|
||||||
def redraw_cb(self,obj):
|
|
||||||
self.use_filter = self.filter_select.get_active()
|
|
||||||
self.redraw()
|
|
||||||
|
|
||||||
def add_columns(self,tree):
|
def add_columns(self,tree):
|
||||||
column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0)
|
column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0)
|
||||||
column.set_resizable(gtk.TRUE)
|
column.set_resizable(gtk.TRUE)
|
||||||
@ -107,30 +89,11 @@ class SelectPerson:
|
|||||||
column.set_min_width(75)
|
column.set_min_width(75)
|
||||||
tree.append_column(column)
|
tree.append_column(column)
|
||||||
column = gtk.TreeViewColumn(_('Birth date'), self.renderer,text=3)
|
column = gtk.TreeViewColumn(_('Birth date'), self.renderer,text=3)
|
||||||
#column.set_resizable(gtk.TRUE)
|
|
||||||
column.set_clickable(gtk.TRUE)
|
column.set_clickable(gtk.TRUE)
|
||||||
tree.append_column(column)
|
tree.append_column(column)
|
||||||
|
|
||||||
def redraw(self):
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
for key in self.db.get_person_handles(sort_handles=True):
|
|
||||||
person = self.db.get_person_from_handle(key)
|
|
||||||
if self.use_filter and not self.filter(person):
|
|
||||||
continue
|
|
||||||
|
|
||||||
data = self.db.get_person_from_handle(key).get_display_info()
|
|
||||||
gender = person.get_gender()
|
|
||||||
if gender == RelLib.Person.plist:
|
|
||||||
self.mmodel.add([data[0],data[1],data[3],data[5],data[6]],key)
|
|
||||||
elif gender == RelLib.Person.feplist:
|
|
||||||
self.fmodel.add([data[0],data[1],data[3],data[5],data[6]],key)
|
|
||||||
else:
|
|
||||||
self.umodel.add([data[0],data[1],data[3],data[5],data[6]],key)
|
|
||||||
|
|
||||||
def select_function(self,store,path,iter,id_list):
|
def select_function(self,store,path,iter,id_list):
|
||||||
id_list.append(self.model.get_value(iter,1))
|
id_list.append(self.model.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def get_selected_ids(self):
|
def get_selected_ids(self):
|
||||||
mlist = []
|
mlist = []
|
||||||
|
Loading…
Reference in New Issue
Block a user