mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
45d913db65
commit
18e85c9a39
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
set(VERSION_MAJOR 6)
|
set(VERSION_MAJOR 6)
|
||||||
set(VERSION_MINOR 16)
|
set(VERSION_MINOR 16)
|
||||||
set(VERSION_PATCH 11)
|
set(VERSION_PATCH 12)
|
||||||
set(VERSION_REVISION 0)
|
set(VERSION_REVISION 0)
|
||||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||||
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
||||||
|
@ -39,8 +39,9 @@ class weblio(cishubase):
|
|||||||
|
|
||||||
def makelink(self, link):
|
def makelink(self, link):
|
||||||
if not self.style.get(link):
|
if not self.style.get(link):
|
||||||
html = requests.get(
|
req = requests.get(
|
||||||
link,
|
link,
|
||||||
proxies=self.proxy,
|
proxies=self.proxy,
|
||||||
).text
|
)
|
||||||
|
html = req.text if req.status_code == 200 else ""
|
||||||
self.style[link] = html
|
self.style[link] = html
|
||||||
|
@ -495,6 +495,29 @@ class AnkiWindow(QWidget):
|
|||||||
clearbtn.clicked.connect(lambda: target.clear())
|
clearbtn.clicked.connect(lambda: target.clear())
|
||||||
return clearbtn
|
return clearbtn
|
||||||
|
|
||||||
|
class ctrlbedit(FQPlainTextEdit):
|
||||||
|
def keyPressEvent(self, e):
|
||||||
|
if (
|
||||||
|
e.modifiers() == Qt.KeyboardModifier.ControlModifier
|
||||||
|
and e.key() == Qt.Key.Key_B
|
||||||
|
):
|
||||||
|
cursor = self.textCursor()
|
||||||
|
if cursor.hasSelection():
|
||||||
|
selected_text = cursor.selectedText()
|
||||||
|
new_text = "<b>{}</b>".format(selected_text)
|
||||||
|
|
||||||
|
start = cursor.selectionStart()
|
||||||
|
|
||||||
|
cursor.beginEditBlock()
|
||||||
|
cursor.insertText(new_text)
|
||||||
|
cursor.endEditBlock()
|
||||||
|
cursor.setPosition(start, QTextCursor.MoveMode.MoveAnchor)
|
||||||
|
cursor.setPosition(
|
||||||
|
start + len(new_text), QTextCursor.MoveMode.KeepAnchor
|
||||||
|
)
|
||||||
|
self.setTextCursor(cursor)
|
||||||
|
return super().keyPressEvent(e)
|
||||||
|
|
||||||
self.audiopath = QLineEdit()
|
self.audiopath = QLineEdit()
|
||||||
self.audiopath.setReadOnly(True)
|
self.audiopath.setReadOnly(True)
|
||||||
self.audiopath_sentence = QLineEdit()
|
self.audiopath_sentence = QLineEdit()
|
||||||
@ -503,8 +526,8 @@ class AnkiWindow(QWidget):
|
|||||||
self.editpath.setReadOnly(True)
|
self.editpath.setReadOnly(True)
|
||||||
self.viewimagelabel = pixmapviewer()
|
self.viewimagelabel = pixmapviewer()
|
||||||
self.editpath.textChanged.connect(self.wrappedpixmap)
|
self.editpath.textChanged.connect(self.wrappedpixmap)
|
||||||
self.example = FQPlainTextEdit()
|
self.example = ctrlbedit()
|
||||||
self.zhuyinedit = FQPlainTextEdit()
|
self.zhuyinedit = ctrlbedit()
|
||||||
self.wordedit = FQLineEdit()
|
self.wordedit = FQLineEdit()
|
||||||
self.wordedit.textChanged.connect(self.wordedit_t)
|
self.wordedit.textChanged.connect(self.wordedit_t)
|
||||||
self.example.hiras = None
|
self.example.hiras = None
|
||||||
@ -513,7 +536,7 @@ class AnkiWindow(QWidget):
|
|||||||
self.example.hiras = None
|
self.example.hiras = None
|
||||||
|
|
||||||
self.example.textChanged.connect(__)
|
self.example.textChanged.connect(__)
|
||||||
self.remarks = FQPlainTextEdit()
|
self.remarks = ctrlbedit()
|
||||||
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"])
|
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"])
|
||||||
recordbtn1.clicked.connect(
|
recordbtn1.clicked.connect(
|
||||||
functools.partial(self.startorendrecord, 1, self.audiopath)
|
functools.partial(self.startorendrecord, 1, self.audiopath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user