diff --git a/gramps/src/AddSpouse.py b/gramps/src/AddSpouse.py
index 71864cef1..6ef366aa0 100644
--- a/gramps/src/AddSpouse.py
+++ b/gramps/src/AddSpouse.py
@@ -104,9 +104,17 @@ class AddSpouse:
self.relation_type.set_text(_("Married"))
def select_row(self,obj,a,b,c):
+ """
+ Called with a row has be unselected. Used to ensable the OK button
+ when a row has been selected.
+ """
self.ok.set_sensitive(1)
def unselect_row(self,obj,a,b,c):
+ """
+ Called with a row has be unselected. Used to disable the OK button
+ when nothing is selected.
+ """
self.ok.set_sensitive(0)
def new_spouse_clicked(self,obj):
@@ -130,10 +138,15 @@ class AddSpouse:
QuickAdd.QuickAdd(self.db,gen,self.update_list)
def update_list(self,person):
+ """
+ Updates the potential spouse list after a person has been added
+ to database. Called by the QuickAdd class when the dialog has
+ been closed.
+ """
self.addperson(person)
self.relation_type_changed(self.relation_type)
- row = self.spouse_list.find_row_from_data(person)
self.sorter.sort_list()
+ row = self.spouse_list.find_row_from_data(person.getId())
self.spouse_list.select_row(row,0)
self.spouse_list.moveto(row,0)
diff --git a/gramps/src/ChooseParents.py b/gramps/src/ChooseParents.py
index dad17902b..b29458a4f 100644
--- a/gramps/src/ChooseParents.py
+++ b/gramps/src/ChooseParents.py
@@ -43,6 +43,7 @@ import const
import sort
import Utils
import GrampsCfg
+import Sorter
#-------------------------------------------------------------------------
#
@@ -83,8 +84,16 @@ class ChooseParents:
self.mlabel = self.glade.get_widget("mlabel")
self.fcombo.set_popdown_strings(const.familyRelations)
+ fmap = [(2,self.glade.get_widget('fname_arrow')),
+ (3,self.glade.get_widget('fbirth_arrow'))]
+ self.fsort = Sorter.Sorter(self.father_list,fmap,'flist')
+ mmap = [(2,self.glade.get_widget('mname_arrow')),
+ (3,self.glade.get_widget('mbirth_arrow'))]
+ self.msort = Sorter.Sorter(self.mother_list,mmap,'mlist')
self.mother_list.set_column_visibility(2,0)
self.father_list.set_column_visibility(2,0)
+ self.mother_list.set_column_visibility(3,0)
+ self.father_list.set_column_visibility(3,0)
self.mother_list.set_sort_column(2)
self.father_list.set_sort_column(2)
@@ -125,43 +134,52 @@ class ChooseParents:
self.father_list.clear()
self.mother_list.clear()
- self.father_list.append(["Unknown","",""])
+ self.father_list.append(["Unknown","","",""])
self.father_list.set_row_data(0,None)
- self.mother_list.append(["Unknown","",""])
+ self.mother_list.append(["Unknown","","",""])
self.mother_list.set_row_data(0,None)
father_index = 1
mother_index = 1
fsel = 0
msel = 0
+ pkey = self.person.getId()
+ gender = self.person.getGender()
+ if self.father:
+ fid = self.father.getId()
+ else:
+ fid = None
+ if self.mother:
+ mid = self.mother.getId()
+ else:
+ mid = None
+
for key in self.db.getPersonKeys():
- person = self.db.getPerson(key)
- if person == self.person:
+ if pkey == key:
continue
- if person.getGender() == RelLib.Person.unknown:
+ if gender == const.unknown:
continue
- if self.father == person:
+ if fid == key:
fsel = father_index
- if self.mother == person:
+ if mid == key:
msel = mother_index
- name = person.getPrimaryName()
- rdata = [Utils.phonebook_name(person),Utils.birthday(person),
- sort.build_sort_name(name)]
+ dinfo = self.db.getPersonDisplay(key)
+ rdata = [dinfo[0],dinfo[3],dinfo[5],dinfo[6]]
if self.type == "Partners":
self.father_list.append(rdata)
- self.father_list.set_row_data(father_index,person)
+ self.father_list.set_row_data(father_index,dinfo[1])
father_index = father_index + 1
self.mother_list.append(rdata)
- self.mother_list.set_row_data(mother_index,person)
+ self.mother_list.set_row_data(mother_index,dinfo[1])
mother_index = mother_index + 1
- elif person.getGender() == RelLib.Person.male:
+ elif dinfo[2] == const.male:
self.father_list.append(rdata)
- self.father_list.set_row_data(father_index,person)
+ self.father_list.set_row_data(father_index,dinfo[1])
father_index = father_index + 1
else:
self.mother_list.append(rdata)
- self.mother_list.set_row_data(mother_index,person)
+ self.mother_list.set_row_data(mother_index,dinfo[1])
mother_index = mother_index + 1
self.mother_list.select_row(msel,0)
@@ -213,10 +231,18 @@ class ChooseParents:
return family
def mother_list_select_row(self,obj,a,b,c):
- self.mother = obj.get_row_data(a)
+ id = obj.get_row_data(a)
+ if id:
+ self.mother = self.db.getPerson(id)
+ else:
+ self.mother = None
def father_list_select_row(self,obj,a,b,c):
- self.father = obj.get_row_data(a)
+ id = obj.get_row_data(a)
+ if id:
+ self.father = self.db.getPerson(id)
+ else:
+ self.father = None
def save_parents_clicked(self,obj):
mother_rel = const.childRelations[self.mother_rel.get_text()]
diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade
index 4aec80cba..828dff09c 100644
--- a/gramps/src/gramps.glade
+++ b/gramps/src/gramps.glade
@@ -5101,36 +5101,123 @@
select_row
on_fatherList_select_row
- 3
- 200,190,10
+ 4
+ 200,190,5,5
GTK_SELECTION_SINGLE
True
GTK_SHADOW_IN
- GtkLabel
+ GtkHBox
CList:title
- label81
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
+ hbox84
+ True
+ 0
+
+
+ GtkHBox
+ hbox85
+ False
+ 0
+
+ 0
+ False
+ False
+
+
+
+ GtkLabel
+ CList:title
+ label320
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GtkArrow
+ fname_arrow
+ 10
+ 10
+ GTK_ARROW_DOWN
+ GTK_SHADOW_OUT
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 5
+ False
+ True
+
+
+
- GtkLabel
+ GtkHBox
CList:title
- label82
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
+ hbox88
+ True
+ 0
+
+
+ GtkHBox
+ hbox89
+ False
+ 0
+
+ 0
+ False
+ False
+
+
+
+ GtkLabel
+ CList:title
+ label322
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GtkArrow
+ fbirth_arrow
+ 10
+ 10
+ False
+ GTK_ARROW_DOWN
+ GTK_SHADOW_OUT
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
@@ -5145,6 +5232,19 @@
0
0
+
+
+ GtkLabel
+ CList:title
+ label82b
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
@@ -5260,36 +5360,123 @@ Unknown
select_row
on_motherList_select_row
- 3
- 200,190,10
+ 4
+ 200,190,5,5
GTK_SELECTION_SINGLE
True
GTK_SHADOW_IN
- GtkLabel
+ GtkHBox
CList:title
- label84
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
+ hbox86
+ True
+ 0
+
+
+ GtkHBox
+ hbox87
+ False
+ 0
+
+ 0
+ False
+ False
+
+
+
+ GtkLabel
+ CList:title
+ label321
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GtkArrow
+ mname_arrow
+ 10
+ 10
+ GTK_ARROW_DOWN
+ GTK_SHADOW_OUT
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 5
+ False
+ True
+
+
+
- GtkLabel
+ GtkHBox
CList:title
- label85
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
+ hbox90
+ True
+ 0
+
+
+ GtkHBox
+ hbox91
+ False
+ 0
+
+ 0
+ False
+ False
+
+
+
+ GtkLabel
+ CList:title
+ label323
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GtkArrow
+ mbirth_arrow
+ 10
+ 10
+ False
+ GTK_ARROW_DOWN
+ GTK_SHADOW_OUT
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
@@ -5304,6 +5491,19 @@ Unknown
0
0
+
+
+ GtkLabel
+ CList:title
+ label85b
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
@@ -5370,7 +5570,7 @@ Unknown
True
True
0
-
+ Birth
@@ -5479,7 +5679,7 @@ Unknown
False
True
0
- Birth
+