mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
merge
This commit is contained in:
parent
9250c15940
commit
5d8ca201dd
@ -162,44 +162,39 @@ class MAINUI:
|
||||
|
||||
returnandembedcallback = lambda: embedcallback("") if embedcallback else ""
|
||||
|
||||
if type(text) == str:
|
||||
if text.startswith("<notrans>"):
|
||||
self.translation_ui.displayres.emit(
|
||||
dict(
|
||||
color=globalconfig["rawtextcolor"],
|
||||
res=text[len("<notrans>") :],
|
||||
onlytrans=onlytrans,
|
||||
clear=True,
|
||||
)
|
||||
if text.startswith("<notrans>"):
|
||||
self.translation_ui.displayres.emit(
|
||||
dict(
|
||||
color=globalconfig["rawtextcolor"],
|
||||
res=text[len("<notrans>") :],
|
||||
onlytrans=onlytrans,
|
||||
clear=True,
|
||||
)
|
||||
self.currenttext = text
|
||||
self.currenttranslate = text
|
||||
self.currentread = text
|
||||
return
|
||||
else:
|
||||
msgs = [
|
||||
("<msg_info_not_refresh>", globalconfig["rawtextcolor"], False),
|
||||
("<msg_info_refresh>", globalconfig["rawtextcolor"], True),
|
||||
("<msg_error_not_refresh>", "red", False),
|
||||
("<msg_error_refresh>", "red", True),
|
||||
]
|
||||
for msg, color, refresh in msgs:
|
||||
if text.startswith(msg):
|
||||
self.translation_ui.displaystatus.emit(
|
||||
text[len(msg) :], color, refresh, False
|
||||
)
|
||||
return
|
||||
if text == "" or len(text) > 100000:
|
||||
return returnandembedcallback()
|
||||
)
|
||||
self.currenttext = text
|
||||
self.currenttranslate = text
|
||||
self.currentread = text
|
||||
return
|
||||
else:
|
||||
msgs = [
|
||||
("<msg_info_not_refresh>", globalconfig["rawtextcolor"], False),
|
||||
("<msg_info_refresh>", globalconfig["rawtextcolor"], True),
|
||||
("<msg_error_not_refresh>", "red", False),
|
||||
("<msg_error_refresh>", "red", True),
|
||||
]
|
||||
for msg, color, refresh in msgs:
|
||||
if text.startswith(msg):
|
||||
self.translation_ui.displaystatus.emit(
|
||||
text[len(msg) :], color, refresh, False
|
||||
)
|
||||
return
|
||||
if text == "" or len(text) > 100000:
|
||||
return returnandembedcallback()
|
||||
if onlytrans == False:
|
||||
self.currentsignature = time.time()
|
||||
try:
|
||||
if type(text) == list:
|
||||
origin = "\n".join(text)
|
||||
text = "\n".join([self._POSTSOLVE(_) for _ in text])
|
||||
else:
|
||||
origin = text
|
||||
text = self._POSTSOLVE(text)
|
||||
origin = text
|
||||
text = self._POSTSOLVE(text)
|
||||
except Exception as e:
|
||||
msg = str(type(e))[8:-2] + " " + str(e).replace("\n", "").replace("\r", "")
|
||||
self.translation_ui.displaystatus.emit(msg, "red", True, True)
|
||||
@ -725,7 +720,6 @@ class MAINUI:
|
||||
|
||||
print_exc()
|
||||
|
||||
|
||||
def autohookmonitorthread(self):
|
||||
while self.isrunning:
|
||||
self.onwindowloadautohook()
|
||||
@ -895,6 +889,7 @@ class MAINUI:
|
||||
__t = time.time()
|
||||
time.sleep(1)
|
||||
_t = time.time()
|
||||
|
||||
def isok(name_):
|
||||
savehook_new_data[name_]["statistic_playtime"] += _t - __t
|
||||
if self.__currentexe == name_:
|
||||
|
@ -841,7 +841,7 @@ class dialog_setting_game_internal(QWidget):
|
||||
else:
|
||||
_methods = ["Locale-Emulator", "Locale_Remulator", "Ntleas"]
|
||||
if b == 6 and savehook_new_data[exepath]["localeswitcher"] == 0:
|
||||
savehook_new_data[exepath]["localeswitcher"] = 2
|
||||
savehook_new_data[exepath]["localeswitcher"] = 1
|
||||
formLayout.addRow(
|
||||
_TR("转区启动"),
|
||||
getboxlayout(
|
||||
|
@ -453,7 +453,7 @@ class texthook(basetext):
|
||||
collector.sort(key=lambda xx: self.selectedhook.index(xx[0]))
|
||||
except:
|
||||
pass
|
||||
collector = [_[1] for _ in collector]
|
||||
collector = "\n".join([_[1] for _ in collector])
|
||||
self.newline.put(collector)
|
||||
self.runonce_line = collector
|
||||
|
||||
|
@ -137,10 +137,7 @@ class basetext:
|
||||
try:
|
||||
t = self.gettextthread()
|
||||
if t and globalconfig["autorun"]:
|
||||
if type(t) == tuple:
|
||||
self.textgetmethod(*t)
|
||||
else:
|
||||
self.textgetmethod(t)
|
||||
self.textgetmethod(t)
|
||||
except:
|
||||
print_exc()
|
||||
|
||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
||||
|
||||
set(VERSION_MAJOR 3)
|
||||
set(VERSION_MINOR 6)
|
||||
set(VERSION_PATCH 2)
|
||||
set(VERSION_PATCH 3)
|
||||
|
||||
add_library(pch pch.cpp)
|
||||
target_precompile_headers(pch PUBLIC pch.h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user