This commit is contained in:
恍兮惚兮 2025-01-01 22:58:36 +08:00
parent 45d913db65
commit 18e85c9a39
3 changed files with 30 additions and 6 deletions

View File

@ -1,7 +1,7 @@
set(VERSION_MAJOR 6)
set(VERSION_MINOR 16)
set(VERSION_PATCH 11)
set(VERSION_PATCH 12)
set(VERSION_REVISION 0)
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)

View File

@ -39,8 +39,9 @@ class weblio(cishubase):
def makelink(self, link):
if not self.style.get(link):
html = requests.get(
req = requests.get(
link,
proxies=self.proxy,
).text
)
html = req.text if req.status_code == 200 else ""
self.style[link] = html

View File

@ -495,6 +495,29 @@ class AnkiWindow(QWidget):
clearbtn.clicked.connect(lambda: target.clear())
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.setReadOnly(True)
self.audiopath_sentence = QLineEdit()
@ -503,8 +526,8 @@ class AnkiWindow(QWidget):
self.editpath.setReadOnly(True)
self.viewimagelabel = pixmapviewer()
self.editpath.textChanged.connect(self.wrappedpixmap)
self.example = FQPlainTextEdit()
self.zhuyinedit = FQPlainTextEdit()
self.example = ctrlbedit()
self.zhuyinedit = ctrlbedit()
self.wordedit = FQLineEdit()
self.wordedit.textChanged.connect(self.wordedit_t)
self.example.hiras = None
@ -513,7 +536,7 @@ class AnkiWindow(QWidget):
self.example.hiras = None
self.example.textChanged.connect(__)
self.remarks = FQPlainTextEdit()
self.remarks = ctrlbedit()
recordbtn1 = statusbutton(icons=["fa.microphone", "fa.stop"])
recordbtn1.clicked.connect(
functools.partial(self.startorendrecord, 1, self.audiopath)