diff --git a/LunaTranslator/LunaTranslator/gui/edittext.py b/LunaTranslator/LunaTranslator/gui/edittext.py index 788fd29d..b547eb04 100644 --- a/LunaTranslator/LunaTranslator/gui/edittext.py +++ b/LunaTranslator/LunaTranslator/gui/edittext.py @@ -1,6 +1,6 @@ from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( - QTextBrowser, + QPlainTextEdit, QAction, QMenu, QHBoxLayout, @@ -32,7 +32,7 @@ class edittext(closeashidewindow): def setupUi(self): self.setWindowIcon(qtawesome.icon("fa.edit")) - self.textOutput = QTextBrowser(self) + self.textOutput = QPlainTextEdit(self) self.textOutput.setContextMenuPolicy(Qt.CustomContextMenu) @@ -42,7 +42,6 @@ class edittext(closeashidewindow): self.textOutput.setUndoRedoEnabled(True) self.textOutput.setReadOnly(False) - self.textOutput.setObjectName("textOutput") qv = QHBoxLayout() w = QWidget() diff --git a/LunaTranslator/LunaTranslator/gui/inputdialog.py b/LunaTranslator/LunaTranslator/gui/inputdialog.py index ffa20760..58d17b61 100644 --- a/LunaTranslator/LunaTranslator/gui/inputdialog.py +++ b/LunaTranslator/LunaTranslator/gui/inputdialog.py @@ -419,10 +419,6 @@ class postconfigdialog_(QDialog): lb.setText(_TR(key)) formLayout.addWidget(lb) - # lines=QTextEdit(self) - # lines.setPlainText('\n'.join(configdict[key])) - # lines.textChanged.connect(lambda :configdict.__setitem__(key,lines.toPlainText().split('\n'))) - # formLayout.addWidget(lines) model = QStandardItemModel(len(configdict[key]), 1, self) row = 0 diff --git a/LunaTranslator/LunaTranslator/gui/settingpage7.py b/LunaTranslator/LunaTranslator/gui/settingpage7.py index fedc2579..b10353a1 100644 --- a/LunaTranslator/LunaTranslator/gui/settingpage7.py +++ b/LunaTranslator/LunaTranslator/gui/settingpage7.py @@ -2,7 +2,7 @@ import functools from PyQt5.QtWidgets import ( QHBoxLayout, - QTextEdit, + QPlainTextEdit, QHBoxLayout, QWidget, QMenu, @@ -79,8 +79,8 @@ def setTab7(self): def getcomparelayout(self): layout = QHBoxLayout() - fromtext = QTextEdit() - totext = QTextEdit() + fromtext =QPlainTextEdit() + totext = QPlainTextEdit() solvebutton = getcolorbutton( globalconfig, "", diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index 047f66c7..9955323b 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -8,7 +8,6 @@ from PyQt5.QtWidgets import ( QFormLayout, QSizePolicy, QPushButton, - QTextEdit, QTabWidget, QFileDialog, QTabBar, @@ -459,7 +458,7 @@ class AnkiWindow(QWidget): self.viewimagelabel = QLabel() self.editpath.textChanged.connect(self.wrappedpixmap) self.example = QPlainTextEdit() - self.remarks = QTextEdit() + self.remarks = QPlainTextEdit() recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"], colors=[""]) recordbtn1.statuschanged1.connect( functools.partial(self.startorendrecord, "1", self.audiopath) diff --git a/LunaTranslator/LunaTranslator/gui/textbrowser.py b/LunaTranslator/LunaTranslator/gui/textbrowser.py index 4f7fe920..3e8d9ccf 100644 --- a/LunaTranslator/LunaTranslator/gui/textbrowser.py +++ b/LunaTranslator/LunaTranslator/gui/textbrowser.py @@ -247,7 +247,6 @@ class Textbrowser: self.jiaming_y_delta = 0 self.setselectable() self.blockcount = 0 - self.needdouble = False self.iteryinyinglabelsave = {} def setselectable(self): @@ -331,10 +330,6 @@ class Textbrowser: self.textbrowser.insertPlainText(text) def deletebetween(self, p1, p2): - if self.needdouble: - self.textcursorback.setPosition(p1, QTextCursor.MoveAnchor) - self.textcursorback.setPosition(p2, QTextCursor.KeepAnchor) - self.textcursorback.removeSelectedText() self.textcursor.setPosition(p1, QTextCursor.MoveAnchor) self.textcursor.setPosition(p2, QTextCursor.KeepAnchor) self.textcursor.removeSelectedText() diff --git a/LunaTranslator/LunaTranslator/gui/transhist.py b/LunaTranslator/LunaTranslator/gui/transhist.py index 4ba29f55..2cd05108 100644 --- a/LunaTranslator/LunaTranslator/gui/transhist.py +++ b/LunaTranslator/LunaTranslator/gui/transhist.py @@ -1,5 +1,4 @@ -from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import QTabWidget, QTextBrowser, QAction, QMenu, QFileDialog +from PyQt5.QtWidgets import QPlainTextEdit, QAction, QMenu, QFileDialog from PyQt5.QtCore import Qt, pyqtSignal import qtawesome, functools, winsharedutils from gui.usefulwidget import closeashidewindow @@ -26,14 +25,13 @@ class transhist(closeashidewindow): self.setWindowIcon(qtawesome.icon("fa.rotate-left")) def gettb(_type): - textOutput = QTextBrowser() + textOutput = QPlainTextEdit() textOutput.setContextMenuPolicy(Qt.CustomContextMenu) textOutput.customContextMenuRequested.connect( functools.partial(self.showmenu, textOutput, _type) ) textOutput.setUndoRedoEnabled(False) textOutput.setReadOnly(True) - textOutput.setObjectName("textOutput") return textOutput self.textOutput = gettb(1) @@ -76,14 +74,14 @@ class transhist(closeashidewindow): def getnewsentence(self, sentence): - sentence = "