mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
Revert "anki自动在例句中加粗原单词 (#765)"
This reverts commit 0d033e1b3d27f4c6bbc82c6ef89a57fac7b453be.
This commit is contained in:
parent
8f057e7294
commit
f9a0bc6b6c
@ -149,11 +149,8 @@ class AnkiWindow(QWidget):
|
||||
|
||||
def langdu2(self):
|
||||
if gobject.baseobject.reader:
|
||||
example_text = self.example.toPlainText()
|
||||
example_text = example_text.replace("<b>", "")
|
||||
example_text = example_text.replace("</b>", "")
|
||||
gobject.baseobject.reader.ttscallback(
|
||||
example_text,
|
||||
self.example.toPlainText(),
|
||||
functools.partial(self.callbacktts, self.audiopath_sentence),
|
||||
)
|
||||
|
||||
@ -740,7 +737,7 @@ class selectviewer(QWidget):
|
||||
|
||||
|
||||
class searchwordW(closeashidewindow):
|
||||
getnewsentencesignal = pyqtSignal(str, str, bool)
|
||||
getnewsentencesignal = pyqtSignal(str, bool)
|
||||
showtabsignal = pyqtSignal(float, str, str)
|
||||
|
||||
def __init__(self, parent):
|
||||
@ -849,19 +846,16 @@ class searchwordW(closeashidewindow):
|
||||
res.insert(idx, {"source": k, "content": v})
|
||||
return res
|
||||
|
||||
def getnewsentence(self, sentence, sentence_trans, append):
|
||||
def getnewsentence(self, sentence, append):
|
||||
sentence = sentence.strip()
|
||||
sentence_trans = sentence_trans.strip()
|
||||
self.showNormal()
|
||||
if append:
|
||||
sentence = self.searchtext.text() + sentence
|
||||
self.searchtext.setText(sentence)
|
||||
|
||||
self.search(sentence)
|
||||
example_text = gobject.baseobject.currenttext
|
||||
if sentence_trans in example_text:
|
||||
example_text = example_text.replace(sentence_trans, f"<b>{sentence_trans}</b>")
|
||||
self.ankiwindow.example.setPlainText(example_text)
|
||||
|
||||
self.ankiwindow.example.setPlainText(gobject.baseobject.currenttext)
|
||||
if globalconfig["ankiconnect"]["autoruntts"]:
|
||||
self.ankiwindow.langdu()
|
||||
if globalconfig["ankiconnect"]["autoruntts2"]:
|
||||
|
@ -238,7 +238,6 @@ class QUnFrameWindow(resizableframeless):
|
||||
if hira:
|
||||
|
||||
def callback(word, append):
|
||||
word_in_sentence = word["orig"]
|
||||
if globalconfig["usewordorigin"] == False:
|
||||
word = word["orig"]
|
||||
else:
|
||||
@ -253,7 +252,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
winsharedutils.clipboard_set(word)
|
||||
if globalconfig["usesearchword"]:
|
||||
gobject.baseobject.searchwordW.getnewsentencesignal.emit(
|
||||
word, word_in_sentence, append
|
||||
word, append
|
||||
)
|
||||
|
||||
self.translate_text.addsearchwordmask(hira, text, callback)
|
||||
|
Loading…
x
Reference in New Issue
Block a user