From de4853eeecb2c67470b5dae74e4b77516c06f80e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 1 Sep 2004 03:47:10 +0000 Subject: [PATCH] * 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 --- gramps2/ChangeLog | 7 ++++++ gramps2/src/PeopleView.py | 3 --- gramps2/src/RelLib.py | 4 ++-- gramps2/src/SelectPerson.py | 43 +++---------------------------------- gramps2/src/Witness.py | 4 ++-- 5 files changed, 14 insertions(+), 47 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 9aa0b8c60..21add1967 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2004-08-31 Don Allingham + * 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 * src/Sources.py (SourceTab.redraw, SourceSelector.redraw): Use gramps ID instead of handle for display. diff --git a/gramps2/src/PeopleView.py b/gramps2/src/PeopleView.py index 3b784fd09..88333202a 100644 --- a/gramps2/src/PeopleView.py +++ b/gramps2/src/PeopleView.py @@ -118,7 +118,6 @@ class PeopleView: import time t = time.time() 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 self.person_tree.set_model(self.sort_model) @@ -177,7 +176,6 @@ class PeopleView: self.parent.mhistory.remove(del_id) def apply_filter_clicked(self): - print "Applying Filter" mi = self.parent.filter_list.get_menu().get_active() self.DataFilter = mi.get_data("filter") if self.DataFilter.need_param: @@ -185,7 +183,6 @@ class PeopleView: self.DataFilter.set_parameter(qual) self.apply_filter() self.goto_active_person() - print "Done" def add_to_person_list(self,person,change=0): self.apply_filter_clicked() diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index d6529b610..ee7d9f021 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -2227,10 +2227,10 @@ class GenderStats: return Person.female if male > (2 * female): - return Person.female + return Person.male if female > (2 * male): - return Person.male + return Person.female return Person.unknown diff --git a/gramps2/src/SelectPerson.py b/gramps2/src/SelectPerson.py index eac773359..2e881f139 100644 --- a/gramps2/src/SelectPerson.py +++ b/gramps2/src/SelectPerson.py @@ -53,46 +53,28 @@ import PeopleModel #------------------------------------------------------------------------- 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.db = db - self.filter = filter self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps") self.top = self.glade.get_widget('select_person') title_label = self.glade.get_widget('title') - self.filter_select = self.glade.get_widget('filter') self.plist = self.glade.get_widget('plist') 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) 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.redraw() self.plist.set_model(self.model) self.top.show() if 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): column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0) column.set_resizable(gtk.TRUE) @@ -107,30 +89,11 @@ class SelectPerson: column.set_min_width(75) tree.append_column(column) column = gtk.TreeViewColumn(_('Birth date'), self.renderer,text=3) - #column.set_resizable(gtk.TRUE) column.set_clickable(gtk.TRUE) 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): - 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): mlist = [] diff --git a/gramps2/src/Witness.py b/gramps2/src/Witness.py index d9f47ac39..b8ce3e995 100644 --- a/gramps2/src/Witness.py +++ b/gramps2/src/Witness.py @@ -199,8 +199,8 @@ class WitnessEditor: self.new_person = new_person self.idval = new_person.get_handle() new_name = new_person.get_primary_name().get_regular_name() - if new_name: - self.name.set_text(new_name) + if new_name: + self.name.set_text(new_name) def on_toggled(self,obj): if self.in_db.get_active():