mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 07:07:13 -05:00
fix copy/paste of colours & images from anki to anki
This commit is contained in:
parent
2d8343520e
commit
f5b4e9f689
1 changed files with 7 additions and 5 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue