diff --git a/ChangeLog b/ChangeLog index 1913e01e0..6035647e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-09 Benny Malengier + * src/glade/gramps.glade: fix #797 + * src/glade/gramps.glade: fix #796 + * src/GrampsDbUtils/_ReadXML.py: Set specific notetype on import/read of pre 2.3 xml, + inherit privacy of creating object for pre 2.3 xml as much as possible. + 2007-05-08 Brian Matherly * src/plugins/NarrativeWeb.py: Change the default directory so people don't generate the report in their database directory. diff --git a/TODO b/TODO index 751da7cea..a7dcd6106 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,8 @@ in a report --> Support for multiple notes in all reports. --> Empty text field on Saving Note should throw an error that Note is empty ! (?) + --> Undo in Note. Serious editing needs an undo function. Furthermore, the function + the Clear icon is unclear: tooltip? Other icon? * Split views diff --git a/src/GrampsDbUtils/_ReadXML.py b/src/GrampsDbUtils/_ReadXML.py index cc5b847d7..d478e7291 100644 --- a/src/GrampsDbUtils/_ReadXML.py +++ b/src/GrampsDbUtils/_ReadXML.py @@ -743,6 +743,8 @@ class GrampsParser(UpdateCallback): note = RelLib.Note() note.handle = Utils.create_id() note.set(_("Witness name: %s") % attrs['name']) + note.type.set(RelLib.NoteType.EVENT) + note.private = self.event.private self.db.add_note(note,self.trans) self.event.add_note(note.handle) return @@ -1130,11 +1132,68 @@ class GrampsParser(UpdateCallback): self.note.type.set_from_xml_str(attrs['type']) else: # GRAMPS LEGACY: old notes that were written inside other objects - # We need to create a top-level note. + # We need to create a top-level note, it's type depends on + # the caller object, and inherits privacy from caller object # On stop_note the reference to this note will be added self.note = RelLib.Note() self.note.handle = Utils.create_id() self.note.format = int(attrs.get('format',RelLib.Note.FLOWED)) + if self.source_ref: + self.note.type.set(RelLib.NoteType.SOURCEREF) + # self.note.private = ... sourceref has no private ?? + elif self.address: + self.note.type.set(RelLib.NoteType.ADDRESS) + self.note.private = self.address.private + elif self.ord: + self.note.type.set(elLib.NoteType.LDS) + # self.note.private = ... lds_ord has no private ?? + elif self.attribute: + self.note.type.set(RelLib.NoteType.ATTRIBUTE) + self.note.private = self.attribute.private + elif self.object: + self.note.type.set(RelLib.NoteType.MEDIA) + # self.note.private = ... object has no private ?? + elif self.objref: + self.note.type.set(RelLib.NoteType.MEDIAREF) + self.note.private = self.objref.private + elif self.photo: + self.note.type.set(RelLib.NoteType.MEDIA) + # ?? photo no privacy? only pref: self.pref.get_privacy()?? + elif self.name: + self.note.type.set(RelLib.NoteType.PERSONNAME) + # ?? error in self.name ?? set_private instead of private ?? + self.note.private = self.name.set_private + elif self.source: + self.note.type.set(RelLib.NoteType.SOURCE) + # ?? self.note.private = self.source. ?? no private ?? + elif self.event: + self.note.type.set(RelLib.NoteType.EVENT) + self.note.private = self.event.private + elif self.personref: + self.note.type.set(RelLib.NoteType.ASSOCIATION) + self.note.private = self.personref.private + elif self.person: + self.note.type.set(RelLib.NoteType.PERSON) + # ?? self.note.private = self.person ... ?? no private ?? + elif self.childref: + self.note.type.set(RelLib.NoteType.CHILDREF) + self.note.private = self.childref.private + elif self.family: + self.note.type.set(RelLib.NoteType.FAMILY) + # ?? self.note.private = self.family ... ?? no private ?? + elif self.placeobj: + self.note.type.set(RelLib.NoteType.PLACE) + # ?? self.note.private = self.family ... ?? no private ?? + elif self.eventref: + self.note.type.set(RelLib.NoteType.EVENTREF) + self.note.private = self.eventref.private + elif self.repo: + self.note.type.set(RelLib.NoteType.REPO) + # ?? self.note.private = self.repo ... ?? no private ?? + elif self.reporef: + self.note.type.set(RelLib.NoteType.REPOREF) + # reporef has no private, correct + self.db.add_note(self.note,self.trans) def start_noteref(self,attrs): @@ -1537,6 +1596,8 @@ class GrampsParser(UpdateCallback): note = RelLib.Note() note.handle = Utils.create_id() note.set(_("Witness comment: %s") % text) + note.type.set(RelLib.NoteType.EVENT) + note.private = self.event.private self.db.add_note(note,self.trans) self.event.add_note(note.handle) self.in_witness = False @@ -1641,6 +1702,8 @@ class GrampsParser(UpdateCallback): note = RelLib.Note() note.handle = Utils.create_id() note.set(_("Witness name: %s") % tag) + note.type.set(RelLib.NoteType.EVENT) + note.private = self.event.private self.db.add_note(note,self.trans) self.event.add_note(note.handle) elif self.alt_name: @@ -1787,6 +1850,7 @@ class GrampsParser(UpdateCallback): note = RelLib.Note() note.handle = Utils.create_id() note.set(text) + note.type.set(RelLib.NoteType.SOURCEREF) self.db.add_note(note,self.trans) self.source_ref.add_note(note.handle) diff --git a/src/glade/gramps.glade b/src/glade/gramps.glade index 84a3dc00a..f283f8e94 100644 --- a/src/glade/gramps.glade +++ b/src/glade/gramps.glade @@ -1813,7 +1813,7 @@ 0.5 0 0 - city + street PANGO_ELLIPSIZE_NONE -1 False @@ -6801,6 +6801,7 @@ 0.5 0 0 + personal_events PANGO_ELLIPSIZE_NONE -1 False @@ -6969,6 +6970,7 @@ 0.5 0 3 + select_place PANGO_ELLIPSIZE_NONE -1 False @@ -10521,6 +10523,7 @@ 0.5 0 0 + eer_type_combo PANGO_ELLIPSIZE_NONE -1 False @@ -10612,7 +10615,7 @@ 0.5 0 3 - eer_place + share_place PANGO_ELLIPSIZE_NONE -1 False