* src/Editors/_EditEventRef.py: new SelectPlace interface, remove

old code


svn: r6696
This commit is contained in:
Don Allingham 2006-05-17 20:21:16 +00:00
parent 9b03472a0a
commit 0a2c8f684f
2 changed files with 2 additions and 14 deletions

View File

@ -1,6 +1,7 @@
2006-05-17 Don Allingham <don@gramps-project.org> 2006-05-17 Don Allingham <don@gramps-project.org>
* src/Editors/_EditPlace.py: new SelectPlace interface * src/Editors/_EditPlace.py: new SelectPlace interface
* src/Editors/_EditEventRef.py: new SelectPlace interface * src/Editors/_EditEventRef.py: new SelectPlace interface, remove
old code
* src/Editors/_EditEvent.py: new SelectPlace interface * src/Editors/_EditEvent.py: new SelectPlace interface
* src/GrampsWidgets.py: new Place editor interface * src/GrampsWidgets.py: new Place editor interface

View File

@ -195,24 +195,11 @@ class EditEventRef(EditReference):
def ok_clicked(self,obj): def ok_clicked(self,obj):
(need_new, handle) = self.place_field.get_place_info()
if need_new:
place_obj = RelLib.Place()
place_obj.set_handle(Utils.create_id())
place_obj.set_title(handle)
self.source.set_place_handle(place_obj.get_handle())
else:
self.source.set_place_handle(handle)
trans = self.db.transaction_begin() trans = self.db.transaction_begin()
if self.source.handle: if self.source.handle:
if need_new:
self.db.add_place(place_obj,trans)
self.commit_event(self.source,trans) self.commit_event(self.source,trans)
self.db.transaction_commit(trans,_("Modify Event")) self.db.transaction_commit(trans,_("Modify Event"))
else: else:
if need_new:
self.db.add_place(place_obj,trans)
self.add_event(self.source,trans) self.add_event(self.source,trans)
self.db.transaction_commit(trans,_("Add Event")) self.db.transaction_commit(trans,_("Add Event"))
self.source_ref.ref = self.source.handle self.source_ref.ref = self.source.handle