init media even on paste

This commit is contained in:
Damien Elmes 2009-01-09 13:21:46 +09:00
parent e185fb1e20
commit 132c56a53d

View file

@ -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: