diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f5f0ef812..7b7a7a6b6 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2003-12-10 Alex Roitman + * src/edit_person.glade: Add notes format radiobuttons. + * src/EditPerson.py: Support format for the person's notes. + * src/RelLib.py: More support for the notes' format. + 2003-12-10 Tim Waugh * doc/omf.make: Fixed DESTDIR support. diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index c458c2670..ebad2dcfe 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -119,6 +119,8 @@ class EditPerson: self.addr_edit_btn = self.top.get_widget('addr_edit_btn') self.notes_field = self.get_widget("personNotes") + self.flowed = self.get_widget("flowed") + self.preform = self.get_widget("preform") self.event_name_field = self.get_widget("eventName") self.event_place_field = self.get_widget("eventPlace") self.event_cause_field = self.get_widget("eventCause") @@ -298,8 +300,12 @@ class EditPerson: # set notes data self.notes_buffer = self.notes_field.get_buffer() - self.notes_buffer.set_text(person.getNote()) if person.getNote(): + self.notes_buffer.set_text(person.getNote()) + if person.getNoteObj().getFormat() == 1: + self.preform.set_active(1) + else: + self.flowed.set_active(1) Utils.bold_label(self.notes_label) self.event_list.drag_dest_set(gtk.DEST_DEFAULT_ALL,pycode_tgts,ACTION_COPY) @@ -1016,6 +1022,8 @@ class EditPerson: unknown = self.is_unknown.get_active() text = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(), self.notes_buffer.get_end_iter(),gtk.FALSE) + flowed = self.flowed.get_active() + preform = self.preform.get_active() idval = self.gid.get_text() changed = 0 @@ -1076,6 +1084,10 @@ class EditPerson: changed = 1 if text != self.person.getNote() or self.lists_changed: changed = 1 + if flowed and self.person.getNoteFormat() != 0: + changed = 1 + elif preform and self.person.getNoteFormat() != 1 : + changed = 1 if self.lds_not_loaded == 0: if not self.lds_baptism.are_equal(self.person.getLdsBaptism()): @@ -1496,6 +1508,13 @@ class EditPerson: self.person.setNote(text) Utils.modified() + flowed = self.flowed.get_active() + preform = self.preform.get_active() + if flowed and self.person.getNoteFormat() != 0: + self.person.setNoteFormat(0) + elif preform and self.person.getNoteFormat() != 1 : + self.person.setNoteFormat(1) + if self.complete.get_active() != self.person.getComplete(): self.person.setComplete(self.complete.get_active()) Utils.modified() diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index f44506275..10efc6559 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -108,6 +108,18 @@ class SourceNote: else: return self.note.get() + def setNoteFormat(self,val): + """Set the note's format to the given value""" + if self.note: + self.note.setFormat(val) + + def getNoteFormat(self): + """Return the current note's format""" + if self.note == None: + return 0 + else: + return self.note.getFormat() + def setNoteObj(self,obj): """Change the note object instance to obj""" self.note = obj @@ -681,6 +693,18 @@ class ObjectRef: else: return self.note.get() + def setNoteFormat(self,val): + """Set the note's format to the given value""" + if self.note: + self.note.setFormat(val) + + def getNoteFormat(self): + """Return the current note's format""" + if self.note == None: + return 0 + else: + return self.note.getFormat() + def setNoteObj(self,obj): """Change the note object instance to obj""" self.note = obj @@ -1912,6 +1936,14 @@ class Source: """returns the text of the note attached to the Source""" return self.note.get() + def setNoteFormat(self,val): + """Set the note's format to the given value""" + self.note.setFormat(val) + + def getNoteFormat(self): + """Return the current note's format""" + return self.note.getFormat() + def setNoteObj(self,obj): """sets the Note instance attached to the Source""" self.note = obj diff --git a/gramps2/src/edit_person.glade b/gramps2/src/edit_person.glade index 5fc4cd9b1..aee1f456d 100644 --- a/gramps2/src/edit_person.glade +++ b/gramps2/src/edit_person.glade @@ -3502,31 +3502,129 @@ - - 6 + True - GTK_POLICY_AUTOMATIC - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT + False + 0 - + + 6 True - Enter miscellaneous relevant data and documentation - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 12 - 12 - 12 - 12 - 12 - 0 - + GTK_POLICY_AUTOMATIC + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + Enter miscellaneous relevant data and documentation + True + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + True + 12 + 12 + 12 + 12 + 12 + 0 + + + + + 0 + True + True + + + + + + 12 + True + 1 + 3 + False + 0 + 24 + + + + True + True + Flo_wed + True + GTK_RELIEF_NORMAL + True + False + True + + + 1 + 2 + 0 + 1 + + + + + + + + True + True + _Preformatted + True + GTK_RELIEF_NORMAL + False + False + True + flowed + + + 2 + 3 + 0 + 1 + + + + + + + + True + <b>_Format:</b> + True + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + flowed + + + 0 + 1 + 0 + 1 + + + + + + + 0 + False + True +