* src/EditPerson.py: Removed the conflict of using pmap for two seperate
purposes - mapping places to iterators and places to keys. The place to key map is now pdmap svn: r1719
This commit is contained in:
parent
1584227b86
commit
4670d84ab1
@ -84,12 +84,12 @@ class EditPerson:
|
|||||||
self.lists_changed = 0
|
self.lists_changed = 0
|
||||||
self.update_birth = 0
|
self.update_birth = 0
|
||||||
self.update_death = 0
|
self.update_death = 0
|
||||||
self.pmap = {}
|
self.pdmap = {}
|
||||||
self.add_places = []
|
self.add_places = []
|
||||||
|
|
||||||
for key in db.getPlaceKeys():
|
for key in db.getPlaceKeys():
|
||||||
p = db.getPlaceDisplay(key)
|
p = db.getPlaceDisplay(key)
|
||||||
self.pmap[p[0]] = key
|
self.pdmap[p[0]] = key
|
||||||
|
|
||||||
self.load_obj = None
|
self.load_obj = None
|
||||||
self.top = gtk.glade.XML(const.editPersonFile, "editPerson")
|
self.top = gtk.glade.XML(const.editPersonFile, "editPerson")
|
||||||
@ -214,7 +214,7 @@ class EditPerson:
|
|||||||
self.on_web_select_row,
|
self.on_web_select_row,
|
||||||
self.on_update_url_clicked)
|
self.on_update_url_clicked)
|
||||||
|
|
||||||
place_list = self.pmap.keys()
|
place_list = self.pdmap.keys()
|
||||||
place_list.sort()
|
place_list.sort()
|
||||||
self.autoplace = AutoComp.AutoCombo(self.bpcombo, place_list)
|
self.autoplace = AutoComp.AutoCombo(self.bpcombo, place_list)
|
||||||
self.autodeath = AutoComp.AutoCombo(self.dpcombo, place_list, self.autoplace)
|
self.autodeath = AutoComp.AutoCombo(self.dpcombo, place_list, self.autoplace)
|
||||||
@ -946,16 +946,16 @@ class EditPerson:
|
|||||||
bplace = string.strip(self.bplace.get_text())
|
bplace = string.strip(self.bplace.get_text())
|
||||||
dplace = string.strip(self.dplace.get_text())
|
dplace = string.strip(self.dplace.get_text())
|
||||||
|
|
||||||
if self.pmap.has_key(bplace):
|
if self.pdmap.has_key(bplace):
|
||||||
p1 = self.db.getPlaceMap()[self.pmap[bplace]]
|
p1 = self.db.getPlaceMap()[self.pdmap[bplace]]
|
||||||
else:
|
else:
|
||||||
p1 = None
|
p1 = None
|
||||||
if bplace != "":
|
if bplace != "":
|
||||||
changed = 1
|
changed = 1
|
||||||
self.birth.setPlace(p1)
|
self.birth.setPlace(p1)
|
||||||
|
|
||||||
if self.pmap.has_key(dplace):
|
if self.pdmap.has_key(dplace):
|
||||||
p1 = self.db.getPlaceMap()[self.pmap[dplace]]
|
p1 = self.db.getPlaceMap()[self.pdmap[dplace]]
|
||||||
else:
|
else:
|
||||||
p1 = None
|
p1 = None
|
||||||
if dplace != "":
|
if dplace != "":
|
||||||
@ -1312,10 +1312,10 @@ class EditPerson:
|
|||||||
self.person.setNickName(nick)
|
self.person.setNickName(nick)
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
self.pmap.clear()
|
self.pdmap.clear()
|
||||||
for key in self.db.getPlaceKeys():
|
for key in self.db.getPlaceKeys():
|
||||||
p = self.db.getPlaceDisplay(key)
|
p = self.db.getPlaceDisplay(key)
|
||||||
self.pmap[p[0]] = key
|
self.pdmap[p[0]] = key
|
||||||
|
|
||||||
self.birth.setDate(self.bdate.get_text())
|
self.birth.setDate(self.bdate.get_text())
|
||||||
self.birth.setPlace(self.get_place(self.bplace,1))
|
self.birth.setPlace(self.get_place(self.bplace,1))
|
||||||
@ -1425,13 +1425,13 @@ class EditPerson:
|
|||||||
if type(text) != type(u' '):
|
if type(text) != type(u' '):
|
||||||
text = unicode(text)
|
text = unicode(text)
|
||||||
if text:
|
if text:
|
||||||
if self.pmap.has_key(text):
|
if self.pdmap.has_key(text):
|
||||||
return self.db.getPlaceMap()[self.pmap[text]]
|
return self.db.getPlaceMap()[self.pdmap[text]]
|
||||||
elif makenew:
|
elif makenew:
|
||||||
place = RelLib.Place()
|
place = RelLib.Place()
|
||||||
place.set_title(text)
|
place.set_title(text)
|
||||||
self.db.addPlace(place)
|
self.db.addPlace(place)
|
||||||
self.pmap[text] = place.getId()
|
self.pdmap[text] = place.getId()
|
||||||
self.add_places.append(place)
|
self.add_places.append(place)
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
return place
|
return place
|
||||||
|
Loading…
Reference in New Issue
Block a user