Update
svn: r2898
This commit is contained in:
parent
7bf9bcc6d1
commit
40121ad918
@ -368,8 +368,10 @@ class DelSrcQuery:
|
|||||||
|
|
||||||
for key in self.db.get_person_keys():
|
for key in self.db.get_person_keys():
|
||||||
p = self.db.get_person(key)
|
p = self.db.get_person(key)
|
||||||
for v in p.get_event_list() + [p.get_birth(), p.get_death()]:
|
for v_id in p.get_event_list() + [p.get_birth_id(), p.get_death_id()]:
|
||||||
self.delete_source(v)
|
v = self.db.find_event_from_id(v_id)
|
||||||
|
if v:
|
||||||
|
self.delete_source(v)
|
||||||
|
|
||||||
for v in p.get_attribute_list():
|
for v in p.get_attribute_list():
|
||||||
self.delete_source(v)
|
self.delete_source(v)
|
||||||
@ -380,17 +382,22 @@ class DelSrcQuery:
|
|||||||
for v in p.get_address_list():
|
for v in p.get_address_list():
|
||||||
self.delete_source(v)
|
self.delete_source(v)
|
||||||
|
|
||||||
for p in self.db.get_family_id_map().values():
|
for p_id in self.db.get_family_keys():
|
||||||
for v in p.get_event_list():
|
p = self.db.find_family_from_id(p_id)
|
||||||
self.delete_source(v)
|
for v_id in p.get_event_list():
|
||||||
|
v = self.db.find_event_from_id(v_id)
|
||||||
|
if v:
|
||||||
|
self.delete_source(v)
|
||||||
|
|
||||||
for v in p.get_attribute_list():
|
for v in p.get_attribute_list():
|
||||||
self.delete_source(v)
|
self.delete_source(v)
|
||||||
|
|
||||||
for p in self.db.get_object_map().values():
|
for p_id in self.db.get_object_keys():
|
||||||
|
p = self.db.find_object_from_id(p_id)
|
||||||
self.delete_source(p)
|
self.delete_source(p)
|
||||||
|
|
||||||
for key in self.db.get_place_id_keys():
|
for key in self.db.get_place_id_keys():
|
||||||
self.delete_source(self.db.get_place_id(key))
|
p = self.db.find_place_from_id(key)
|
||||||
|
self.delete_source(self.db.find_place_from_id(key))
|
||||||
|
|
||||||
self.update(0)
|
self.update(0)
|
||||||
|
@ -2929,9 +2929,19 @@ class GrampsDB:
|
|||||||
return self.media_map.keys()
|
return self.media_map.keys()
|
||||||
|
|
||||||
def sortbysource(self,f,s):
|
def sortbysource(self,f,s):
|
||||||
f1 = self.source_map[f].title.upper()
|
if self.source_map.get(str(f)):
|
||||||
s1 = self.source_map[s].title.upper()
|
f1 = Source()
|
||||||
return cmp(f1,s1)
|
f1.unserialize(self.source_map.get(str(f)))
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
if self.source_map.get(str(s)):
|
||||||
|
s1 = Source()
|
||||||
|
s1.unserialize(self.source_map.get(str(s)))
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
f2 = f1.get_title().upper()
|
||||||
|
s2 = s1.get_title().upper()
|
||||||
|
return cmp(f2,s2)
|
||||||
|
|
||||||
def set_source_keys(self):
|
def set_source_keys(self):
|
||||||
keys = self.source_map.keys()
|
keys = self.source_map.keys()
|
||||||
|
@ -202,10 +202,12 @@ class SourceView:
|
|||||||
return 1
|
return 1
|
||||||
for key in self.db.get_person_keys():
|
for key in self.db.get_person_keys():
|
||||||
p = self.db.get_person(key)
|
p = self.db.get_person(key)
|
||||||
for v in p.get_event_list() + [p.get_birth(), p.get_death()]:
|
for v_id in p.get_event_list() + [p.get_birth_id(), p.get_death_id()]:
|
||||||
for sref in v.get_source_references():
|
v = self.db.find_event_from_id(v_id)
|
||||||
if sref.get_base_id() == source.get_id():
|
if v:
|
||||||
return 1
|
for sref in v.get_source_references():
|
||||||
|
if sref.get_base_id() == source.get_id():
|
||||||
|
return 1
|
||||||
for v in p.get_attribute_list():
|
for v in p.get_attribute_list():
|
||||||
for sref in v.get_source_references():
|
for sref in v.get_source_references():
|
||||||
if sref.get_base_id() == source.get_id():
|
if sref.get_base_id() == source.get_id():
|
||||||
@ -218,15 +220,19 @@ class SourceView:
|
|||||||
for sref in v.get_source_references():
|
for sref in v.get_source_references():
|
||||||
if sref.get_base_id() == source.get_id():
|
if sref.get_base_id() == source.get_id():
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.get_object_map().values():
|
for p_id in self.db.get_object_keys():
|
||||||
|
p = self.db.find_object_from_id(p_id)
|
||||||
for sref in p.get_source_references():
|
for sref in p.get_source_references():
|
||||||
if sref.get_base_id() == source.get_id():
|
if sref.get_base_id() == source.get_id():
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.get_family_id_map().values():
|
for p_id in self.db.get_family_keys():
|
||||||
for v in p.get_event_list():
|
p = self.db.find_family_from_id(p_id)
|
||||||
for sref in v.get_source_references():
|
for v_id in p.get_event_list():
|
||||||
if sref.get_base_id() == source.get_id():
|
v = self.db.find_event_from_id(v_id)
|
||||||
return 1
|
if v:
|
||||||
|
for sref in v.get_source_references():
|
||||||
|
if sref.get_base_id() == source.get_id():
|
||||||
|
return 1
|
||||||
for v in p.get_attribute_list():
|
for v in p.get_attribute_list():
|
||||||
for sref in v.get_source_references():
|
for sref in v.get_source_references():
|
||||||
if sref.get_base_id() == source.get_id():
|
if sref.get_base_id() == source.get_id():
|
||||||
|
@ -410,13 +410,14 @@ class SourceEditor:
|
|||||||
self.author_field.set_text("")
|
self.author_field.set_text("")
|
||||||
self.pub_field.set_text("")
|
self.pub_field.set_text("")
|
||||||
|
|
||||||
values = self.db.source_map.values()
|
keys = self.db.get_source_keys()
|
||||||
values.sort(by_title)
|
keys.sort(self.db.sortbysource)
|
||||||
|
|
||||||
sel_child = None
|
sel_child = None
|
||||||
self.list = []
|
self.list = []
|
||||||
self.active_source = sel
|
self.active_source = sel
|
||||||
for src in values:
|
for src_id in keys:
|
||||||
|
src = self.db.find_source_from_id(src_id)
|
||||||
l = gtk.Label("%s [%s]" % (src.get_title(),src.get_id()))
|
l = gtk.Label("%s [%s]" % (src.get_title(),src.get_id()))
|
||||||
l.show()
|
l.show()
|
||||||
l.set_alignment(0,0.5)
|
l.set_alignment(0,0.5)
|
||||||
|
Loading…
Reference in New Issue
Block a user