* src/Utils.py (bold_label, unbold label): Add functions.

* src/EditPerson.py (bold_label, unbold label): Remove functions;
Call them from Utils in every instance.
* src/ImageSelect.py (Gallery.load_images): Change label upon load.
* src/Sources.py (SourceTab.redraw): Change label upon redraw.
* src/AddrEdit.py (__init__): Find sources label from XML;
(on_switch_page): Add function.
* src/AttrEdit.py (__init__): Find sources label from XML;
(on_switch_page): Add function.
* src/dialog.glade: Set meaningful label ids, remove bold markup.
* src/EditPlace.py (__init__): Find soucre label from XML.
* src/places.glade: Set meaningful label ids, remove bold markup.
* src/Marriage.py (__init__): Find soucre label from XML;
(on_switch_page): Add function.
* src/marriage.glade: Set meaningful label ids, remove bold markup.
* src/EditSource.py (__init__): Find soucre label from XML.
* src/gramps.glade: Set meaningful label ids, remove bold markup.
* src/EventEdit.py: (__init__): Find soucre label from XML;
(on_switch_page): Add function.
* src/Witness.py (WitnessTab.redraw): Change label upon redraw.
* src/NameEdit.py: (__init__): Find soucre label from XML;
(on_switch_page): Add function.


svn: r2327
This commit is contained in:
Alex Roitman 2003-11-12 18:45:07 +00:00
parent 03cbf74276
commit 385c80dcd2
17 changed files with 315 additions and 112 deletions

View File

@ -1,3 +1,27 @@
2003-11-12 Alex Roitman <shura@alex.neuro.umn.edu>
* src/Utils.py (bold_label, unbold label): Add functions.
* src/EditPerson.py (bold_label, unbold label): Remove functions;
Call them from Utils in every instance.
* src/ImageSelect.py (Gallery.load_images): Change label upon load.
* src/Sources.py (SourceTab.redraw): Change label upon redraw.
* src/AddrEdit.py (__init__): Find sources label from XML;
(on_switch_page): Add function.
* src/AttrEdit.py (__init__): Find sources label from XML;
(on_switch_page): Add function.
* src/dialog.glade: Set meaningful label ids, remove bold markup.
* src/EditPlace.py (__init__): Find soucre label from XML.
* src/places.glade: Set meaningful label ids, remove bold markup.
* src/Marriage.py (__init__): Find soucre label from XML;
(on_switch_page): Add function.
* src/marriage.glade: Set meaningful label ids, remove bold markup.
* src/EditSource.py (__init__): Find soucre label from XML.
* src/gramps.glade: Set meaningful label ids, remove bold markup.
* src/EventEdit.py: (__init__): Find soucre label from XML;
(on_switch_page): Add function.
* src/Witness.py (WitnessTab.redraw): Change label upon redraw.
* src/NameEdit.py: (__init__): Find soucre label from XML;
(on_switch_page): Add function.
2003-11-12 Tim Waugh <twaugh@redhat.com>
* src/WriteXML.py: Fix ID sorting so that RCS versioning is useful
again (broken in last WriteXML change).

View File

