* src/NameEdit.py: Add note format support.
* src/AddrEdit.py: Add note format support. * src/AttrEdit.py: Add note format support. * src/EventEdit.py: Add note format support. * src/EditSource.py: Add note format support. svn: r2525
This commit is contained in:
parent
a585943c7a
commit
b18c00b923
@ -1,3 +1,10 @@
|
|||||||
|
2003-12-15 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
|
* src/NameEdit.py: Add note format support.
|
||||||
|
* src/AddrEdit.py: Add note format support.
|
||||||
|
* src/AttrEdit.py: Add note format support.
|
||||||
|
* src/EventEdit.py: Add note format support.
|
||||||
|
* src/EditSource.py: Add note format support.
|
||||||
|
|
||||||
2003-12-14 Alex Roitman <shura@alex.neuro.umn.edu>
|
2003-12-14 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/dialog.glade: Add format controls for notes.
|
* src/dialog.glade: Add format controls for notes.
|
||||||
* src/marriage.glade: Add format controls for notes.
|
* src/marriage.glade: Add format controls for notes.
|
||||||
|
@ -78,6 +78,8 @@ class AddressEditor:
|
|||||||
self.slist = self.top.get_widget("slist")
|
self.slist = self.top.get_widget("slist")
|
||||||
self.sources_label = self.top.get_widget("sourcesAddr")
|
self.sources_label = self.top.get_widget("sourcesAddr")
|
||||||
self.notes_label = self.top.get_widget("noteAddr")
|
self.notes_label = self.top.get_widget("noteAddr")
|
||||||
|
self.flowed = self.top.get_widget("addr_flowed")
|
||||||
|
self.preform = self.top.get_widget("addr_preform")
|
||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.db = self.parent.db
|
self.db = self.parent.db
|
||||||
@ -104,9 +106,13 @@ class AddressEditor:
|
|||||||
self.postal.set_text(self.addr.getPostal())
|
self.postal.set_text(self.addr.getPostal())
|
||||||
self.phone.set_text(self.addr.getPhone())
|
self.phone.set_text(self.addr.getPhone())
|
||||||
self.priv.set_active(self.addr.getPrivacy())
|
self.priv.set_active(self.addr.getPrivacy())
|
||||||
self.note_field.get_buffer().set_text(self.addr.getNote())
|
|
||||||
if self.addr.getNote():
|
if self.addr.getNote():
|
||||||
|
self.note_field.get_buffer().set_text(self.addr.getNote())
|
||||||
Utils.bold_label(self.notes_label)
|
Utils.bold_label(self.notes_label)
|
||||||
|
if addr.getNoteFormat() == 1:
|
||||||
|
self.preform.set_active(1)
|
||||||
|
else:
|
||||||
|
self.flowed.set_active(1)
|
||||||
else:
|
else:
|
||||||
self.srcreflist = []
|
self.srcreflist = []
|
||||||
|
|
||||||
@ -150,6 +156,7 @@ class AddressEditor:
|
|||||||
postal = self.postal.get_text()
|
postal = self.postal.get_text()
|
||||||
b = self.note_field.get_buffer()
|
b = self.note_field.get_buffer()
|
||||||
note = b.get_text(b.get_start_iter(),b.get_end_iter(),gtk.FALSE)
|
note = b.get_text(b.get_start_iter(),b.get_end_iter(),gtk.FALSE)
|
||||||
|
format = self.preform.get_active()
|
||||||
priv = self.priv.get_active()
|
priv = self.priv.get_active()
|
||||||
|
|
||||||
if self.addr == None:
|
if self.addr == None:
|
||||||
@ -157,7 +164,7 @@ class AddressEditor:
|
|||||||
self.parent.plist.append(self.addr)
|
self.parent.plist.append(self.addr)
|
||||||
self.addr.setSourceRefList(self.srcreflist)
|
self.addr.setSourceRefList(self.srcreflist)
|
||||||
|
|
||||||
self.update(date,street,city,state,country,postal,phone,note,priv)
|
self.update(date,street,city,state,country,postal,phone,note,format,priv)
|
||||||
self.callback(self.addr)
|
self.callback(self.addr)
|
||||||
|
|
||||||
def check(self,get,set,data):
|
def check(self,get,set,data):
|
||||||
@ -167,7 +174,7 @@ class AddressEditor:
|
|||||||
set(data)
|
set(data)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
def update(self,date,street,city,state,country,postal,phone,note,priv):
|
def update(self,date,street,city,state,country,postal,phone,note,format,priv):
|
||||||
"""Compares the data items, and updates if necessary"""
|
"""Compares the data items, and updates if necessary"""
|
||||||
d = Date.Date()
|
d = Date.Date()
|
||||||
d.set(date)
|
d.set(date)
|
||||||
@ -183,6 +190,7 @@ class AddressEditor:
|
|||||||
self.check(self.addr.getPostal,self.addr.setPostal,postal)
|
self.check(self.addr.getPostal,self.addr.setPostal,postal)
|
||||||
self.check(self.addr.getPhone,self.addr.setPhone,phone)
|
self.check(self.addr.getPhone,self.addr.setPhone,phone)
|
||||||
self.check(self.addr.getNote,self.addr.setNote,note)
|
self.check(self.addr.getNote,self.addr.setNote,note)
|
||||||
|
self.check(self.addr.getNoteFormat,self.addr.setNoteFormat,format)
|
||||||
self.check(self.addr.getPrivacy,self.addr.setPrivacy,priv)
|
self.check(self.addr.getPrivacy,self.addr.setPrivacy,priv)
|
||||||
|
|
||||||
def on_switch_page(self,obj,a,page):
|
def on_switch_page(self,obj,a,page):
|
||||||
|
@ -82,6 +82,8 @@ class AttributeEditor:
|
|||||||
self.priv = self.top.get_widget("priv")
|
self.priv = self.top.get_widget("priv")
|
||||||
self.sources_label = self.top.get_widget("sourcesAttr")
|
self.sources_label = self.top.get_widget("sourcesAttr")
|
||||||
self.notes_label = self.top.get_widget("noteAttr")
|
self.notes_label = self.top.get_widget("noteAttr")
|
||||||
|
self.flowed = self.top.get_widget("attr_flowed")
|
||||||
|
self.preform = self.top.get_widget("attr_preform")
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.alist = list
|
self.alist = list
|
||||||
|
|
||||||
@ -112,9 +114,13 @@ class AttributeEditor:
|
|||||||
self.value_field.set_text(attrib.getValue())
|
self.value_field.set_text(attrib.getValue())
|
||||||
self.priv.set_active(attrib.getPrivacy())
|
self.priv.set_active(attrib.getPrivacy())
|
||||||
|
|
||||||
self.note_field.get_buffer().set_text(attrib.getNote())
|
|
||||||
if attrib.getNote():
|
if attrib.getNote():
|
||||||
|
self.note_field.get_buffer().set_text(attrib.getNote())
|
||||||
Utils.bold_label(self.notes_label)
|
Utils.bold_label(self.notes_label)
|
||||||
|
if attrib.getNoteFormat() == 1:
|
||||||
|
self.preform.set_active(1)
|
||||||
|
else:
|
||||||
|
self.flowed.set_active(1)
|
||||||
|
|
||||||
self.top.signal_autoconnect({
|
self.top.signal_autoconnect({
|
||||||
"on_add_src_clicked" : self.add_source,
|
"on_add_src_clicked" : self.add_source,
|
||||||
@ -151,6 +157,7 @@ class AttributeEditor:
|
|||||||
|
|
||||||
buf = self.note_field.get_buffer()
|
buf = self.note_field.get_buffer()
|
||||||
note = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
|
note = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
|
||||||
|
format = self.preform.get_active()
|
||||||
priv = self.priv.get_active()
|
priv = self.priv.get_active()
|
||||||
|
|
||||||
if not type in self.alist:
|
if not type in self.alist:
|
||||||
@ -165,7 +172,7 @@ class AttributeEditor:
|
|||||||
self.parent.alist.append(self.attrib)
|
self.parent.alist.append(self.attrib)
|
||||||
|
|
||||||
self.attrib.setSourceRefList(self.srcreflist)
|
self.attrib.setSourceRefList(self.srcreflist)
|
||||||
self.update(type,value,note,priv)
|
self.update(type,value,note,format,priv)
|
||||||
self.callback(self.attrib)
|
self.callback(self.attrib)
|
||||||
|
|
||||||
def check(self,get,set,data):
|
def check(self,get,set,data):
|
||||||
@ -175,12 +182,13 @@ class AttributeEditor:
|
|||||||
set(data)
|
set(data)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
def update(self,type,value,note,priv):
|
def update(self,type,value,note,format,priv):
|
||||||
"""Compares the data items, and updates if necessary"""
|
"""Compares the data items, and updates if necessary"""
|
||||||
ntype = const.save_pattr(type)
|
ntype = const.save_pattr(type)
|
||||||
self.check(self.attrib.getType,self.attrib.setType,ntype)
|
self.check(self.attrib.getType,self.attrib.setType,ntype)
|
||||||
self.check(self.attrib.getValue,self.attrib.setValue,value)
|
self.check(self.attrib.getValue,self.attrib.setValue,value)
|
||||||
self.check(self.attrib.getNote,self.attrib.setNote,note)
|
self.check(self.attrib.getNote,self.attrib.setNote,note)
|
||||||
|
self.check(self.attrib.getNoteFormat,self.attrib.setNoteFormat,format)
|
||||||
self.check(self.attrib.getPrivacy,self.attrib.setPrivacy,priv)
|
self.check(self.attrib.getPrivacy,self.attrib.setPrivacy,priv)
|
||||||
|
|
||||||
def on_switch_page(self,obj,a,page):
|
def on_switch_page(self,obj,a,page):
|
||||||
|
@ -73,6 +73,8 @@ class EditSource:
|
|||||||
self.gallery_label = self.top_window.get_widget("gallerySourceEditor")
|
self.gallery_label = self.top_window.get_widget("gallerySourceEditor")
|
||||||
self.refs_label = self.top_window.get_widget("refsSourceEditor")
|
self.refs_label = self.top_window.get_widget("refsSourceEditor")
|
||||||
self.notes_label = self.top_window.get_widget("notesSourceEditor")
|
self.notes_label = self.top_window.get_widget("notesSourceEditor")
|
||||||
|
self.flowed = self.top_window.get_widget("source_flowed")
|
||||||
|
self.preform = self.top_window.get_widget("source_preform")
|
||||||
|
|
||||||
self.refinfo = self.top_window.get_widget("refinfo")
|
self.refinfo = self.top_window.get_widget("refinfo")
|
||||||
|
|
||||||
@ -85,6 +87,10 @@ class EditSource:
|
|||||||
if source.getNote():
|
if source.getNote():
|
||||||
self.notes_buffer.set_text(source.getNote())
|
self.notes_buffer.set_text(source.getNote())
|
||||||
Utils.bold_label(self.notes_label)
|
Utils.bold_label(self.notes_label)
|
||||||
|
if source.getNoteFormat() == 1:
|
||||||
|
self.preform.set_active(1)
|
||||||
|
else:
|
||||||
|
self.flowed.set_active(1)
|
||||||
|
|
||||||
if self.source.getPhotoList():
|
if self.source.getPhotoList():
|
||||||
Utils.bold_label(self.gallery_label)
|
Utils.bold_label(self.gallery_label)
|
||||||
@ -234,7 +240,8 @@ class EditSource:
|
|||||||
abbrev = self.abbrev.get_text()
|
abbrev = self.abbrev.get_text()
|
||||||
note = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
|
note = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
|
||||||
self.notes_buffer.get_end_iter(),gtk.FALSE)
|
self.notes_buffer.get_end_iter(),gtk.FALSE)
|
||||||
|
format = self.preform.get_active()
|
||||||
|
|
||||||
if author != self.source.getAuthor():
|
if author != self.source.getAuthor():
|
||||||
self.source.setAuthor(author)
|
self.source.setAuthor(author)
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
@ -255,6 +262,10 @@ class EditSource:
|
|||||||
self.source.setNote(note)
|
self.source.setNote(note)
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
|
if format != self.source.getNoteFormat():
|
||||||
|
self.source.setNoteFormat(format)
|
||||||
|
Utils.modified()
|
||||||
|
|
||||||
self.close(None)
|
self.close(None)
|
||||||
|
|
||||||
if self.callback:
|
if self.callback:
|
||||||
|
@ -117,6 +117,8 @@ class EventEditor:
|
|||||||
self.calendar = self.top.get_widget("calendar")
|
self.calendar = self.top.get_widget("calendar")
|
||||||
self.sources_label = self.top.get_widget("sourcesEvent")
|
self.sources_label = self.top.get_widget("sourcesEvent")
|
||||||
self.notes_label = self.top.get_widget("notesEvent")
|
self.notes_label = self.top.get_widget("notesEvent")
|
||||||
|
self.flowed = self.top.get_widget("eventflowed")
|
||||||
|
self.preform = self.top.get_widget("eventpreform")
|
||||||
self.witnesses_label = self.top.get_widget("witnessesEvent")
|
self.witnesses_label = self.top.get_widget("witnessesEvent")
|
||||||
|
|
||||||
if GrampsCfg.calendar:
|
if GrampsCfg.calendar:
|
||||||
@ -156,6 +158,13 @@ class EventEditor:
|
|||||||
self.priv.set_active(event.getPrivacy())
|
self.priv.set_active(event.getPrivacy())
|
||||||
|
|
||||||
self.note_field.get_buffer().set_text(event.getNote())
|
self.note_field.get_buffer().set_text(event.getNote())
|
||||||
|
if event.getNote():
|
||||||
|
self.note_field.get_buffer().set_text(event.getNote())
|
||||||
|
Utils.bold_label(self.notes_label)
|
||||||
|
if event.getNoteFormat() == 1:
|
||||||
|
self.preform.set_active(1)
|
||||||
|
else:
|
||||||
|
self.flowed.set_active(1)
|
||||||
else:
|
else:
|
||||||
if def_event:
|
if def_event:
|
||||||
self.name_field.set_text(def_event)
|
self.name_field.set_text(def_event)
|
||||||
@ -235,6 +244,7 @@ class EventEditor:
|
|||||||
buf = self.note_field.get_buffer()
|
buf = self.note_field.get_buffer()
|
||||||
|
|
||||||
enote = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
|
enote = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
|
||||||
|
eformat = self.preform.get_active()
|
||||||
edesc = self.descr_field.get_text()
|
edesc = self.descr_field.get_text()
|
||||||
epriv = self.priv.get_active()
|
epriv = self.priv.get_active()
|
||||||
|
|
||||||
@ -251,11 +261,11 @@ class EventEditor:
|
|||||||
self.event.set_witness_list(self.witnesslist)
|
self.event.set_witness_list(self.witnesslist)
|
||||||
self.parent.elist.append(self.event)
|
self.parent.elist.append(self.event)
|
||||||
|
|
||||||
self.update_event(ename,self.date,eplace_obj,edesc,enote,epriv,ecause)
|
self.update_event(ename,self.date,eplace_obj,edesc,enote,eformat,epriv,ecause)
|
||||||
self.parent.redraw_event_list()
|
self.parent.redraw_event_list()
|
||||||
self.callback(self.event)
|
self.callback(self.event)
|
||||||
|
|
||||||
def update_event(self,name,date,place,desc,note,priv,cause):
|
def update_event(self,name,date,place,desc,note,format,priv,cause):
|
||||||
if self.event.getPlace() != place:
|
if self.event.getPlace() != place:
|
||||||
self.event.setPlace(place)
|
self.event.setPlace(place)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
@ -272,6 +282,10 @@ class EventEditor:
|
|||||||
self.event.setNote(note)
|
self.event.setNote(note)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
|
if self.event.getNoteFormat() != format:
|
||||||
|
self.event.setNoteFormat(format)
|
||||||
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
dobj = self.event.getDateObj()
|
dobj = self.event.getDateObj()
|
||||||
|
|
||||||
self.event.setSourceRefList(self.srcreflist)
|
self.event.setSourceRefList(self.srcreflist)
|
||||||
|
@ -67,6 +67,8 @@ class NameEditor:
|
|||||||
self.priv = self.top.get_widget("priv")
|
self.priv = self.top.get_widget("priv")
|
||||||
self.sources_label = self.top.get_widget("sourcesName")
|
self.sources_label = self.top.get_widget("sourcesName")
|
||||||
self.notes_label = self.top.get_widget("noteName")
|
self.notes_label = self.top.get_widget("noteName")
|
||||||
|
self.flowed = self.top.get_widget("alt_flowed")
|
||||||
|
self.preform = self.top.get_widget("alt_preform")
|
||||||
|
|
||||||
types = const.NameTypesMap.keys()
|
types = const.NameTypesMap.keys()
|
||||||
types.sort()
|
types.sort()
|
||||||
@ -109,9 +111,13 @@ class NameEditor:
|
|||||||
self.suffix_field.set_text(name.getSuffix())
|
self.suffix_field.set_text(name.getSuffix())
|
||||||
self.type_field.entry.set_text(_(name.getType()))
|
self.type_field.entry.set_text(_(name.getType()))
|
||||||
self.priv.set_active(name.getPrivacy())
|
self.priv.set_active(name.getPrivacy())
|
||||||
self.note_buffer.set_text(name.getNote())
|
|
||||||
if name.getNote():
|
if name.getNote():
|
||||||
|
self.note_buffer.set_text(name.getNote())
|
||||||
Utils.bold_label(self.notes_label)
|
Utils.bold_label(self.notes_label)
|
||||||
|
if name.getNoteFormat() == 1:
|
||||||
|
self.preform.set_active(1)
|
||||||
|
else:
|
||||||
|
self.flowed.set_active(1)
|
||||||
|
|
||||||
if parent_window:
|
if parent_window:
|
||||||
self.window.set_transient_for(parent_window)
|
self.window.set_transient_for(parent_window)
|
||||||
@ -132,6 +138,7 @@ class NameEditor:
|
|||||||
suffix = self.suffix_field.get_text()
|
suffix = self.suffix_field.get_text()
|
||||||
note = self.note_buffer.get_text(self.note_buffer.get_start_iter(),
|
note = self.note_buffer.get_text(self.note_buffer.get_start_iter(),
|
||||||
self.note_buffer.get_end_iter(),gtk.FALSE)
|
self.note_buffer.get_end_iter(),gtk.FALSE)
|
||||||
|
format = self.preform.get_active()
|
||||||
priv = self.priv.get_active()
|
priv = self.priv.get_active()
|
||||||
|
|
||||||
type = self.type_field.entry.get_text()
|
type = self.type_field.entry.get_text()
|
||||||
@ -147,12 +154,12 @@ class NameEditor:
|
|||||||
|
|
||||||
self.name.setSourceRefList(self.srcreflist)
|
self.name.setSourceRefList(self.srcreflist)
|
||||||
|
|
||||||
self.update_name(first,last,suffix,title,type,note,priv)
|
self.update_name(first,last,suffix,title,type,note,format,priv)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
self.callback(self.name)
|
self.callback(self.name)
|
||||||
|
|
||||||
def update_name(self,first,last,suffix,title,type,note,priv):
|
def update_name(self,first,last,suffix,title,type,note,format,priv):
|
||||||
|
|
||||||
if self.name.getFirstName() != first:
|
if self.name.getFirstName() != first:
|
||||||
self.name.setFirstName(first)
|
self.name.setFirstName(first)
|
||||||
@ -179,6 +186,10 @@ class NameEditor:
|
|||||||
self.name.setNote(note)
|
self.name.setNote(note)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
|
if self.name.getNoteFormat() != format:
|
||||||
|
self.name.setNoteFormat(format)
|
||||||
|
self.parent.lists_changed = 1
|
||||||
|
|
||||||
if self.name.getPrivacy() != priv:
|
if self.name.getPrivacy() != priv:
|
||||||
self.name.setPrivacy(priv)
|
self.name.setPrivacy(priv)
|
||||||
self.parent.lists_changed = 1
|
self.parent.lists_changed = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user