ReadGedcom patch from Mark Lewis, Filter update for event match problem, improved Find for ZODB
svn: r1022
This commit is contained in:
parent
8479515577
commit
bef3d944bf
@ -43,7 +43,7 @@ import libglade
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import RelLib
|
import RelLib
|
||||||
import const
|
import const
|
||||||
import sort
|
import Sorter
|
||||||
import Utils
|
import Utils
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
|
|
||||||
@ -82,8 +82,13 @@ class AddSpouse:
|
|||||||
self.ok = self.glade.get_widget('spouse_ok')
|
self.ok = self.glade.get_widget('spouse_ok')
|
||||||
|
|
||||||
self.ok.set_sensitive(0)
|
self.ok.set_sensitive(0)
|
||||||
self.name_list = self.db.getPersonMap().values()
|
arrow_map = [(2,self.glade.get_widget('NameArrow')),
|
||||||
self.name_list.sort(sort.by_last_name)
|
(3,self.glade.get_widget('DateArrow'))]
|
||||||
|
|
||||||
|
self.spouse_list.set_column_visibility(2,0)
|
||||||
|
self.spouse_list.set_column_visibility(3,0)
|
||||||
|
self.sorter = Sorter.Sorter(self.spouse_list,arrow_map,'spouse',self.top)
|
||||||
|
self.name_list = self.db.getPersonKeys()
|
||||||
self.rel_combo.set_popdown_strings(const.familyRelations)
|
self.rel_combo.set_popdown_strings(const.familyRelations)
|
||||||
title = _("Choose Spouse/Partner of %s") % GrampsCfg.nameof(person)
|
title = _("Choose Spouse/Partner of %s") % GrampsCfg.nameof(person)
|
||||||
self.glade.get_widget("spouseTitle").set_text(title)
|
self.glade.get_widget("spouseTitle").set_text(title)
|
||||||
@ -127,11 +132,11 @@ class AddSpouse:
|
|||||||
QuickAdd.QuickAdd(self.db,gen,self.update_list)
|
QuickAdd.QuickAdd(self.db,gen,self.update_list)
|
||||||
|
|
||||||
def update_list(self,person):
|
def update_list(self,person):
|
||||||
self.name_list.append(person)
|
self.name_list.append(person.getId())
|
||||||
self.name_list.sort(sort.by_last_name)
|
|
||||||
self.addperson(person)
|
self.addperson(person)
|
||||||
self.relation_type_changed(self.relation_type)
|
self.relation_type_changed(self.relation_type)
|
||||||
row = self.spouse_list.find_row_from_data(person)
|
row = self.spouse_list.find_row_from_data(person)
|
||||||
|
self.sorter.sort_list()
|
||||||
self.spouse_list.select_row(row,0)
|
self.spouse_list.select_row(row,0)
|
||||||
self.spouse_list.moveto(row,0)
|
self.spouse_list.moveto(row,0)
|
||||||
|
|
||||||
@ -143,7 +148,7 @@ class AddSpouse:
|
|||||||
if len(self.spouse_list.selection) == 0:
|
if len(self.spouse_list.selection) == 0:
|
||||||
return
|
return
|
||||||
row = self.spouse_list.selection[0]
|
row = self.spouse_list.selection[0]
|
||||||
spouse = self.spouse_list.get_row_data(row)
|
spouse = self.db.getPerson(self.spouse_list.get_row_data(row))
|
||||||
|
|
||||||
# don't do anything if the marriage already exists
|
# don't do anything if the marriage already exists
|
||||||
for f in self.person.getFamilyList():
|
for f in self.person.getFamilyList():
|
||||||
@ -188,13 +193,15 @@ class AddSpouse:
|
|||||||
index = 0
|
index = 0
|
||||||
self.spouse_list.clear()
|
self.spouse_list.clear()
|
||||||
self.spouse_list.freeze()
|
self.spouse_list.freeze()
|
||||||
for person in self.name_list:
|
for key in self.name_list:
|
||||||
|
person = self.db.getPerson(key)
|
||||||
if person.getGender() == gender:
|
if person.getGender() == gender:
|
||||||
continue
|
continue
|
||||||
name = person.getPrimaryName().getName()
|
data = person.getDisplayInfo()
|
||||||
self.spouse_list.append([name,Utils.birthday(person)])
|
self.spouse_list.append([data[0],data[3],data[5],data[6]])
|
||||||
self.spouse_list.set_row_data(index,person)
|
self.spouse_list.set_row_data(index,key)
|
||||||
index = index + 1
|
index = index + 1
|
||||||
|
self.sorter.sort_list()
|
||||||
self.spouse_list.thaw()
|
self.spouse_list.thaw()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -280,7 +287,7 @@ class SetSpouse:
|
|||||||
if len(self.spouse_list.selection) == 0:
|
if len(self.spouse_list.selection) == 0:
|
||||||
return
|
return
|
||||||
row = self.spouse_list.selection[0]
|
row = self.spouse_list.selection[0]
|
||||||
spouse = self.spouse_list.get_row_data(row)
|
spouse = self.db.getPerson(self.spouse_list.get_row_data(row))
|
||||||
|
|
||||||
# don't do anything if the marriage already exists
|
# don't do anything if the marriage already exists
|
||||||
for f in self.person.getFamilyList():
|
for f in self.person.getFamilyList():
|
||||||
|
@ -56,13 +56,14 @@ _ = gettext
|
|||||||
class FindBase:
|
class FindBase:
|
||||||
"""Opens find person dialog for gramps"""
|
"""Opens find person dialog for gramps"""
|
||||||
|
|
||||||
def __init__(self,clist,task,name):
|
def __init__(self,clist,task,name,db):
|
||||||
"""Opens a dialog box instance that allows users to
|
"""Opens a dialog box instance that allows users to
|
||||||
search for a person.
|
search for a person.
|
||||||
|
|
||||||
clist - GtkCList containing the people information
|
clist - GtkCList containing the people information
|
||||||
task - function to call to change the active person"""
|
task - function to call to change the active person"""
|
||||||
|
|
||||||
|
self.db = db
|
||||||
self.clist = clist
|
self.clist = clist
|
||||||
self.nlist = []
|
self.nlist = []
|
||||||
self.task = task
|
self.task = task
|
||||||
@ -84,12 +85,36 @@ class FindBase:
|
|||||||
self.top.editable_enters(self.entry)
|
self.top.editable_enters(self.entry)
|
||||||
self.entry.grab_focus()
|
self.entry.grab_focus()
|
||||||
|
|
||||||
|
def get_value(self,id):
|
||||||
|
return None
|
||||||
|
|
||||||
def enable_autocomp(self):
|
def enable_autocomp(self):
|
||||||
if GrampsCfg.autocomp:
|
if GrampsCfg.autocomp:
|
||||||
self.comp = AutoComp.AutoEntry(self.entry,self.nlist)
|
self.comp = AutoComp.AutoEntry(self.entry,self.nlist)
|
||||||
|
|
||||||
def advance(self,func):
|
def advance(self,func):
|
||||||
pass
|
try:
|
||||||
|
self.row = self.clist.selection[0]
|
||||||
|
except IndexError:
|
||||||
|
gtk.gdk_beep()
|
||||||
|
return
|
||||||
|
|
||||||
|
text = self.entry.get_text()
|
||||||
|
if self.row == None or text == "":
|
||||||
|
gtk.gdk_beep()
|
||||||
|
return
|
||||||
|
orow = self.row
|
||||||
|
func()
|
||||||
|
while self.row != orow:
|
||||||
|
id = self.clist.get_row_data(self.row)
|
||||||
|
if id == None:
|
||||||
|
func()
|
||||||
|
continue
|
||||||
|
if string.find(string.upper(self.get_value(id)),string.upper(text)) >= 0:
|
||||||
|
self.task(self.row)
|
||||||
|
return
|
||||||
|
func()
|
||||||
|
gtk.gdk_beep()
|
||||||
|
|
||||||
def forward(self):
|
def forward(self):
|
||||||
self.row = self.row + 1
|
self.row = self.row + 1
|
||||||
@ -121,45 +146,22 @@ class FindBase:
|
|||||||
class FindPerson(FindBase):
|
class FindPerson(FindBase):
|
||||||
"""Opens a Find Person dialog for GRAMPS"""
|
"""Opens a Find Person dialog for GRAMPS"""
|
||||||
|
|
||||||
def __init__(self,clist,task,plist):
|
def __init__(self,clist,task,db):
|
||||||
"""Opens a dialog box instance that allows users to
|
"""Opens a dialog box instance that allows users to
|
||||||
search for a person.
|
search for a person.
|
||||||
|
|
||||||
clist - GtkCList containing the people information
|
clist - GtkCList containing the people information
|
||||||
task - function to call to change the active person"""
|
task - function to call to change the active person"""
|
||||||
|
|
||||||
FindBase.__init__(self,clist,task,_("Find Person"))
|
FindBase.__init__(self,clist,task,_("Find Person"),db)
|
||||||
for n in plist:
|
for n in self.db.getPersonKeys():
|
||||||
self.nlist.append(n.getPrimaryName().getName())
|
val = self.db.getPersonDisplay(n)
|
||||||
|
self.nlist.append(val[0])
|
||||||
self.enable_autocomp()
|
self.enable_autocomp()
|
||||||
|
|
||||||
def advance(self,func):
|
|
||||||
try:
|
|
||||||
self.row = self.clist.selection[0]
|
|
||||||
except IndexError:
|
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
|
|
||||||
text = self.entry.get_text()
|
def get_value(self,id):
|
||||||
if self.row == None or text == "":
|
return self.db.getPersonDisplay(id)[0]
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
orow = self.row
|
|
||||||
func()
|
|
||||||
person = None
|
|
||||||
while self.row != orow:
|
|
||||||
value = self.clist.get_row_data(self.row)
|
|
||||||
if value == None:
|
|
||||||
func()
|
|
||||||
continue
|
|
||||||
person,alt = value
|
|
||||||
if alt == 0:
|
|
||||||
name = person.getPrimaryName().getName()
|
|
||||||
if string.find(string.upper(name),string.upper(text)) >= 0:
|
|
||||||
self.task(person)
|
|
||||||
return
|
|
||||||
func()
|
|
||||||
gtk.gdk_beep()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -169,42 +171,20 @@ class FindPerson(FindBase):
|
|||||||
class FindPlace(FindBase):
|
class FindPlace(FindBase):
|
||||||
"""Opens a Find Place dialog for GRAMPS"""
|
"""Opens a Find Place dialog for GRAMPS"""
|
||||||
|
|
||||||
def __init__(self,clist,task,plist):
|
def __init__(self,clist,task,db):
|
||||||
"""Opens a dialog box instance that allows users to
|
"""Opens a dialog box instance that allows users to
|
||||||
search for a place.
|
search for a place.
|
||||||
|
|
||||||
clist - GtkCList containing the people information
|
clist - GtkCList containing the people information
|
||||||
task - function to call to change the active person"""
|
task - function to call to change the active person"""
|
||||||
|
|
||||||
FindBase.__init__(self,clist,task,_("Find Place"))
|
FindBase.__init__(self,clist,task,_("Find Place"),db)
|
||||||
for n in plist:
|
for n in self.db.getPlaceKeys():
|
||||||
self.nlist.append(n.get_title())
|
self.nlist.append(self.db.getPlaceDisplay(n)[0])
|
||||||
self.enable_autocomp()
|
self.enable_autocomp()
|
||||||
|
|
||||||
def advance(self,func):
|
def get_value(self,id):
|
||||||
try:
|
return self.db.getPlaceDisplay(id)[0]
|
||||||
self.row = self.clist.selection[0]
|
|
||||||
except IndexError:
|
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
|
|
||||||
text = self.entry.get_text()
|
|
||||||
if self.row == None or text == "":
|
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
orow = self.row
|
|
||||||
func()
|
|
||||||
while self.row != orow:
|
|
||||||
value = self.clist.get_row_data(self.row)
|
|
||||||
if value == None:
|
|
||||||
func()
|
|
||||||
continue
|
|
||||||
name = value.get_title()
|
|
||||||
if string.find(string.upper(name),string.upper(text)) >= 0:
|
|
||||||
self.task(self.row)
|
|
||||||
return
|
|
||||||
func()
|
|
||||||
gtk.gdk_beep()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -214,42 +194,20 @@ class FindPlace(FindBase):
|
|||||||
class FindSource(FindBase):
|
class FindSource(FindBase):
|
||||||
"""Opens a Find Place dialog for GRAMPS"""
|
"""Opens a Find Place dialog for GRAMPS"""
|
||||||
|
|
||||||
def __init__(self,clist,task,plist):
|
def __init__(self,clist,task,db):
|
||||||
"""Opens a dialog box instance that allows users to
|
"""Opens a dialog box instance that allows users to
|
||||||
search for a place.
|
search for a place.
|
||||||
|
|
||||||
clist - GtkCList containing the people information
|
clist - GtkCList containing the people information
|
||||||
task - function to call to change the active person"""
|
task - function to call to change the active person"""
|
||||||
|
|
||||||
FindBase.__init__(self,clist,task,_("Find Source"))
|
FindBase.__init__(self,clist,task,_("Find Source"),db)
|
||||||
for n in plist:
|
for n in self.db.getSourceKeys():
|
||||||
self.nlist.append(n.getTitle())
|
self.nlist.append(n[0])
|
||||||
self.enable_autocomp()
|
self.enable_autocomp()
|
||||||
|
|
||||||
def advance(self,func):
|
def get_value(self,id):
|
||||||
try:
|
return self.db.getSourceDisplay(id)[0]
|
||||||
self.row = self.clist.selection[0]
|
|
||||||
except IndexError:
|
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
|
|
||||||
text = self.entry.get_text()
|
|
||||||
if self.row == None or text == "":
|
|
||||||
gtk.gdk_beep()
|
|
||||||
return
|
|
||||||
orow = self.row
|
|
||||||
func()
|
|
||||||
while self.row != orow:
|
|
||||||
value = self.clist.get_row_data(self.row)
|
|
||||||
if value == None:
|
|
||||||
func()
|
|
||||||
continue
|
|
||||||
name = value.getTitle()
|
|
||||||
if string.find(string.upper(name),string.upper(text)) >= 0:
|
|
||||||
self.task(self.row)
|
|
||||||
return
|
|
||||||
func()
|
|
||||||
gtk.gdk_beep()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -413,12 +413,12 @@ class HasBirth(Rule):
|
|||||||
|
|
||||||
def apply(self,p):
|
def apply(self,p):
|
||||||
event = p.getBirth()
|
event = p.getBirth()
|
||||||
if self.list[2] and find(event.getDescription(),self.list[2])==-1:
|
if len(self.list) > 2 and find(event.getDescription(),self.list[2])==-1:
|
||||||
return 0
|
return 0
|
||||||
if self.date:
|
if self.date:
|
||||||
if date_cmp(self.date,event.getDateObj()) == 0:
|
if date_cmp(self.date,event.getDateObj()) == 0:
|
||||||
return 0
|
return 0
|
||||||
if self.list[1] and find(p.getPlaceName(),self.list[1]) == -1:
|
if len(self.list) > 1 and find(event.getPlaceName(),self.list[1]) == -1:
|
||||||
return 0
|
return 0
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -1986,6 +1986,10 @@ class GrampsDB(Persistent):
|
|||||||
"""returns a map of gramps's IDs to Family instances"""
|
"""returns a map of gramps's IDs to Family instances"""
|
||||||
return extmap(self.familyMap)
|
return extmap(self.familyMap)
|
||||||
|
|
||||||
|
def getFamily(self,id):
|
||||||
|
"""returns a map of gramps's IDs to Family instances"""
|
||||||
|
return self.familyMap[id]
|
||||||
|
|
||||||
def setFamilyMap(self,map):
|
def setFamilyMap(self,map):
|
||||||
"""sets the map of gramps's IDs to Family instances"""
|
"""sets the map of gramps's IDs to Family instances"""
|
||||||
self.familyMap = map
|
self.familyMap = map
|
||||||
|
@ -4661,12 +4661,9 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkScrolledWindow</class>
|
<class>GtkScrolledWindow</class>
|
||||||
<name>scrolledwindow9</name>
|
<name>scrolledwindow36</name>
|
||||||
<border_width>10</border_width>
|
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||||
<width>400</width>
|
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||||
<height>200</height>
|
|
||||||
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
|
|
||||||
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
|
|
||||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||||
<child>
|
<child>
|
||||||
@ -4678,28 +4675,143 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GtkCList</class>
|
<class>GtkCList</class>
|
||||||
<name>spouseList</name>
|
<name>spouseList</name>
|
||||||
|
<width>450</width>
|
||||||
|
<height>300</height>
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<signal>
|
<signal>
|
||||||
<name>select_row</name>
|
<name>select_row</name>
|
||||||
<handler>on_select_row</handler>
|
<handler>on_select_row</handler>
|
||||||
<last_modification_time>Fri, 29 Mar 2002 13:44:27 GMT</last_modification_time>
|
<last_modification_time>Sat, 01 Jun 2002 20:59:14 GMT</last_modification_time>
|
||||||
</signal>
|
</signal>
|
||||||
<signal>
|
<signal>
|
||||||
<name>unselect_row</name>
|
<name>unselect_row</name>
|
||||||
<handler>on_unselect_row</handler>
|
<handler>on_unselect_row</handler>
|
||||||
<last_modification_time>Fri, 29 Mar 2002 13:44:33 GMT</last_modification_time>
|
<last_modification_time>Sat, 01 Jun 2002 20:59:58 GMT</last_modification_time>
|
||||||
</signal>
|
</signal>
|
||||||
<columns>2</columns>
|
<columns>4</columns>
|
||||||
<column_widths>256,80</column_widths>
|
<column_widths>229,85,5,80</column_widths>
|
||||||
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
|
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
|
||||||
<show_titles>True</show_titles>
|
<show_titles>True</show_titles>
|
||||||
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
<shadow_type>GTK_SHADOW_IN</shadow_type>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<child_name>CList:title</child_name>
|
||||||
|
<name>hbox82</name>
|
||||||
|
<homogeneous>True</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<name>hbox83</name>
|
||||||
|
<homogeneous>False</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkLabel</class>
|
||||||
|
<child_name>CList:title</child_name>
|
||||||
|
<name>label315</name>
|
||||||
|
<label>Name</label>
|
||||||
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
|
<wrap>False</wrap>
|
||||||
|
<xalign>0.5</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkArrow</class>
|
||||||
|
<name>NameArrow</name>
|
||||||
|
<width>10</width>
|
||||||
|
<height>10</height>
|
||||||
|
<arrow_type>GTK_ARROW_DOWN</arrow_type>
|
||||||
|
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||||
|
<xalign>0.5</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>5</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>True</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<child_name>CList:title</child_name>
|
||||||
|
<name>hbox80</name>
|
||||||
|
<homogeneous>True</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<name>hbox81</name>
|
||||||
|
<homogeneous>False</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkLabel</class>
|
||||||
|
<child_name>CList:title</child_name>
|
||||||
|
<name>label311</name>
|
||||||
|
<label>Birth Date</label>
|
||||||
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
|
<wrap>False</wrap>
|
||||||
|
<xalign>0.5</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkArrow</class>
|
||||||
|
<name>DateArrow</name>
|
||||||
|
<width>10</width>
|
||||||
|
<height>10</height>
|
||||||
|
<visible>False</visible>
|
||||||
|
<arrow_type>GTK_ARROW_DOWN</arrow_type>
|
||||||
|
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||||
|
<xalign>0.5</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<child_name>CList:title</child_name>
|
<child_name>CList:title</child_name>
|
||||||
<name>label65</name>
|
<name>label318</name>
|
||||||
<label>Name</label>
|
<label></label>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
<wrap>False</wrap>
|
<wrap>False</wrap>
|
||||||
<xalign>0.5</xalign>
|
<xalign>0.5</xalign>
|
||||||
@ -4711,8 +4823,8 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<child_name>CList:title</child_name>
|
<child_name>CList:title</child_name>
|
||||||
<name>label66</name>
|
<name>label319</name>
|
||||||
<label>Birthdate</label>
|
<label></label>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
<wrap>False</wrap>
|
<wrap>False</wrap>
|
||||||
<xalign>0.5</xalign>
|
<xalign>0.5</xalign>
|
||||||
|
@ -330,25 +330,23 @@ class Gramps:
|
|||||||
def on_find_activate(self,obj):
|
def on_find_activate(self,obj):
|
||||||
"""Display the find box"""
|
"""Display the find box"""
|
||||||
if self.notebook.get_current_page() == 4:
|
if self.notebook.get_current_page() == 4:
|
||||||
Find.FindPlace(self.place_view.place_list,self.find_goto_place,
|
Find.FindPlace(self.place_view.place_list,self.find_goto_place,self.db)
|
||||||
self.db.getPlaceMap().values())
|
|
||||||
elif self.notebook.get_current_page() == 3:
|
elif self.notebook.get_current_page() == 3:
|
||||||
Find.FindSource(self.source_view.source_list,self.find_goto_source,
|
Find.FindSource(self.source_view.source_list,self.find_goto_source,self.db)
|
||||||
self.db.getSourceMap().values())
|
|
||||||
elif self.notebook.get_current_page() == 5:
|
elif self.notebook.get_current_page() == 5:
|
||||||
Find.FindMedia(self.media_view.media_list,self.find_goto_media,
|
Find.FindMedia(self.media_view.media_list,self.find_goto_media,
|
||||||
self.db.getObjectMap().values())
|
self.db.getObjectMap().values())
|
||||||
else:
|
else:
|
||||||
Find.FindPerson(self.person_list,self.find_goto_to,
|
Find.FindPerson(self.person_list,self.find_goto_to,self.db)
|
||||||
self.db.getPersonMap().values())
|
|
||||||
|
|
||||||
def on_findname_activate(self,obj):
|
def on_findname_activate(self,obj):
|
||||||
"""Display the find box"""
|
"""Display the find box"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def find_goto_to(self,person):
|
def find_goto_to(self,row):
|
||||||
"""Find callback to jump to the selected person"""
|
"""Find callback to jump to the selected person"""
|
||||||
self.change_active_person(person)
|
id = self.person_list.get_row_data(row)
|
||||||
|
self.change_active_person(self.db.getPerson(id))
|
||||||
self.goto_active_person()
|
self.goto_active_person()
|
||||||
self.update_display(0)
|
self.update_display(0)
|
||||||
|
|
||||||
@ -1290,9 +1288,9 @@ class Gramps:
|
|||||||
EditPerson.EditPerson(person, self.db, self.update_after_edit)
|
EditPerson.EditPerson(person, self.db, self.update_after_edit)
|
||||||
|
|
||||||
def build_spouse_dropdown(self):
|
def build_spouse_dropdown(self):
|
||||||
|
list = []
|
||||||
mymap = {}
|
mymap = {}
|
||||||
mynmap = {}
|
mynmap = {}
|
||||||
list = []
|
|
||||||
sel = None
|
sel = None
|
||||||
for f in self.active_person.getFamilyList():
|
for f in self.active_person.getFamilyList():
|
||||||
if self.active_person == f.getFather():
|
if self.active_person == f.getFather():
|
||||||
@ -1303,8 +1301,8 @@ class Gramps:
|
|||||||
list.append(c)
|
list.append(c)
|
||||||
if f == self.active_family or sel == None:
|
if f == self.active_family or sel == None:
|
||||||
sel = c
|
sel = c
|
||||||
mymap[f] = c
|
mynmap[f.getId()] = sname
|
||||||
mynmap[f] = sname
|
mymap[f.getId()] = c
|
||||||
self.spouse_combo.disable_activate()
|
self.spouse_combo.disable_activate()
|
||||||
self.spouse_combo.list.clear_items(0,-1)
|
self.spouse_combo.list.clear_items(0,-1)
|
||||||
self.spouse_combo.list.append_items(list)
|
self.spouse_combo.list.append_items(list)
|
||||||
@ -1706,10 +1704,13 @@ class Gramps:
|
|||||||
gnome.ui.GnomeErrorDialog(_("No default/home person has been set"))
|
gnome.ui.GnomeErrorDialog(_("No default/home person has been set"))
|
||||||
|
|
||||||
def on_add_bookmark_activate(self,obj):
|
def on_add_bookmark_activate(self,obj):
|
||||||
self.bookmarks.add(self.active_person)
|
if self.active_person:
|
||||||
name = GrampsCfg.nameof(self.active_person)
|
self.bookmarks.add(self.active_person)
|
||||||
self.statusbar.set_status(_("%s has been bookmarked") % name)
|
name = GrampsCfg.nameof(self.active_person)
|
||||||
gtk.timeout_add(5000,self.modify_statusbar)
|
self.statusbar.set_status(_("%s has been bookmarked") % name)
|
||||||
|
gtk.timeout_add(5000,self.modify_statusbar)
|
||||||
|
else:
|
||||||
|
GnomeWarningDialog(_("Bookmark could not be set because no one was selected"))
|
||||||
|
|
||||||
def on_edit_bookmarks_activate(self,obj):
|
def on_edit_bookmarks_activate(self,obj):
|
||||||
self.bookmarks.edit()
|
self.bookmarks.edit()
|
||||||
@ -1760,7 +1761,7 @@ class Gramps:
|
|||||||
if len(select) == 0:
|
if len(select) == 0:
|
||||||
self.active_family = None
|
self.active_family = None
|
||||||
else:
|
else:
|
||||||
self.active_family = select[0].get_data('d')
|
self.active_family = self.db.getFamily(select[0].get_data('d'))
|
||||||
|
|
||||||
if self.active_family == self.active_person.getFamilyList()[0]:
|
if self.active_family == self.active_person.getFamilyList()[0]:
|
||||||
self.pref_spouse.set_sensitive(0)
|
self.pref_spouse.set_sensitive(0)
|
||||||
|
@ -53,30 +53,30 @@ class PatchNames:
|
|||||||
self.title_list = []
|
self.title_list = []
|
||||||
self.nick_list = []
|
self.nick_list = []
|
||||||
|
|
||||||
personMap = self.db.getPersonMap()
|
for key in self.db.getPersonKeys():
|
||||||
for key in personMap.keys():
|
|
||||||
|
|
||||||
person = personMap[key]
|
person = self.db.getPerson(key)
|
||||||
first = person.getPrimaryName().getFirstName()
|
first = person.getPrimaryName().getFirstName()
|
||||||
match = _title_re.match(first)
|
match = _title_re.match(first)
|
||||||
if match:
|
if match:
|
||||||
groups = match.groups()
|
groups = match.groups()
|
||||||
self.title_list.append((person,groups[0],groups[1]))
|
self.title_list.append((key,groups[0],groups[1]))
|
||||||
|
|
||||||
match = _nick_re.match(first)
|
match = _nick_re.match(first)
|
||||||
if match:
|
if match:
|
||||||
groups = match.groups()
|
groups = match.groups()
|
||||||
self.nick_list.append((person,groups[0],groups[1]))
|
self.nick_list.append((key,groups[0],groups[1]))
|
||||||
|
|
||||||
msg = ""
|
msg = ""
|
||||||
if len(self.nick_list) > 0 or len(self.title_list) > 0:
|
if len(self.nick_list) > 0 or len(self.title_list) > 0:
|
||||||
for name in self.nick_list:
|
for (id,name,nick) in self.nick_list:
|
||||||
|
p = self.db.getPerson(id)
|
||||||
msg = msg + _("%s will be extracted as a nickname from %s\n") % \
|
msg = msg + _("%s will be extracted as a nickname from %s\n") % \
|
||||||
(name[2],name[0].getPrimaryName().getName())
|
(nick,p.getPrimaryName().getName())
|
||||||
|
|
||||||
for name in self.title_list:
|
for (id,title,nick) in self.title_list:
|
||||||
|
p = self.db.getPerson(id)
|
||||||
msg = msg + _("%s will be extracted as a title from %s\n") % \
|
msg = msg + _("%s will be extracted as a title from %s\n") % \
|
||||||
(name[0].getPrimaryName().getName(),name[1])
|
(title,p.getPrimaryName().getName())
|
||||||
|
|
||||||
base = os.path.dirname(__file__)
|
base = os.path.dirname(__file__)
|
||||||
glade_file = base + os.sep + "patchnames.glade"
|
glade_file = base + os.sep + "patchnames.glade"
|
||||||
@ -93,15 +93,19 @@ class PatchNames:
|
|||||||
|
|
||||||
def on_ok_clicked(self,obj):
|
def on_ok_clicked(self,obj):
|
||||||
for grp in self.nick_list:
|
for grp in self.nick_list:
|
||||||
name = grp[0].getPrimaryName()
|
p = self.db.getPerson(grp[0])
|
||||||
|
name = p.getPrimaryName()
|
||||||
name.setFirstName(grp[1])
|
name.setFirstName(grp[1])
|
||||||
grp[0].setNickName(grp[2])
|
p.setNickName(grp[2])
|
||||||
|
self.db.buildPersonDisplay(grp[0])
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
for grp in self.title_list:
|
for grp in self.title_list:
|
||||||
name = grp[0].getPrimaryName()
|
p = self.db.getPerson(grp[0])
|
||||||
|
name = p.getPrimaryName()
|
||||||
name.setFirstName(grp[2])
|
name.setFirstName(grp[2])
|
||||||
name.setTitle(grp[1])
|
name.setTitle(grp[1])
|
||||||
|
self.db.buildPersonDisplay(grp[0])
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
Utils.destroy_passed_object(obj)
|
Utils.destroy_passed_object(obj)
|
||||||
|
@ -1675,11 +1675,9 @@ class GedcomParser:
|
|||||||
self.db.removePerson(person.getId())
|
self.db.removePerson(person.getId())
|
||||||
person.setId(new_key)
|
person.setId(new_key)
|
||||||
self.db.addPersonAs(person)
|
self.db.addPersonAs(person)
|
||||||
# person currently using it was just added, change it
|
# give up trying to use the refn as a key
|
||||||
elif self.added.has_key(tp.getId()):
|
else:
|
||||||
self.db.removePerson(person.getId())
|
pass
|
||||||
person.setId(new_key)
|
|
||||||
self.db.addPersonAs(person)
|
|
||||||
|
|
||||||
self.db.pmapIndex = new_pmax
|
self.db.pmapIndex = new_pmax
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user