@ -17,6 +17,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""
The AddrEdit module provides the AddressEditor class. This provides a
mechanism for the user to edit address information.
@ -71,8 +74,11 @@ class AddressEditor:
self.note_field = self.top.get_widget("addr_note")
self.priv = self.top.get_widget("priv")
self.slist = self.top.get_widget("slist")
self.sources_label = self.top.get_widget("sourcesAddr")
self.notes_label = self.top.get_widget("noteAddr")
self.parent = parent
self.db = self.parent.db
self.addr = addr
self.callback = callback
name = parent.person.getPrimaryName().getName()
@ -96,10 +102,12 @@ class AddressEditor:
self.postal.set_text(self.addr.getPostal())
self.priv.set_active(self.addr.getPrivacy())
self.note_field.get_buffer().set_text(self.addr.getNote())
if self.addr.getNote():
Utils.bold_label(self.notes_label)
else:
self.srcreflist = []
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,
self.sourcetab = Sources.SourceTab(self.srcreflist,self,
self.top, self.window, self.slist,
self.top.get_widget('add_src'),
self.top.get_widget('edit_src'),
@ -108,6 +116,10 @@ class AddressEditor:
date_stat = self.top.get_widget("date_stat")
self.date_check = DateEdit(self.addr_start,date_stat)
self.top.signal_autoconnect({
"on_switch_page" : self.on_switch_page
})
if parent_window:
self.window.set_transient_for(parent_window)
val = self.window.run()
@ -162,3 +174,10 @@ class AddressEditor:
self.check(self.addr.getNote,self.addr.setNote,note)
self.check(self.addr.getPrivacy,self.addr.setPrivacy,priv)
def on_switch_page(self,obj,a,page):
buf = self.note_field.get_buffer()
text = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)

View File

