From 0af4662b17bf59956deb3f370970b3523c599b07 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 4 Dec 2006 05:03:58 +0000 Subject: [PATCH] 2006-12-03 Don Allingham * src/DataViews/_RelationView.py: improve tooltips * src/GrampsWidgets.py: tooltip support svn: r7756 --- gramps2/ChangeLog | 4 ++++ gramps2/src/DataViews/_RelationView.py | 19 ++++++++++++++++++- gramps2/src/GrampsWidgets.py | 10 ++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5ed140e9d..4b8c894a8 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-12-03 Don Allingham + * src/DataViews/_RelationView.py: improve tooltips + * src/GrampsWidgets.py: tooltip support + 2006-12-03 Brian Matherly * src/plugins/NarrativeWeb.py: fix 0000595: Narrative web site, save to tar.gz format causes cash diff --git a/gramps2/src/DataViews/_RelationView.py b/gramps2/src/DataViews/_RelationView.py index c659b2338..977bebd6e 100644 --- a/gramps2/src/DataViews/_RelationView.py +++ b/gramps2/src/DataViews/_RelationView.py @@ -372,6 +372,7 @@ class RelationshipView(PageView.PersonNavView): if self.redrawing: return False self.redrawing = True + self.tooltips = gtk.Tooltips() for old_child in self.vbox.get_children(): self.vbox.remove(old_child) @@ -475,6 +476,7 @@ class RelationshipView(PageView.PersonNavView): label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender]) if Config.get(Config.RELEDITBTN): button = GrampsWidgets.IconButton(self.edit_button_press,person.handle) + self.tooltips.set_tip(button,_('Edit %s') % name) else: button = None hbox = GrampsWidgets.LinkBox(label, button) @@ -621,7 +623,15 @@ class RelationshipView(PageView.PersonNavView): if is_parent: call_fcn = self.add_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: + add_msg = _('Add spouse') + sel_msg = _('Select spouse') + edit_msg = _('Edit family') + del_msg = _('Remove from family') call_fcn = self.add_family del_fcn = self.delete_family @@ -629,21 +639,26 @@ class RelationshipView(PageView.PersonNavView): # Show edit-Buttons if toolbar is not visible if self.reorder_sensitive: add = GrampsWidgets.IconButton(self.reorder, None, gtk.STOCK_SORT_ASCENDING) + self.tooltips.set_tip(add, _('Reorder families')) hbox.pack_start(add, False) add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD) + self.tooltips.set_tip(add, add_msg) hbox.pack_start(add, False) if is_parent: add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX) + self.tooltips.set_tip(add, sel_msg) hbox.pack_start(add, False) if family: edit = GrampsWidgets.IconButton(self.edit_family, family.handle, gtk.STOCK_EDIT) + self.tooltips.set_tip(edit, edit_msg) hbox.pack_start(edit, False) delete = GrampsWidgets.IconButton(del_fcn, family.handle, gtk.STOCK_REMOVE) + self.tooltips.set_tip(delete, del_msg) hbox.pack_start(delete, False) self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1) self.row += 1 @@ -705,12 +720,14 @@ class RelationshipView(PageView.PersonNavView): vbox = gtk.VBox() 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) if self.use_shade: link_label.modify_bg(gtk.STATE_NORMAL, self.color) if Config.get(Config.RELEDITBTN): button = GrampsWidgets.IconButton(self.edit_button_press, handle) + self.tooltips.set_tip(button, _('Edit %s') % name[0]) else: button = None vbox.pack_start(GrampsWidgets.LinkBox(link_label, button)) diff --git a/gramps2/src/GrampsWidgets.py b/gramps2/src/GrampsWidgets.py index 781b3a3fa..9012423fb 100644 --- a/gramps2/src/GrampsWidgets.py +++ b/gramps2/src/GrampsWidgets.py @@ -39,6 +39,8 @@ import DateHandler import DateEdit import const import Errors +import Config + from DdTargets import DdTargets _lock_path = os.path.join(const.image_dir, 'stock_lock.png') @@ -54,7 +56,15 @@ class LinkLabel(gtk.EventBox): gtk.EventBox.__init__(self) self.orig_text = cgi.escape(label[0]) self.gender = label[1] + self.tooltips = gtk.Tooltips() text = '%s' % 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.set_use_markup(True)