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
|
return True
|
||||||
|
|
||||||
def onAddPicture(self):
|
def onAddPicture(self):
|
||||||
self.initMedia()
|
|
||||||
# get this before we open the dialog
|
# get this before we open the dialog
|
||||||
w = self.focusedEdit()
|
w = self.focusedEdit()
|
||||||
key = _("Images (*.jpg *.png *.gif *.tiff *.svg *.tif *.jpeg)")
|
key = _("Images (*.jpg *.png *.gif *.tiff *.svg *.tif *.jpeg)")
|
||||||
|
@ -559,6 +558,7 @@ class FactEditor(object):
|
||||||
self._addPicture(file, widget=w)
|
self._addPicture(file, widget=w)
|
||||||
|
|
||||||
def _addPicture(self, file, widget=None):
|
def _addPicture(self, file, widget=None):
|
||||||
|
self.initMedia()
|
||||||
if widget:
|
if widget:
|
||||||
w = widget
|
w = widget
|
||||||
else:
|
else:
|
||||||
|
@ -567,7 +567,6 @@ class FactEditor(object):
|
||||||
w.insertHtml('<img src="%s">' % path)
|
w.insertHtml('<img src="%s">' % path)
|
||||||
|
|
||||||
def onAddSound(self):
|
def onAddSound(self):
|
||||||
self.initMedia()
|
|
||||||
# get this before we open the dialog
|
# get this before we open the dialog
|
||||||
w = self.focusedEdit()
|
w = self.focusedEdit()
|
||||||
key = _("Sounds (*.mp3 *.ogg *.wav)")
|
key = _("Sounds (*.mp3 *.ogg *.wav)")
|
||||||
|
@ -577,6 +576,7 @@ class FactEditor(object):
|
||||||
self._addSound(file, widget=w)
|
self._addSound(file, widget=w)
|
||||||
|
|
||||||
def _addSound(self, file, widget=None):
|
def _addSound(self, file, widget=None):
|
||||||
|
self.initMedia()
|
||||||
if widget:
|
if widget:
|
||||||
w = widget
|
w = widget
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue