diff --git a/gramps2/src/FamilyView.py b/gramps2/src/FamilyView.py index f8125609f..465735397 100644 --- a/gramps2/src/FamilyView.py +++ b/gramps2/src/FamilyView.py @@ -899,9 +899,10 @@ class FamilyView: def find_marriage(self,family): for event_id in family.get_event_list(): - event = self.parent.db.find_event_from_id(event_id) - if event and event.get_name() == "Marriage": - return event + if event_id: + event = self.parent.db.find_event_from_id(event_id) + if event.get_name() == "Marriage": + return event return None def update_list(self,model,tree,person): diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py index 61a9237c7..e8bc31977 100644 --- a/gramps2/src/ReadXML.py +++ b/gramps2/src/ReadXML.py @@ -144,29 +144,30 @@ def importData(database, filename, callback,cl=0): #------------------------------------------------------------------------- def remove_clicked(): # File is lost => remove all references and the object itself - mobj = ObjectMap[NewMediaID] - for p in database.get_family_id_map().values(): + mobj = database.find_object_from_id(NewMediaID) + for fid in database.get_family_keys(): + p = database.find_family_from_id(fid) nl = p.get_media_list() for o in nl: if o.get_reference() == mobj: nl.remove(o) p.set_media_list(nl) for key in database.get_person_keys(): - p = database.get_person(key) + p = database.find_person_from_id(key) nl = p.get_media_list() for o in nl: - if o.get_reference() == mobj: + if o.get_reference_id() == mobj.get_id(): nl.remove(o) p.set_media_list(nl) for key in database.get_source_keys(): - p = database.get_source(key) + p = database.find_source_from_id(key) nl = p.get_media_list() for o in nl: - if o.get_reference() == mobj: + if o.get_reference_id() == mobj.get_id(): nl.remove(o) p.set_media_list(nl) for key in database.get_place_id_keys(): - p = database.get_place_id(key) + p = database.find_place_from_id(key) nl = p.get_media_list() for o in nl: if o.get_reference() == mobj: @@ -201,8 +202,6 @@ def importData(database, filename, callback,cl=0): fs_top.run() fs_top.destroy() -#------------------------------------------------------------------------- - # # Rename media files if they were conflicting with existing ones # newpath = database.get_save_path() # for old_media_id in parser.media_file_map.keys(): diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index a1472d0ad..f893a9f88 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -1961,6 +1961,7 @@ class Family(SourceNote): def add_event_id(self,event_id): """adds an Event to the event list""" + assert(event_id != None) self.event_list.append(event_id) def get_event_list(self) : @@ -2901,12 +2902,12 @@ class GrampsDB: if map.has_key(str(idVal)): place = Place() - data = self.place_map[map[str(idVal)]] + data = self.place_map[str(map[idVal])] place.unserialize(data) else: place = Place() if self.place_map.has_key(str(idVal)): - map[str(idVal)] = self.add_place(place) + map[idVal] = self.add_place(place) else: place.set_id(str(idVal)) map[str(idVal)] = self.add_place_as(place) @@ -3108,7 +3109,7 @@ class GrampsDB: family = self.new_family() else: family = self.new_family_no_map(str(idVal)) - map[str(idVal)] = family.get_id() + map[idVal] = family.get_id() return family def find_source_no_conflicts(self,idVal,map): diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index cea64db52..bbfa4104c 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -51,7 +51,7 @@ - + True gtk-new 1 @@ -73,7 +73,7 @@ - + True gtk-open 1 @@ -107,7 +107,7 @@ True - + True gtk-convert 1 @@ -120,27 +120,6 @@ - - - True - _Revert - True - - - - - True - gtk-revert-to-saved - 1 - 0.5 - 0.5 - 0 - 0 - - - - - True @@ -149,7 +128,7 @@ - + True gtk-refresh 1 @@ -177,7 +156,7 @@ - + True gtk-quit 1 @@ -213,7 +192,7 @@ - + True gtk-add 1 @@ -236,7 +215,7 @@ - + True gtk-remove 1 @@ -274,7 +253,7 @@ - + True gtk-find 1 @@ -296,7 +275,7 @@ - + True gtk-convert 1 @@ -323,7 +302,7 @@ - + True gtk-preferences 1 @@ -344,7 +323,7 @@ - + True gtk-home 1 @@ -430,7 +409,7 @@ - + True gtk-index 1 @@ -452,7 +431,7 @@ - + True gnome-stock-book-open 1 @@ -525,7 +504,7 @@ - + True gtk-help 1 @@ -546,7 +525,7 @@ - + True gnome-stock-book-open 1 @@ -573,7 +552,7 @@ - + True gtk-jump-to 1 @@ -594,7 +573,7 @@ - + True gnome-stock-mail 1 @@ -648,7 +627,7 @@ - + True gnome-stock-about 1 diff --git a/gramps2/src/plugins/ReadGedcom.py b/gramps2/src/plugins/ReadGedcom.py index a695ffbc1..77ef3e300 100644 --- a/gramps2/src/plugins/ReadGedcom.py +++ b/gramps2/src/plugins/ReadGedcom.py @@ -667,9 +667,10 @@ class GedcomParser: event.set_name(matches[1]) if event.get_name() == "Marriage": self.family.set_relationship("Married") + self.db.add_event(event) self.family.add_event_id(event.get_id()) self.parse_family_event(event,2) - self.db.add_event(event) + self.db.commit_event(event) def parse_note_base(self,matches,obj,level,old_note,task): note = old_note diff --git a/gramps2/src/plugins/ReadNative.py b/gramps2/src/plugins/ReadNative.py index 5b9b65bc6..cb1fbb8e9 100644 --- a/gramps2/src/plugins/ReadNative.py +++ b/gramps2/src/plugins/ReadNative.py @@ -90,7 +90,7 @@ class ReadNative: DisplayTrace.DisplayTrace() self.window.destroy() - self.callback(1) + self.callback() def progress(self,val): self.progress_bar.set_fraction(val)