2006-12-03 Don Allingham <don@gramps-project.org>

* src/DataViews/_RelationView.py: improve tooltips
	* src/GrampsWidgets.py: tooltip support



svn: r7756
This commit is contained in:
Don Allingham 2006-12-04 05:03:58 +00:00
parent 489d314db9
commit 01ebb7e67a
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2006-12-03 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: improve tooltips
* src/GrampsWidgets.py: tooltip support
2006-12-03 Brian Matherly <brian@gramps-project.org> 2006-12-03 Brian Matherly <brian@gramps-project.org>
* src/plugins/NarrativeWeb.py: fix 0000595: Narrative web site, save to * src/plugins/NarrativeWeb.py: fix 0000595: Narrative web site, save to
tar.gz format causes cash tar.gz format causes cash

View File

@ -372,6 +372,7 @@ class RelationshipView(PageView.PersonNavView):
if self.redrawing: if self.redrawing:
return False return False
self.redrawing = True self.redrawing = True
self.tooltips = gtk.Tooltips()
for old_child in self.vbox.get_children(): for old_child in self.vbox.get_children():
self.vbox.remove(old_child) self.vbox.remove(old_child)
@ -475,6 +476,7 @@ class RelationshipView(PageView.PersonNavView):
label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender]) label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender])
if Config.get(Config.RELEDITBTN): if Config.get(Config.RELEDITBTN):
button = GrampsWidgets.IconButton(self.edit_button_press,person.handle) button = GrampsWidgets.IconButton(self.edit_button_press,person.handle)
self.tooltips.set_tip(button,_('Edit %s') % name)
else: else:
button = None button = None
hbox = GrampsWidgets.LinkBox(label, button) hbox = GrampsWidgets.LinkBox(label, button)
@ -621,7 +623,15 @@ class RelationshipView(PageView.PersonNavView):
if is_parent: if is_parent:
call_fcn = self.add_parent_family call_fcn = self.add_parent_family
del_fcn = self.delete_parent_family del_fcn = self.delete_parent_family
add_msg = _('Add parents')
sel_msg = _('Select existing parents')
edit_msg = _('Edit parents')
del_msg = _('Remove parents')
else: else:
add_msg = _('Add spouse')
sel_msg = _('Select spouse')
edit_msg = _('Edit family')
del_msg = _('Remove from family')
call_fcn = self.add_family call_fcn = self.add_family
del_fcn = self.delete_family del_fcn = self.delete_family
@ -629,21 +639,26 @@ class RelationshipView(PageView.PersonNavView):
# Show edit-Buttons if toolbar is not visible # Show edit-Buttons if toolbar is not visible
if self.reorder_sensitive: if self.reorder_sensitive:
add = GrampsWidgets.IconButton(self.reorder, None, gtk.STOCK_SORT_ASCENDING) add = GrampsWidgets.IconButton(self.reorder, None, gtk.STOCK_SORT_ASCENDING)
self.tooltips.set_tip(add, _('Reorder families'))
hbox.pack_start(add, False) hbox.pack_start(add, False)
add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD) add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD)
self.tooltips.set_tip(add, add_msg)
hbox.pack_start(add, False) hbox.pack_start(add, False)
if is_parent: if is_parent:
add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX) add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX)
self.tooltips.set_tip(add, sel_msg)
hbox.pack_start(add, False) hbox.pack_start(add, False)
if family: if family:
edit = GrampsWidgets.IconButton(self.edit_family, family.handle, edit = GrampsWidgets.IconButton(self.edit_family, family.handle,
gtk.STOCK_EDIT) gtk.STOCK_EDIT)
self.tooltips.set_tip(edit, edit_msg)
hbox.pack_start(edit, False) hbox.pack_start(edit, False)
delete = GrampsWidgets.IconButton(del_fcn, family.handle, delete = GrampsWidgets.IconButton(del_fcn, family.handle,
gtk.STOCK_REMOVE) gtk.STOCK_REMOVE)
self.tooltips.set_tip(delete, del_msg)
hbox.pack_start(delete, False) hbox.pack_start(delete, False)
self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1) self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1)
self.row += 1 self.row += 1
@ -705,12 +720,14 @@ class RelationshipView(PageView.PersonNavView):
vbox = gtk.VBox() vbox = gtk.VBox()
if handle: if handle:
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True), name = self.get_name(handle, True)
link_label = GrampsWidgets.LinkLabel(name,
self.button_press, handle) self.button_press, handle)
if self.use_shade: if self.use_shade:
link_label.modify_bg(gtk.STATE_NORMAL, self.color) link_label.modify_bg(gtk.STATE_NORMAL, self.color)
if Config.get(Config.RELEDITBTN): if Config.get(Config.RELEDITBTN):
button = GrampsWidgets.IconButton(self.edit_button_press, handle) button = GrampsWidgets.IconButton(self.edit_button_press, handle)
self.tooltips.set_tip(button, _('Edit %s') % name[0])
else: else:
button = None button = None
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button)) vbox.pack_start(GrampsWidgets.LinkBox(link_label, button))

View File

@ -39,6 +39,8 @@ import DateHandler
import DateEdit import DateEdit
import const import const
import Errors import Errors
import Config
from DdTargets import DdTargets from DdTargets import DdTargets
_lock_path = os.path.join(const.image_dir, 'stock_lock.png') _lock_path = os.path.join(const.image_dir, 'stock_lock.png')
@ -54,8 +56,16 @@ class LinkLabel(gtk.EventBox):
gtk.EventBox.__init__(self) gtk.EventBox.__init__(self)
self.orig_text = cgi.escape(label[0]) self.orig_text = cgi.escape(label[0])
self.gender = label[1] self.gender = label[1]
self.tooltips = gtk.Tooltips()
text = '<span underline="single">%s</span>' % self.orig_text text = '<span underline="single">%s</span>' % self.orig_text
msg = _('Click to make the active person\n'
'Right click to display the edit menu')
if not Config.get(Config.RELEDITBTN):
msg += "\n" + _('Edit icons can be enabled in the Preferences dialog')
self.tooltips.set_tip(self, msg)
self.label = gtk.Label(text) self.label = gtk.Label(text)
self.label.set_use_markup(True) self.label.set_use_markup(True)
self.label.set_alignment(0, 0.5) self.label.set_alignment(0, 0.5)