From c3c8a632de8b7ce3fd44f39c162bf470adc9f4e3 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 27 Jan 2017 16:20:49 +0000 Subject: [PATCH] 6085: Remove import from the gui module --- gramps/gen/plug/_gramplet.py | 4 +--- gramps/gui/widgets/grampletpane.py | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py index c7129d0a8..ac89c1c79 100644 --- a/gramps/gen/plug/_gramplet.py +++ b/gramps/gen/plug/_gramplet.py @@ -404,9 +404,7 @@ class Gramplet: """ Add an option to the GUI gramplet. """ - from gramps.gui.plug import make_gui_option - widget, label = make_gui_option( - option, self.dbstate, self.uistate, self.track) + widget, label = self.gui.add_gui_option(option) self.option_dict.update({option.get_label(): [widget, option]}) self.option_order.append(option.get_label()) diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index 590201d7a..04b73a1ef 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -50,6 +50,7 @@ from ..editors import EditPerson, EditFamily from ..managedwindow import ManagedWindow from ..utils import is_right_click, rgb_to_hex from .menuitem import add_menuitem +from ..plug import make_gui_option from ..plug.quick import run_quick_report_by_name from ..display import display_help, display_url from ..glade import Glade @@ -345,6 +346,7 @@ class GuiGramplet: self.view = pane.pageview self.dbstate = dbstate self.uistate = uistate + self.track = [] self.title = title self.detached_window = None self.force_update = False @@ -549,6 +551,12 @@ class GuiGramplet: def get_container_widget(self): raise NotImplementedError + def add_gui_option(self, option): + """ + Add an option to the GUI gramplet. + """ + return make_gui_option(option, self.dbstate, self.uistate, self.track) + def make_gui_options(self): if not self.pui: return # BEGIN WORKAROUND: