From 249751fddd9ccbe265ad004e29b213729f6c9f63 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 8 Dec 2008 15:58:47 +0900 Subject: [PATCH] fix inserting image --- ankiqt/ui/facteditor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index a8591311e..83a8a13b4 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -540,10 +540,13 @@ class FactEditor(object): file = ui.utils.getFile(self.parent, _("Add an image"), "picture", key) if not file: return - self._addPicture(file) + self._addPicture(file, widget=w) - def _addPicture(self, file): - w = self.focusedEdit() + def _addPicture(self, file, widget=None): + if widget: + w = widget + else: + w = self.focusedEdit() path = self.deck.addMedia(file) w.insertHtml('' % path)