From 34f671b0d329ac2e814e37bef4261f51ceef5e53 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 29 Mar 2002 01:55:52 +0000 Subject: [PATCH] Tooltip addtion to report template svn: r872 --- gramps/src/Report.py | 10 +++++++--- gramps/src/plugins/GraphViz.py | 15 ++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gramps/src/Report.py b/gramps/src/Report.py index e150b8062..62e8c1c01 100644 --- a/gramps/src/Report.py +++ b/gramps/src/Report.py @@ -324,7 +324,7 @@ class ReportDialog: this task.""" pass - def add_option(self,label_text,widget): + def add_option(self,label_text,widget,tooltip=None): """Takes a text string and a Gtk Widget, and stores them to be appended to the Options section of the dialog. The text string is used to create a label for the passed widget. This allows the @@ -333,8 +333,10 @@ class ReportDialog: extracting the final value before the report executes. This task should only be called in the add_user_options task.""" self.widgets.append((label_text,widget)) + if tooltip: + self.add_tooltip(widget,tooltip) - def add_frame_option(self,frame_name,label_text,widget): + def add_frame_option(self,frame_name,label_text,widget,tooltip=None): """Similar to add_option this method takes a frame_name, a text string and a Gtk Widget. When the interface is built, all widgets with the same frame_name are grouped into a @@ -349,7 +351,9 @@ class ReportDialog: else: self.frames[frame_name] = [(label_text,widget)] self.frame_names.append(frame_name) - + if tooltip: + self.add_tooltip(widget,tooltip) + #------------------------------------------------------------------------ # # Functions to create a default output style. diff --git a/gramps/src/plugins/GraphViz.py b/gramps/src/plugins/GraphViz.py index a267eede2..d1a82f5cb 100644 --- a/gramps/src/plugins/GraphViz.py +++ b/gramps/src/plugins/GraphViz.py @@ -170,21 +170,18 @@ class GraphVizDialog(ReportDialog): menu.set_active(0) self.arrowhead_optionmenu.set_menu(menu) - tip = GtkTooltips() - tip.set_tip(self.arrowhead_optionmenu, _("Choose the direction that the arrows point.")) - self.add_frame_option(_("GraphViz Options"), _("Arrowhead Options"), self.arrowhead_optionmenu) + self.add_frame_option(_("GraphViz Options"), _("Arrowhead Options"), + self.arrowhead_optionmenu,_("Choose the direction that the arrows point.")) self.includedates_checkbutton = GtkCheckButton(_("Include Birth and Death Dates")) self.includedates_checkbutton.set_active(1) - tip = GtkTooltips() - tip.set_tip(self.includedates_checkbutton, _("Include the years that the individual was born and/or died in the graph node labels.")) - self.add_frame_option(_("GraphViz Options"), ' ', self.includedates_checkbutton) + self.add_frame_option(_("GraphViz Options"), '', self.includedates_checkbutton, + _("Include the years that the individual was born and/or died in the graph node labels.")) self.includeurl_checkbutton = GtkCheckButton(_("Include URLs")) self.includeurl_checkbutton.set_active(1) - tip = GtkTooltips() - tip.set_tip(self.includeurl_checkbutton, _("Include a URL in each graph node so that PDF and imagemap files can be generated that contain active links to the files generated by the 'Generate Web Site' report.")) - self.add_frame_option(_("GraphViz Options"), ' ', self.includeurl_checkbutton) + self.add_frame_option(_("GraphViz Options"), '', self.includeurl_checkbutton, + _("Include a URL in each graph node so that PDF and imagemap files can be generated that contain active links to the files generated by the 'Generate Web Site' report.")) self.tb_margin_adjustment = GtkAdjustment(value=0.5, lower=0.25, upper=100.0, step_incr=0.25) self.lr_margin_adjustment = GtkAdjustment(value=0.5, lower=0.25, upper=100.0, step_incr=0.25)