diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index d00368b1a..a033b4038 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,11 @@ +2006-04-27 Don Allingham + * src/GrampsDb/_GrampsDbBase.py: fix custom event storing + * src/GrampsDb/_GrampsBSDDB.py: fix custom event storing + * src/Editors/_EditEventRef.py: fix custom event storing + * src/Editors/_EditEvent.py: fix custom event storing + * src/GrampsWidgets.py: fix custom data types + * src/AutoComp.py: fix custom data types + 2006-04-27 Brian Matherly * src/docgen/OpenSpreadSheet.py: fix manifest so files open in calc diff --git a/gramps2/src/AutoComp.py b/gramps2/src/AutoComp.py index e78ee6742..8b5fa54b5 100644 --- a/gramps2/src/AutoComp.py +++ b/gramps2/src/AutoComp.py @@ -174,8 +174,13 @@ class StandardCustomSelector: index = index + 1 if self.additional: - for (value,data) in self.additional: - self.store.append(row=[value,data]) + for event_type in self.additional: + if type(event_type) == str: + self.store.append(row=[self.custom_key, event_type]) + elif type(event_type) == str: + self.store.append(row=[event_type[0], event_type[1]]) + else: + self.store.append(row=[int(event_type), str(event_type[1])]) if key == self.active_key: self.active_index = index index = index + 1 diff --git a/gramps2/src/Editors/_EditEvent.py b/gramps2/src/Editors/_EditEvent.py index 510bb5897..5715cc88d 100644 --- a/gramps2/src/Editors/_EditEvent.py +++ b/gramps2/src/Editors/_EditEvent.py @@ -101,6 +101,10 @@ class EditEvent(EditPrimary): ok.set_sensitive(not self.db.readonly) ok.connect('clicked',self.save) + def get_custom_events(self): + return self.dbstate.db.get_person_event_type_list() + \ + self.dbstate.db.get_family_event_types() + def _setup_fields(self): self.place_field = PlaceEntry( self.top.get_widget("eventPlace"), diff --git a/gramps2/src/Editors/_EditEventRef.py b/gramps2/src/Editors/_EditEventRef.py index bc7b3ba69..73006e126 100644 --- a/gramps2/src/Editors/_EditEventRef.py +++ b/gramps2/src/Editors/_EditEventRef.py @@ -84,8 +84,7 @@ class EditEventRef(EditReference): self.add_event = self.db.add_person_event def get_custom_events(self): - return [ (RelLib.EventType.CUSTOM,val) \ - for val in self.dbstate.db.get_person_event_types()] + return self.db.get_person_event_type_list() def _connect_signals(self): self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked) diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index b44272e6a..f0502cd76 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -938,11 +938,6 @@ class GrampsBSDDB(GrampsDbBase): vals.sort() return [item[1] for item in vals] - def get_person_event_type_list(self): - vals = [ unicode(val) for val in set(self.eventnames.keys()) ] - vals.sort(locale.strcoll) - return vals - def get_repository_type_list(self): vals = list(set(self.repository_types.keys())) vals.sort(locale.strcoll) diff --git a/gramps2/src/GrampsDb/_GrampsDbBase.py b/gramps2/src/GrampsDb/_GrampsDbBase.py index 847f7f68e..d615b3b8f 100644 --- a/gramps2/src/GrampsDb/_GrampsDbBase.py +++ b/gramps2/src/GrampsDb/_GrampsDbBase.py @@ -465,7 +465,6 @@ class GrampsDbBase(GrampsDBCallback): Commits the specified Event to the database, storing the changes as part of the transaction. """ - self._commit_base(event, self.event_map, EVENT_KEY, transaction.event_update, transaction.event_add, transaction, change_time) diff --git a/gramps2/src/GrampsWidgets.py b/gramps2/src/GrampsWidgets.py index fc679a9e4..8f370cf33 100644 --- a/gramps2/src/GrampsWidgets.py +++ b/gramps2/src/GrampsWidgets.py @@ -389,7 +389,6 @@ class MonitoredDataType: def on_change(self, obj): value = self.fix_value(self.sel.get_values()) self.set_val(value) - print value, self.get_val() class MonitoredMenu: