fix copy/paste of colours & images from anki to anki

This commit is contained in:
Damien Elmes 2009-01-17 16:55:02 +09:00
parent 2d8343520e
commit f5b4e9f689

View file

@ -612,15 +612,17 @@ class FactEdit(QTextEdit):
QTextEdit.__init__(self, *args) QTextEdit.__init__(self, *args)
self.parent = parent self.parent = parent
def canInsertFromMimeData(self, src): def canInsertFromMimeData(self, source):
return (src.hasUrls() or return (source.hasUrls() or
src.hasText() or source.hasText() or
src.hasImage() or source.hasImage() or
src.hasHtml()) source.hasHtml())
def insertFromMimeData(self, source): def insertFromMimeData(self, source):
pics = ("jpg", "jpeg", "png", "tif", "tiff", "gif") pics = ("jpg", "jpeg", "png", "tif", "tiff", "gif")
audio = ("wav", "mp3", "ogg", "flac") audio = ("wav", "mp3", "ogg", "flac")
if source.hasHtml() and "qrichtext" in unicode(source.html()):
self.insertHtml(source.html())
if source.hasText(): if source.hasText():
txt = unicode(source.text()) txt = unicode(source.text())
l = txt.lower() l = txt.lower()