@ -17,6 +17,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""
The AttrEdit module provides the AddressEditor class. This provides a
mechanism for the user to edit address information.
@ -65,6 +68,7 @@ class AttributeEditor:
"""
self.parent = parent
self.db = self.parent.db
self.attrib = attrib
self.top = gtk.glade.XML(const.dialogFile, "attr_edit","gramps")
self.type_field = self.top.get_widget("attr_type")
@ -74,6 +78,8 @@ class AttributeEditor:
self.attrib_menu = self.top.get_widget("attr_menu")
self.source_field = self.top.get_widget("attr_source")
self.priv = self.top.get_widget("priv")
self.sources_label = self.top.get_widget("sourcesAttr")
self.notes_label = self.top.get_widget("noteAttr")
self.callback = callback
self.window = self.top.get_widget("attr_edit")
@ -83,7 +89,7 @@ class AttributeEditor:
else:
self.srcreflist = []
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,self.top,
self.sourcetab = Sources.SourceTab(self.srcreflist,self,self.top,
self.window, self.slist,
self.top.get_widget('add_src'),
self.top.get_widget('edit_src'),
@ -104,10 +110,13 @@ class AttributeEditor:
self.priv.set_active(attrib.getPrivacy())
self.note_field.get_buffer().set_text(attrib.getNote())
if attrib.getNote():
Utils.bold_label(self.notes_label)
self.top.signal_autoconnect({
"on_add_src_clicked" : self.add_source,
"on_del_src_clicked" : self.del_source,
"on_switch_page" : self.on_switch_page
})
if parent_window:
@ -158,3 +167,10 @@ class AttributeEditor:
self.check(self.attrib.getNote,self.attrib.setNote,note)
self.check(self.attrib.getPrivacy,self.attrib.setPrivacy,priv)
def on_switch_page(self,obj,a,page):
buf = self.note_field.get_buffer()
text = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)

View File

@ -206,21 +206,21 @@ class EditPerson:
else:
self.srcreflist = []
self.bold_label(self.general_label)
Utils.bold_label(self.general_label)
if self.srcreflist:
self.bold_label(self.sources_label)
Utils.bold_label(self.sources_label)
if self.elist:
self.bold_label(self.events_label)
Utils.bold_label(self.events_label)
if self.nlist:
self.bold_label(self.names_label)
Utils.bold_label(self.names_label)
if self.alist:
self.bold_label(self.attr_label)
Utils.bold_label(self.attr_label)
if self.ulist:
self.bold_label(self.inet_label)
Utils.bold_label(self.inet_label)
if self.plist:
self.bold_label(self.addr_label)
Utils.bold_label(self.addr_label)
if self.icon_list:
self.bold_label(self.gallery_label)
Utils.bold_label(self.gallery_label)
# event display
etitles = [(_('Event'),-1,150),(_('Description'),-1,150),
@ -276,7 +276,7 @@ class EditPerson:
if (not self.lds_baptism.isEmpty()) \
or (not self.lds_endowment.isEmpty()) \
or (not self.lds_sealing.isEmpty()):
self.bold_label(self.lds_tab)
Utils.bold_label(self.lds_tab)
types = const.NameTypesMap.keys()
types.sort()
@ -298,7 +298,7 @@ class EditPerson:
self.notes_buffer = self.notes_field.get_buffer()
self.notes_buffer.set_text(person.getNote())
if person.getNote():
self.bold_label(self.notes_label)
Utils.bold_label(self.notes_label)
self.event_list.drag_dest_set(gtk.DEST_DEFAULT_ALL,pycode_tgts,ACTION_COPY)
self.event_list.drag_source_set(BUTTON1_MASK, pycode_tgts, ACTION_COPY)
@ -704,9 +704,9 @@ class EditPerson:
self.nmap[str(name)] = iter
if self.nlist:
self.ntree.select_row(0)
self.bold_label(self.names_label)
Utils.bold_label(self.names_label)
else:
self.unbold_label(self.names_label)
Utils.unbold_label(self.names_label)
def redraw_url_list(self):
"""redraws the url list, disabling the go button if no url
@ -720,12 +720,12 @@ class EditPerson:
if len(self.ulist) > 0:
self.web_go.set_sensitive(0)
self.wtree.select_row(0)
self.bold_label(self.inet_label)
Utils.bold_label(self.inet_label)
else:
self.web_go.set_sensitive(0)
self.web_url.set_text("")
self.web_description.set_text("")
self.unbold_label(self.inet_label)
Utils.unbold_label(self.inet_label)
def redraw_addr_list(self):
"""Redraws the address list"""
@ -738,9 +738,9 @@ class EditPerson:
self.pmap[str(addr)] = iter
if self.plist:
self.ptree.select_row(0)
self.bold_label(self.addr_label)
Utils.bold_label(self.addr_label)
else:
self.unbold_label(self.addr_label)
Utils.unbold_label(self.addr_label)
def redraw_attr_list(self):
"""redraws the attribute list for the person"""
@ -751,9 +751,9 @@ class EditPerson:
self.amap[str(attr)] = iter
if self.alist:
self.atree.select_row(0)
self.bold_label(self.attr_label)
Utils.bold_label(self.attr_label)
else:
self.unbold_label(self.attr_label)
Utils.unbold_label(self.attr_label)
def name_edit_callback(self,name):
self.redraw_name_list()
@ -795,9 +795,9 @@ class EditPerson:
self.emap[str(event)] = iter
if self.elist:
self.etree.select_row(0)
self.bold_label(self.events_label)
Utils.bold_label(self.events_label)
else:
self.unbold_label(self.events_label)
Utils.unbold_label(self.events_label)
# Remember old combo list input
@ -1605,6 +1605,12 @@ class EditPerson:
elif page == 8 and self.lds_not_loaded:
self.lds_not_loaded = 0
self.draw_lds()
text = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
self.notes_buffer.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)
def change_name(self,obj):
sel_objs = self.ntree.get_selected_objects()
@ -1632,18 +1638,6 @@ class EditPerson:
self.ntype_field.entry.set_text(_(self.pname.getType()))
self.title.set_text(self.pname.getTitle())
def bold_label(self,label):
text = label.get_text()
label.set_text("<b>%s</b>" % text )
label.set_use_markup(1)
def unbold_label(self,label):
text = label.get_text()
text = string.replace(text,'<b>','')
text = string.replace(text,'</b>','')
label.set_text(text)
label.set_use_markup(0)
#-------------------------------------------------------------------------
#
# birth_dates_in_order

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
# python modules
@ -135,9 +137,17 @@ class EditPlace:
self.latitude.set_text(place.get_latitude())
self.refinfo = self.top_window.get_widget("refinfo")
self.slist = self.top_window.get_widget("slist")
self.sources_label = self.top_window.get_widget("sourcesPlaceEdit")
self.names_label = self.top_window.get_widget("namesPlaceEdit")
self.notes_label = self.top_window.get_widget("notesPlaceEdit")
self.gallery_label = self.top_window.get_widget("galleryPlaceEdit")
self.inet_label = self.top_window.get_widget("inetPlaceEdit")
self.refs_label = self.top_window.get_widget("refsPlaceEdit")
self.note_buffer = self.note.get_buffer()
self.note_buffer.set_text(place.getNote())
if place.getNote():
self.note_buffer.set_text(place.getNote())
Utils.bold_label(self.notes_label)
self.top_window.signal_autoconnect({
"destroy_passed_object" : self.close,
@ -177,6 +187,7 @@ class EditPlace:
self.redraw_url_list()
self.redraw_location_list()
self.display_references()
def close(self,obj):
self.glry.close()
@ -222,18 +233,22 @@ class EditPlace:
if length > 0:
self.web_go.set_sensitive(1)
self.web_edit.set_sensitive(1)
Utils.bold_label(self.inet_label)
else:
self.web_edit.set_sensitive(0)
self.web_go.set_sensitive(0)
self.web_url.set_text("")
self.web_description.set_text("")
Utils.unbold_label(self.inet_label)
def redraw_location_list(self):
Utils.redraw_list(self.llist,self.loc_model,disp_loc)
if len(self.llist) > 0:
self.loc_edit.set_sensitive(1)
Utils.bold_label(self.names_label)
else:
self.loc_edit.set_sensitive(0)
Utils.unbold_label(self.names_label)
def on_web_go_clicked(self,obj):
import gnome.url
@ -286,6 +301,12 @@ class EditPlace:
elif page == 6 and self.ref_not_loaded:
self.ref_not_loaded = 0
self.display_references()
text = self.note_buffer.get_text(self.note_buffer.get_start_iter(),
self.note_buffer.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)
def on_update_url_clicked(self,obj):
import UrlEdit
@ -379,7 +400,9 @@ class EditPlace:
if event.getPlace() == self.place:
fevent.append((f,event))
any = 0
if len(pevent) > 0:
any = 1
msg = msg + _("People") + "\n"
msg = msg + "_________________________\n\n"
t = _("%s [%s]: event %s\n")
@ -388,6 +411,7 @@ class EditPlace:
msg = msg + ( t % (GrampsCfg.nameof(e[0]),e[0].getId(),e[1].getName()))
if len(fevent) > 0:
any = 1
msg = msg + "\n%s\n" % _("Families")
msg = msg + "_________________________\n\n"
t = _("%s [%s]: event %s\n")
@ -405,6 +429,10 @@ class EditPlace:
msg = msg + ( t % (fname,e[0].getId(),e[1].getName()))
self.refinfo.get_buffer().set_text(msg)
if any:
Utils.bold_label(self.refs_label)
self.ref_not_loaded = 0
#-------------------------------------------------------------------------
#

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
@ -66,6 +68,9 @@ class EditSource:
self.pubinfo = self.top_window.get_widget("pubinfo")
self.note = self.top_window.get_widget("source_note")
self.notes_buffer = self.note.get_buffer()
self.gallery_label = self.top_window.get_widget("gallerySourceEditor")
self.refs_label = self.top_window.get_widget("refsSourceEditor")
self.notes_label = self.top_window.get_widget("notesSourceEditor")
self.refinfo = self.top_window.get_widget("refinfo")
@ -90,6 +95,7 @@ class EditSource:
if parent_window:
self.top.set_transient_for(parent_window)
self.display_references()
self.top.show()
val = self.top.run()
if val == gtk.RESPONSE_OK:
@ -164,31 +170,46 @@ class EditSource:
titles = [(_('Source Type'),0,150),(_('Object'),1,150),(_('Value'),2,150)]
self.model = ListModel.ListModel(slist,titles)
any = 0
if len(p_event_list) > 0:
any = 1
for p in p_event_list:
self.model.add([_("Individual Events"),p[0],
const.display_pevent(p[1])])
if len(p_attr_list) > 0:
any = 1
for p in p_attr_list:
self.model.add([_("Individual Attributes"),p[0],
const.display_pattr(p[1])])
if len(p_name_list) > 0:
any = 1
for p in p_name_list:
self.model.add([_("Individual Names"),p[0],p[1]])
if len(f_event_list) > 0:
any = 1
for p in f_event_list:
self.model.add([_("Family Events"),p[0],
const.display_fevent(p[1])])
if len(f_attr_list) > 0:
any = 1
for p in f_event_list:
self.model.add([_("Family Attributes"),p[0],
const.display_fattr(p[1])])
if len(m_list) > 0:
any = 1
for p in m_list:
self.model.add([_("Media Objects"),p,''])
if len(p_list) > 0:
any = 1
for p in p_list:
self.model.add([_("Places"),p,''])
if any:
Utils.bold_label(self.refs_label)
else:
Utils.unbold_label(self.refs_label)
self.ref_not_loaded = 0
def on_source_apply_clicked(self):
@ -226,6 +247,12 @@ class EditSource:
elif page == 3 and self.ref_not_loaded:
self.ref_not_loaded = 0
self.display_references()
text = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
self.notes_buffer.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)
class DelSrcQuery:

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
from string import strip
#-------------------------------------------------------------------------
@ -57,6 +59,7 @@ class EventEditor:
def __init__(self,parent,name,list,trans,event,def_placename,read_only,cb,
def_event=None):
self.parent = parent
self.db = self.parent.db
self.event = event
self.trans = trans
self.callback = cb
@ -104,6 +107,9 @@ class EventEditor:
self.event_menu = self.top.get_widget("personalEvents")
self.priv = self.top.get_widget("priv")
self.calendar = self.top.get_widget("calendar")
self.sources_label = self.top.get_widget("sourcesEvent")
self.notes_label = self.top.get_widget("notesEvent")
self.witnesses_label = self.top.get_widget("witnessesEvent")
if GrampsCfg.calendar:
self.calendar.show()
@ -114,13 +120,13 @@ class EventEditor:
self.event_menu.set_sensitive(0)
self.date_field.grab_focus()
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,
self.sourcetab = Sources.SourceTab(self.srcreflist,self,
self.top,self.window,self.slist,
self.top.get_widget('add_src'),
self.top.get_widget('edit_src'),
self.top.get_widget('del_src'))
self.witnesstab = Witness.WitnessTab(self.witnesslist,self.parent,
self.witnesstab = Witness.WitnessTab(self.witnesslist,self,
self.top,self.window,self.wlist,
self.top.get_widget('add_witness'),
self.top.get_widget('edit_witness'),
@ -155,6 +161,7 @@ class EventEditor:
self.top.signal_autoconnect({
"on_add_src_clicked" : self.add_source,
"on_del_src_clicked" : self.del_source,
"on_switch_page" : self.on_switch_page,
})
menu = gtk.Menu()
@ -263,3 +270,11 @@ class EventEditor:
if self.event.getPrivacy() != priv:
self.event.setPrivacy(priv)
self.parent.lists_changed = 1
def on_switch_page(self,obj,a,page):
buf = self.note_field.get_buffer()
text = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)

View File

@ -433,6 +433,11 @@ class Gallery(ImageSelect):
self.iconlist.set_scroll_region(0,0,self.x,self.cy)
else:
self.iconlist.set_scroll_region(0,0,self.x,self.y)
if self.dataobj.getPhotoList():
Utils.bold_label(self.parent.gallery_label)
else:
Utils.unbold_label(self.parent.gallery_label)
def get_index(self,obj,x,y):
x_offset = x/(_IMAGEX+_PAD)

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
import pickle
#-------------------------------------------------------------------------
@ -112,6 +114,7 @@ class Marriage:
"on_event_update_clicked" : self.on_event_update_clicked,
"on_attr_update_clicked" : self.on_update_attr_clicked,
"on_marriageDeleteBtn_clicked" : self.on_delete_clicked,
"on_switch_page" : self.on_switch_page
})
title = _("%s and %s") % (GrampsCfg.nameof(family.getFather()),
@ -143,7 +146,14 @@ class Marriage:
self.lds_status = self.get_widget("lds_status")
self.lds_place = self.get_widget("lds_place")
self.slist = self.get_widget("slist")
self.sources_label = self.get_widget("sourcesMarriage")
self.gallery_label = self.get_widget("galleryMarriage")
self.sources_label = self.get_widget("sourcesMarriage")
self.events_label = self.get_widget("eventsMarriage")
self.attr_label = self.get_widget("attrMarriage")
self.notes_label = self.get_widget("notesMarriage")
self.lds_label = self.get_widget("ldsMarriage")
self.elist = family.getEventList()[:]
self.alist = family.getAttributeList()[:]
self.lists_changed = 0
@ -208,6 +218,8 @@ class Marriage:
# set notes data
self.notes_buffer = self.notes_field.get_buffer()
self.notes_buffer.set_text(family.getNote())
if family.getNote():
Utils.bold_label(self.notes_label)
self.sourcetab = Sources.SourceTab(self.srcreflist,self,
self.top,self.window,self.slist,
@ -368,6 +380,9 @@ class Marriage:
self.amap[str(attr)] = iter
if self.alist:
self.atree.select_row(0)
Utils.bold_label(self.attr_label)
else:
Utils.unbold_label(self.attr_label)
def redraw_event_list(self):
self.etree.clear()
@ -377,6 +392,9 @@ class Marriage:
self.emap[str(data)] = iter
if self.elist:
self.etree.select_row(0)
Utils.bold_label(self.events_label)
else:
Utils.unbold_label(self.events_label)
def get_widget(self,name):
return self.top.get_widget(name)
@ -648,3 +666,11 @@ class Marriage:
obj = list[src]
list.remove(obj)
list.insert(dest,obj)
def on_switch_page(self,obj,a,page):
text = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
self.notes_buffer.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
@ -47,6 +49,7 @@ class NameEditor:
def __init__(self,parent,name,callback,parent_window=None):
self.parent = parent
self.db = self.parent.db
self.name = name
self.callback = callback
self.top = gtk.glade.XML(const.dialogFile, "name_edit","gramps")
@ -61,6 +64,8 @@ class NameEditor:
slist = self.top.get_widget("alt_surname_list")
self.combo = AutoComp.AutoCombo(slist,self.parent.db.getSurnames())
self.priv = self.top.get_widget("priv")
self.sources_label = self.top.get_widget("sourcesName")
self.notes_label = self.top.get_widget("noteName")
types = const.NameTypesMap.keys()
types.sort()
@ -83,7 +88,7 @@ class NameEditor:
Utils.set_titles(self.window, alt_title, tmsg, _('Alternate Name Editor'))
self.sourcetab = Sources.SourceTab(self.srcreflist, self.parent,
self.sourcetab = Sources.SourceTab(self.srcreflist, self,
self.top, self.window, self.slist,
self.top.get_widget('add_src'),
self.top.get_widget('edit_src'),
@ -91,6 +96,10 @@ class NameEditor:
self.note_buffer = self.note_field.get_buffer()
self.top.signal_autoconnect({
"on_switch_page" : self.on_switch_page
})
if name != None:
self.given_field.set_text(name.getFirstName())
self.surname_field.set_text(name.getSurname())
@ -99,6 +108,8 @@ class NameEditor:
self.type_field.entry.set_text(_(name.getType()))
self.priv.set_active(name.getPrivacy())
self.note_buffer.set_text(name.getNote())
if name.getNote():
Utils.bold_label(self.notes_label)
if parent_window:
self.window.set_transient_for(parent_window)
@ -165,4 +176,10 @@ class NameEditor:
self.name.setPrivacy(priv)
self.parent.lists_changed = 1
def on_switch_page(self,obj,a,page):
text = self.note_buffer.get_text(self.note_buffer.get_start_iter(),
self.note_buffer.get_end_iter(),gtk.FALSE)
if text:
Utils.bold_label(self.notes_label)
else:
Utils.unbold_label(self.notes_label)

View File

@ -191,6 +191,10 @@ class SourceTab:
base = s.getBase()
iter = self.model.append()
self.model.set(iter,0,base.getId(),1,base.getTitle())
if self.list:
Utils.bold_label(self.parent.sources_label)
else:
Utils.unbold_label(self.parent.sources_label)
def update_clist(self,inst,ref):
inst.redraw()

View File

@ -611,3 +611,20 @@ def roman(num):
return rnum
else:
return
#-------------------------------------------------------------------------
#
# Change label apperance
#
#-------------------------------------------------------------------------
def bold_label(label):
text = label.get_text()
label.set_text("<b>%s</b>" % text )
label.set_use_markup(1)
def unbold_label(label):
text = label.get_text()
text = string.replace(text,'<b>','')
text = string.replace(text,'</b>','')
label.set_text(text)
label.set_use_markup(0)

View File

@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
@ -73,6 +75,10 @@ class WitnessTab:
self.model.add([n,s.get_value()],s)
else:
self.model.add([s.get_value(),''],s)
if self.list:
Utils.bold_label(self.parent.witnesses_label)
else:
Utils.unbold_label(self.parent.witnesses_label)
def update_clist(self):
self.redraw()

View File

@ -100,6 +100,7 @@
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<signal name="switch_page" handler="on_switch_page" last_modification_time="Wed, 12 Nov 2003 17:45:51 GMT"/>
<child>
<widget class="GtkTable" id="table21">
@ -644,11 +645,11 @@
</child>
<child>
<widget class="GtkLabel" id="label272">
<widget class="GtkLabel" id="sourcesEvent">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -698,11 +699,11 @@
</child>
<child>
<widget class="GtkLabel" id="label273">
<widget class="GtkLabel" id="notesEvent">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -847,11 +848,11 @@
</child>
<child>
<widget class="GtkLabel" id="label291">
<widget class="GtkLabel" id="witnessesEvent">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Witnesses&lt;/b&gt;</property>
<property name="label" translatable="yes">Witnesses</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -976,6 +977,7 @@
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<signal name="switch_page" handler="on_switch_page" last_modification_time="Wed, 12 Nov 2003 18:09:36 GMT"/>
<child>
<widget class="GtkTable" id="table22">
@ -1302,11 +1304,11 @@
</child>
<child>
<widget class="GtkLabel" id="label278">
<widget class="GtkLabel" id="sourcesAttr">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1354,11 +1356,11 @@
</child>
<child>
<widget class="GtkLabel" id="label279">
<widget class="GtkLabel" id="noteAttr">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1842,6 +1844,7 @@
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<signal name="switch_page" handler="on_switch_page" last_modification_time="Wed, 12 Nov 2003 18:09:04 GMT"/>
<child>
<widget class="GtkTable" id="table26">
@ -2395,11 +2398,11 @@
</child>
<child>
<widget class="GtkLabel" id="label283">
<widget class="GtkLabel" id="sourcesAddr">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -2448,11 +2451,11 @@
</child>
<child>
<widget class="GtkLabel" id="label284">
<widget class="GtkLabel" id="noteAddr">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -2825,6 +2828,7 @@
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<signal name="switch_page" handler="on_switch_page" last_modification_time="Wed, 12 Nov 2003 18:00:13 GMT"/>
<child>
<widget class="GtkTable" id="table23">
@ -3432,11 +3436,11 @@
</child>
<child>
<widget class="GtkLabel" id="label288">
<widget class="GtkLabel" id="sourcesName">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -3485,11 +3489,11 @@
</child>
<child>
<widget class="GtkLabel" id="label289">
<widget class="GtkLabel" id="noteName">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>

View File

@ -5777,11 +5777,11 @@
</child>
<child>
<widget class="GtkLabel" id="label205">
<widget class="GtkLabel" id="notesSourceEditor">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -5935,11 +5935,11 @@
</child>
<child>
<widget class="GtkLabel" id="label206">
<widget class="GtkLabel" id="gallerySourceEditor">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Gallery&lt;/b&gt;</property>
<property name="label" translatable="yes">Gallery</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -5980,11 +5980,11 @@
</child>
<child>
<widget class="GtkLabel" id="label274">
<widget class="GtkLabel" id="refsSourceEditor">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;References&lt;/b&gt;</property>
<property name="label" translatable="yes">References</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>

View File

@ -103,6 +103,7 @@
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<signal name="switch_page" handler="on_switch_page" last_modification_time="Wed, 12 Nov 2003 18:22:42 GMT"/>
<child>
<widget class="GtkHBox" id="hbox16">
@ -834,11 +835,11 @@
</child>
<child>
<widget class="GtkLabel" id="label98">
<widget class="GtkLabel" id="eventsMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Events&lt;/b&gt;</property>
<property name="label" translatable="yes">Events</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1229,11 +1230,11 @@
</child>
<child>
<widget class="GtkLabel" id="label203">
<widget class="GtkLabel" id="attrMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Attributes&lt;/b&gt;</property>
<property name="label" translatable="yes">Attributes</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1280,11 +1281,11 @@
</child>
<child>
<widget class="GtkLabel" id="label99">
<widget class="GtkLabel" id="notesMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Notes&lt;/b&gt;</property>
<property name="label" translatable="yes">Notes</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1401,11 +1402,11 @@
</child>
<child>
<widget class="GtkLabel" id="label262">
<widget class="GtkLabel" id="sourcesMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1531,11 +1532,11 @@
</child>
<child>
<widget class="GtkLabel" id="label201">
<widget class="GtkLabel" id="galleryMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Gallery&lt;/b&gt;</property>
<property name="label" translatable="yes">Gallery</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1878,11 +1879,11 @@
</child>
<child>
<widget class="GtkLabel" id="label232">
<widget class="GtkLabel" id="ldsMarriage">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;LDS&lt;/b&gt;</property>
<property name="label" translatable="yes">LDS</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>

View File

@ -978,11 +978,11 @@
</child>
<child>
<widget class="GtkLabel" id="label263">
<widget class="GtkLabel" id="namesPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Other names&lt;/b&gt;</property>
<property name="label" translatable="yes">Other names</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1029,11 +1029,11 @@
</child>
<child>
<widget class="GtkLabel" id="label253">
<widget class="GtkLabel" id="notesPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Note&lt;/b&gt;</property>
<property name="label" translatable="yes">Note</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1177,11 +1177,11 @@
</child>
<child>
<widget class="GtkLabel" id="label282">
<widget class="GtkLabel" id="sourcesPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Sources&lt;/b&gt;</property>
<property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1331,11 +1331,11 @@
</child>
<child>
<widget class="GtkLabel" id="label254">
<widget class="GtkLabel" id="galleryPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Gallery&lt;/b&gt;</property>
<property name="label" translatable="yes">Gallery</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1688,11 +1688,11 @@
</child>
<child>
<widget class="GtkLabel" id="label261">
<widget class="GtkLabel" id="inetPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Internet&lt;/b&gt;</property>
<property name="label" translatable="yes">Internet</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
@ -1739,11 +1739,11 @@
</child>
<child>
<widget class="GtkLabel" id="label278">
<widget class="GtkLabel" id="refsPlaceEdit">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;References&lt;/b&gt;</property>
<property name="label" translatable="yes">References</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>