Patches from David Hamption - .cvsignore addtions and sorting

svn: r395
This commit is contained in:
Don Allingham 2001-09-08 23:27:16 +00:00
parent 23cd9c9052
commit 81a0efe5e9
10 changed files with 47 additions and 7 deletions

5
gramps/.cvsignore Normal file
View File

@ -0,0 +1,5 @@
Makefile
config.cache
config.log
config.status
gramps.sh

3
gramps/src/.cvsignore Normal file
View File

@ -0,0 +1,3 @@
Makefile
*.pyc
*.pyo

View File

@ -775,6 +775,7 @@
<class>GtkEntry</class> <class>GtkEntry</class>
<name>givenName</name> <name>givenName</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<has_focus>True</has_focus>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>

View File

@ -1301,6 +1301,7 @@ class SourceRef:
return 0 return 0
if self.getComments() != other.getComments(): if self.getComments() != other.getComments():
return 0 return 0
return 1
elif not self.ref and not other.ref: elif not self.ref and not other.ref:
return 1 return 1
else: else:

View File

@ -0,0 +1,3 @@
Makefile
*.pyc
*.pyo

View File

@ -5105,6 +5105,7 @@ Unknown
<name>childGiven</name> <name>childGiven</name>
<width>250</width> <width>250</width>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<has_focus>True</has_focus>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>

View File

@ -423,6 +423,7 @@ def redraw_child_list(filter):
for c in f.getChildList(): for c in f.getChildList():
slist.append(c) slist.append(c)
personmap = {}
for person in person_list: for person in person_list:
if filter: if filter:
if person in slist: if person in slist:
@ -463,6 +464,12 @@ def redraw_child_list(filter):
if pbday.getLowYear() > dday.getHighYear() + 150: if pbday.getLowYear() > dday.getHighYear() + 150:
continue continue
personmap[utils.phonebook_name(person)] = person
keynames = personmap.keys()
keynames.sort()
for key in keynames:
person = personmap[key]
add_child_win.append([utils.phonebook_name(person),birthday(person),\ add_child_win.append([utils.phonebook_name(person),birthday(person),\
person.getId()]) person.getId()])
add_child_win.set_row_data(index,person) add_child_win.set_row_data(index,person)

View File

@ -0,0 +1,3 @@
Makefile
*.pyc
*.pyo

View File

@ -881,9 +881,12 @@ class GedcomParser:
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def parse_person_event(self,event,level): def parse_person_event(self,event,level):
note = ""
while 1: while 1:
matches = self.get_next() matches = self.get_next()
if int(matches[0]) < level: if int(matches[0]) < level:
if note != "":
event.setNote(note)
self.backup() self.backup()
break break
elif matches[1] == "TYPE": elif matches[1] == "TYPE":
@ -895,12 +898,10 @@ class GedcomParser:
event.setName(name) event.setName(name)
elif matches[1] == "DATE": elif matches[1] == "DATE":
event.setDate(matches[2]) event.setDate(matches[2])
elif matches[1] == "TIME": elif matches[1] == "TIME" or matches[1] == "ADDR":
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] == "AGE" or matches[1] == "AGNC": elif matches[1] == "AGE" or matches[1] == "AGNC":
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] == "CAUS" or matches[1] == "ADDR":
self.ignore_sub_junk(level+1)
elif matches[1] == "STAT" or matches[1] == "TEMP": elif matches[1] == "STAT" or matches[1] == "TEMP":
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] == "OBJE" or matches[1] == "QUAY": elif matches[1] == "OBJE" or matches[1] == "QUAY":
@ -912,9 +913,8 @@ class GedcomParser:
ref = "gsr%d" % self.localref ref = "gsr%d" % self.localref
s = self.db.findSource(ref,self.smap) s = self.db.findSource(ref,self.smap)
source_ref.setBase(s) source_ref.setBase(s)
note = matches[2] + self.parse_continue_data(1)
s.setTitle('Imported Source #%d' % self.localref) s.setTitle('Imported Source #%d' % self.localref)
s.setNote(note) s.setNote(matches[2] + self.parse_continue_data(1))
self.ignore_sub_junk(2) self.ignore_sub_junk(2)
else: else:
source_ref.setBase(self.db.findSource(matches[2],self.smap)) source_ref.setBase(self.db.findSource(matches[2],self.smap))
@ -941,8 +941,18 @@ class GedcomParser:
self.db.addPlace(place) self.db.addPlace(place)
event.setPlace(place) event.setPlace(place)
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] == "CAUS":
info = matches[2] + self.parse_continue_data(level+1)
if note == "":
note = "%s: %s" % (_("Cause of Death"), info)
else:
note = "%s\n%s: %s" % (note,_("Cause of Death"), info)
elif matches[1] == "NOTE": elif matches[1] == "NOTE":
note = matches[2] + self.parse_continue_data(level+1) info = matches[2] + self.parse_continue_data(level+1)
if note == "":
note = info
else:
note = "\n%s" % info
elif matches[1] == "CONC": elif matches[1] == "CONC":
event.setDescription( "%s %s" % (event.getDescription(), matches[2])) event.setDescription( "%s %s" % (event.getDescription(), matches[2]))
elif matches[1] == "CONT": elif matches[1] == "CONT":

View File

@ -281,8 +281,14 @@ def attach_places(values,combo,place):
sel_child = c sel_child = c
list = [c] list = [c]
mymap = {} mymap = {}
placenamemap = {}
for src in values: for src in values:
l = gtk.GtkLabel("%s [%s]" % (src.get_title(),src.getId())) placenamemap["%s [%s]" % (src.get_title(),src.getId())] = src
placenames = placenamemap.keys()
placenames.sort()
for key in placenames:
src = placenamemap[key]
l = gtk.GtkLabel(key)
l.show() l.show()
l.set_alignment(0,0.5) l.set_alignment(0,0.5)
c = gtk.GtkListItem() c = gtk.GtkListItem()