From c359e8636425df2b9c627103c24755397ab38199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:28:56 +0800 Subject: [PATCH] .. --- src/LunaTranslator/gui/selecthook.py | 5 ++--- src/LunaTranslator/textsource/texthook.py | 9 +++++---- src/plugins/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/LunaTranslator/gui/selecthook.py b/src/LunaTranslator/gui/selecthook.py index f0053027..900e0398 100644 --- a/src/LunaTranslator/gui/selecthook.py +++ b/src/LunaTranslator/gui/selecthook.py @@ -385,7 +385,7 @@ class searchhookparam(LDialog): class hookselect(closeashidewindow): - addnewhooksignal = pyqtSignal(tuple, bool) + addnewhooksignal = pyqtSignal(tuple, bool, bool) getnewsentencesignal = pyqtSignal(str) sysmessagesignal = pyqtSignal(str) removehooksignal = pyqtSignal(tuple) @@ -471,9 +471,8 @@ class hookselect(closeashidewindow): self.saveifembedable = {} self.embedablenum = 0 - def addnewhook(self, key, select): + def addnewhook(self, key, select, isembedable): hc, hn, tp = key - isembedable = hc[0] == "E" if len(self.save) == 0: self.ttCombomodelmodel.setHorizontalHeaderLabels(self.currentheader) diff --git a/src/LunaTranslator/textsource/texthook.py b/src/LunaTranslator/textsource/texthook.py index 7579a4b4..5a9146b6 100644 --- a/src/LunaTranslator/textsource/texthook.py +++ b/src/LunaTranslator/textsource/texthook.py @@ -91,7 +91,8 @@ class SearchParam(Structure): findhookcallback_t = CFUNCTYPE(None, c_wchar_p, c_wchar_p) ProcessEvent = CFUNCTYPE(None, DWORD) -ThreadEvent = CFUNCTYPE(None, c_wchar_p, c_char_p, ThreadParam) +ThreadEvent = CFUNCTYPE(None, c_wchar_p, c_char_p, ThreadParam, c_bool) +ThreadEvent_2 = CFUNCTYPE(None, c_wchar_p, c_char_p, ThreadParam) OutputCallback = CFUNCTYPE(c_bool, c_wchar_p, c_char_p, ThreadParam, c_wchar_p) ConsoleHandler = CFUNCTYPE(None, c_wchar_p) HookInsertHandler = CFUNCTYPE(None, c_uint64, c_wchar_p) @@ -231,7 +232,7 @@ class texthook(basetext): ProcessEvent(self.onprocconnect), ProcessEvent(self.removeproc), ThreadEvent(self.onnewhook), - ThreadEvent(self.onremovehook), + ThreadEvent_2(self.onremovehook), OutputCallback(self.handle_output), ConsoleHandler(gobject.baseobject.hookselectdialog.sysmessagesignal.emit), HookInsertHandler(self.newhookinsert), @@ -512,7 +513,7 @@ class texthook(basetext): name = (hc[:8] == "UserHook" and _hc[:8] == "UserHook") or (hc == _hc) return base and name - def onnewhook(self, hc, hn, tp): + def onnewhook(self, hc, hn, tp, isembedable): key = (hc, hn.decode("utf8"), tp) self.hookdatacollecter[key] = [] @@ -524,7 +525,7 @@ class texthook(basetext): self.selectinghook = key select = True break - gobject.baseobject.hookselectdialog.addnewhooksignal.emit(key, select) + gobject.baseobject.hookselectdialog.addnewhooksignal.emit(key, select, isembedable) return True def setsettings(self): diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 79610b42..670db548 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 45) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)