mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
Paste into ini edit as plain text only.
This commit is contained in:
parent
c9cb51f8c4
commit
a14b39eb4c
1 changed files with 12 additions and 2 deletions
|
|
@ -1320,6 +1320,17 @@ class EditTextDialog(SizePersistedDialog):
|
|||
def get_reason_text(self):
|
||||
return unicode(self.reason_edit.currentText()).strip()
|
||||
|
||||
class QTextEditPlainPaste(QTextEdit):
|
||||
def insertFromMimeData(self, mimeData):
|
||||
# logger.debug("insertFromMimeData called")
|
||||
#Ensure it is text.
|
||||
if (mimeData.hasText()):
|
||||
text = mimeData.text()
|
||||
self.insertPlainText(text)
|
||||
#In case not text.
|
||||
else:
|
||||
QTextEdit.insertFromMimeData(self, mimeData)
|
||||
|
||||
class IniTextDialog(SizePersistedDialog):
|
||||
|
||||
def __init__(self, parent, text,
|
||||
|
|
@ -1341,7 +1352,7 @@ class IniTextDialog(SizePersistedDialog):
|
|||
self.setWindowIcon(icon)
|
||||
self.l.addWidget(self.label)
|
||||
|
||||
self.textedit = QTextEdit(self)
|
||||
self.textedit = QTextEditPlainPaste(self)
|
||||
|
||||
highlighter = IniHighlighter(self.textedit,
|
||||
sections=get_valid_sections(),
|
||||
|
|
@ -1512,7 +1523,6 @@ class IniTextDialog(SizePersistedDialog):
|
|||
# And finally we set this new cursor as the parent's
|
||||
self.textedit.setTextCursor(cursor)
|
||||
|
||||
|
||||
class ViewLog(SizePersistedDialog):
|
||||
|
||||
def label_clicked(self, event, lineno=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue