diff --git a/gourmet/reccard.py b/gourmet/reccard.py index 14587bf7c..71a3aea6f 100644 --- a/gourmet/reccard.py +++ b/gourmet/reccard.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from typing import Callable import gc import webbrowser @@ -8,7 +9,6 @@ from PIL import Image except ImportError: import Image -import types import xml.sax.saxutils from gi.repository import Pango from .exporters import exportManager @@ -2834,9 +2834,10 @@ def inverse (self): self.history.remove(self) self.inverse_action() -def add_with_undo (rc,method): - idx = rc.re.module_tab_by_name["ingredients"] - ing_controller = rc.re.modules[idx].ingtree_ui.ingController + +def add_with_undo(rc: 'RecCard', method: Callable): + idx = rc.recipe_editor.module_tab_by_name["ingredients"] + ing_controller = rc.recipe_editor.modules[idx].ingtree_ui.ingController uts = UndoableTreeStuff(ing_controller) def do_it ():