mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
init media even on paste
This commit is contained in:
parent
e185fb1e20
commit
132c56a53d
1 changed files with 2 additions and 2 deletions
|
@ -549,7 +549,6 @@ class FactEditor(object):
|
|||
return True
|
||||
|
||||
def onAddPicture(self):
|
||||
self.initMedia()
|
||||
# get this before we open the dialog
|
||||
w = self.focusedEdit()
|
||||
key = _("Images (*.jpg *.png *.gif *.tiff *.svg *.tif *.jpeg)")
|
||||
|
@ -559,6 +558,7 @@ class FactEditor(object):
|
|||
self._addPicture(file, widget=w)
|
||||
|
||||
def _addPicture(self, file, widget=None):
|
||||
self.initMedia()
|
||||
if widget:
|
||||
w = widget
|
||||
else:
|
||||
|
@ -567,7 +567,6 @@ class FactEditor(object):
|
|||
w.insertHtml('<img src="%s">' % path)
|
||||
|
||||
def onAddSound(self):
|
||||
self.initMedia()
|
||||
# get this before we open the dialog
|
||||
w = self.focusedEdit()
|
||||
key = _("Sounds (*.mp3 *.ogg *.wav)")
|
||||
|
@ -577,6 +576,7 @@ class FactEditor(object):
|
|||
self._addSound(file, widget=w)
|
||||
|
||||
def _addSound(self, file, widget=None):
|
||||
self.initMedia()
|
||||
if widget:
|
||||
w = widget
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue