This commit is contained in:
恍兮惚兮 2024-07-13 01:49:09 +08:00
parent 30eacd6602
commit 28fc2154f7
5 changed files with 42 additions and 0 deletions

View File

@ -117,6 +117,11 @@ class MAINUI:
class klass(kls):
@property
def using(self):
if 'using_X' in dir(self):
try:
return self.using_X
except:
return False
return checkpostusing(_name)
return klass()

View File

@ -1217,6 +1217,7 @@ class dialog_setting_game_internal(QWidget):
visname,
getboxlayout(
[
getsimpleswitch(savehook_new_data[gameuid], name + "_use"),
getIconButton(
callback=functools.partial(__, setting, self, gameuid),
icon="fa.gear",

View File

@ -154,6 +154,8 @@ def getdefaultsavehook(title=None):
"currentvisimage": None,
"currentmainimage": "",
"noundictconfig": [],
"noundict_use":True,
"vndbnamemap_use" :True,
# 元数据
"namemap": {}, # 人名翻译映射vndb独占用于优化翻译
#

View File

@ -5,6 +5,7 @@ from traceback import print_exc
import gobject
from gui.usefulwidget import getQMessageBox, threebuttons
from myutils.wrapper import Singleton_close
from myutils.utils import checkpostusing
@Singleton_close
@ -382,6 +383,22 @@ class Process:
),
)
@property
def using_X(self):
for _ in (0,):
try:
if not gobject.baseobject.textsource:
break
gameuid = gobject.baseobject.textsource.gameuid
if savehook_new_data[gameuid]["transoptimi_followdefault"]:
break
return savehook_new_data[gameuid]["noundict_use"]
except:
print_exc()
break
return checkpostusing("noundict")
def usewhich(self) -> dict:
for _ in (0,):
try:

View File

@ -2,6 +2,7 @@ from myutils.config import savehook_new_data, globalconfig
import gobject
from traceback import print_exc
from gui.inputdialog import postconfigdialog_
from myutils.utils import checkpostusing
class Process:
@ -28,6 +29,22 @@ class Process:
),
)
@property
def using_X(self):
for _ in (0,):
try:
if not gobject.baseobject.textsource:
break
gameuid = gobject.baseobject.textsource.gameuid
if savehook_new_data[gameuid]["transoptimi_followdefault"]:
break
return savehook_new_data[gameuid]["vndbnamemap_use"]
except:
print_exc()
break
return checkpostusing("vndbnamemap")
def usewhich(self) -> dict:
for _ in (0,):
try: