mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
something
This commit is contained in:
parent
eb5ed97719
commit
739fa24944
@ -4,9 +4,7 @@ from qtsymbols import *
|
|||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from myutils.config import (
|
from myutils.config import (
|
||||||
globalconfig,
|
globalconfig,
|
||||||
_TR,
|
|
||||||
savehook_new_list,
|
savehook_new_list,
|
||||||
uid2gamepath,
|
|
||||||
findgameuidofpath,
|
findgameuidofpath,
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
static_data,
|
static_data,
|
||||||
|
@ -13,8 +13,8 @@ from gui.specialwidget import lazyscrollflow
|
|||||||
from myutils.config import (
|
from myutils.config import (
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
savegametaged,
|
savegametaged,
|
||||||
uid2gamepath,
|
|
||||||
_TR,
|
_TR,
|
||||||
|
get_launchpath,
|
||||||
globalconfig,
|
globalconfig,
|
||||||
)
|
)
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
@ -182,7 +182,7 @@ class dialog_savedgame_new(QWidget):
|
|||||||
notshow = False
|
notshow = False
|
||||||
for tag, _type, _ in tags:
|
for tag, _type, _ in tags:
|
||||||
if _type == tagitem.TYPE_EXISTS:
|
if _type == tagitem.TYPE_EXISTS:
|
||||||
if os.path.exists(uid2gamepath[k]) == False:
|
if os.path.exists(get_launchpath(k)) == False:
|
||||||
notshow = True
|
notshow = True
|
||||||
break
|
break
|
||||||
elif _type == tagitem.TYPE_DEVELOPER:
|
elif _type == tagitem.TYPE_DEVELOPER:
|
||||||
@ -229,7 +229,7 @@ class dialog_savedgame_new(QWidget):
|
|||||||
othersetting = LAction(("其他设置"))
|
othersetting = LAction(("其他设置"))
|
||||||
|
|
||||||
if self.currentfocusuid:
|
if self.currentfocusuid:
|
||||||
exists = os.path.exists(uid2gamepath[self.currentfocusuid])
|
exists = os.path.exists(get_launchpath(self.currentfocusuid))
|
||||||
if exists:
|
if exists:
|
||||||
menu.addAction(startgame)
|
menu.addAction(startgame)
|
||||||
if exists:
|
if exists:
|
||||||
@ -491,7 +491,7 @@ class dialog_savedgame_new(QWidget):
|
|||||||
_able1 = b and (
|
_able1 = b and (
|
||||||
(not exists)
|
(not exists)
|
||||||
or (self.currentfocusuid)
|
or (self.currentfocusuid)
|
||||||
and (os.path.exists(uid2gamepath[self.currentfocusuid]))
|
and (os.path.exists(get_launchpath(self.currentfocusuid)))
|
||||||
)
|
)
|
||||||
_btn.setEnabled(_able1)
|
_btn.setEnabled(_able1)
|
||||||
|
|
||||||
|
@ -12,12 +12,12 @@ from myutils.config import (
|
|||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
savegametaged,
|
savegametaged,
|
||||||
uid2gamepath,
|
uid2gamepath,
|
||||||
|
get_launchpath,
|
||||||
_TR,
|
_TR,
|
||||||
savehook_new_list,
|
savehook_new_list,
|
||||||
globalconfig,
|
globalconfig,
|
||||||
)
|
)
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
yuitsu_switch,
|
|
||||||
getIconButton,
|
getIconButton,
|
||||||
FocusCombo,
|
FocusCombo,
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
@ -114,17 +114,14 @@ class ItemWidget(QWidget):
|
|||||||
layout.addWidget(self._lb)
|
layout.addWidget(self._lb)
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
self.gameuid = gameuid
|
self.gameuid = gameuid
|
||||||
|
exists = os.path.exists(get_launchpath(gameuid))
|
||||||
c = globalconfig["dialog_savegame_layout"][
|
c = globalconfig["dialog_savegame_layout"][
|
||||||
("onfilenoexistscolor1", "backcolor1")[
|
("onfilenoexistscolor1", "backcolor1")[exists]
|
||||||
os.path.exists(uid2gamepath[gameuid])
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
c = str2rgba(
|
c = str2rgba(
|
||||||
c,
|
c,
|
||||||
globalconfig["dialog_savegame_layout"][
|
globalconfig["dialog_savegame_layout"][
|
||||||
("transparentnotexits", "transparent")[
|
("transparentnotexits", "transparent")[exists]
|
||||||
os.path.exists(uid2gamepath[gameuid])
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
|
self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
|
||||||
@ -345,7 +342,7 @@ class TagWidget(QWidget):
|
|||||||
|
|
||||||
|
|
||||||
def opendirforgameuid(gameuid):
|
def opendirforgameuid(gameuid):
|
||||||
f = uid2gamepath[gameuid]
|
f = get_launchpath(gameuid)
|
||||||
f = os.path.dirname(f)
|
f = os.path.dirname(f)
|
||||||
if os.path.exists(f) and os.path.isdir(f):
|
if os.path.exists(f) and os.path.isdir(f):
|
||||||
os.startfile(f)
|
os.startfile(f)
|
||||||
@ -354,7 +351,7 @@ def opendirforgameuid(gameuid):
|
|||||||
@threader
|
@threader
|
||||||
def startgame(gameuid):
|
def startgame(gameuid):
|
||||||
try:
|
try:
|
||||||
game = uid2gamepath[gameuid]
|
game = get_launchpath(gameuid)
|
||||||
if os.path.exists(game):
|
if os.path.exists(game):
|
||||||
mode = savehook_new_data[gameuid]["onloadautochangemode2"]
|
mode = savehook_new_data[gameuid]["onloadautochangemode2"]
|
||||||
if mode > 0:
|
if mode > 0:
|
||||||
@ -438,7 +435,7 @@ def getpixfunction(kk, small=False):
|
|||||||
def startgamecheck(self, reflist, gameuid):
|
def startgamecheck(self, reflist, gameuid):
|
||||||
if not gameuid:
|
if not gameuid:
|
||||||
return
|
return
|
||||||
if not os.path.exists(uid2gamepath[gameuid]):
|
if not os.path.exists(get_launchpath(gameuid)):
|
||||||
return
|
return
|
||||||
if globalconfig["startgamenototop"] == False:
|
if globalconfig["startgamenototop"] == False:
|
||||||
idx = reflist.index(gameuid)
|
idx = reflist.index(gameuid)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from PyQt5.QtWidgets import QWidget
|
from PyQt5.QtWidgets import QWidget
|
||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
import functools, threading
|
import functools, threading
|
||||||
from myutils.config import savehook_new_list, savehook_new_data, uid2gamepath
|
from myutils.config import savehook_new_list, savehook_new_data, get_launchpath
|
||||||
from myutils.hwnd import getExeIcon
|
from myutils.hwnd import getExeIcon
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
TableViewW,
|
TableViewW,
|
||||||
@ -131,7 +131,7 @@ class dialog_savedgame_legacy(QWidget):
|
|||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
functools.partial(opendirforgameuid, k),
|
functools.partial(opendirforgameuid, k),
|
||||||
qicon=getExeIcon(uid2gamepath[k], cache=True),
|
qicon=getExeIcon(get_launchpath(k), cache=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
def callback_leuse(self, k, use):
|
def callback_leuse(self, k, use):
|
||||||
|
@ -8,6 +8,7 @@ import gobject
|
|||||||
from myutils.config import (
|
from myutils.config import (
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
uid2gamepath,
|
uid2gamepath,
|
||||||
|
get_launchpath,
|
||||||
_TR,
|
_TR,
|
||||||
postprocessconfig,
|
postprocessconfig,
|
||||||
globalconfig,
|
globalconfig,
|
||||||
@ -51,8 +52,15 @@ from gui.usefulwidget import (
|
|||||||
getspinbox,
|
getspinbox,
|
||||||
listediterline,
|
listediterline,
|
||||||
)
|
)
|
||||||
from gui.dynalang import LFormLayout, LPushButton, LStandardItemModel, LAction, LLabel, LDialog
|
from gui.dynalang import (
|
||||||
from gui.dialog_savedgame_common import tagitem, TagWidget
|
LFormLayout,
|
||||||
|
LPushButton,
|
||||||
|
LStandardItemModel,
|
||||||
|
LAction,
|
||||||
|
LLabel,
|
||||||
|
LDialog,
|
||||||
|
)
|
||||||
|
from gui.dialog_savedgame_common import tagitem, TagWidget
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@ -155,7 +163,7 @@ class browserdialog(saveposwindow):
|
|||||||
def __init__(self, parent, gameuid=None) -> None:
|
def __init__(self, parent, gameuid=None) -> None:
|
||||||
super().__init__(parent, poslist=globalconfig["browserwidget"])
|
super().__init__(parent, poslist=globalconfig["browserwidget"])
|
||||||
if gameuid:
|
if gameuid:
|
||||||
self.setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
self.setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
self.browser = auto_select_webview(self)
|
self.browser = auto_select_webview(self)
|
||||||
|
|
||||||
self.tagswidget = TagWidget(self)
|
self.tagswidget = TagWidget(self)
|
||||||
@ -274,20 +282,12 @@ def maybehavebutton(self, gameuid, post):
|
|||||||
|
|
||||||
|
|
||||||
class dialog_setting_game_internal(QWidget):
|
class dialog_setting_game_internal(QWidget):
|
||||||
def selectexe(self):
|
def selectexe(self, res):
|
||||||
originpath = uid2gamepath[self.gameuid]
|
|
||||||
f = QFileDialog.getOpenFileName(directory=originpath)
|
|
||||||
res = f[0]
|
|
||||||
if res == "":
|
|
||||||
return
|
|
||||||
# 修改路径允许路径重复
|
|
||||||
# 添加路径实际上也允许重复,只不过会去重。
|
|
||||||
res = os.path.normpath(res)
|
res = os.path.normpath(res)
|
||||||
uid2gamepath[self.gameuid] = res
|
uid2gamepath[self.gameuid] = res
|
||||||
_icon = getExeIcon(res, cache=True)
|
_icon = getExeIcon(get_launchpath(self.gameuid), cache=True)
|
||||||
|
|
||||||
self.setWindowIcon(_icon)
|
self.setWindowIcon(_icon)
|
||||||
self.editpath.setText(res)
|
|
||||||
|
|
||||||
def __init__(self, parent, gameuid) -> None:
|
def __init__(self, parent, gameuid) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
@ -295,14 +295,16 @@ class dialog_setting_game_internal(QWidget):
|
|||||||
formLayout = LFormLayout()
|
formLayout = LFormLayout()
|
||||||
self.setLayout(vbox)
|
self.setLayout(vbox)
|
||||||
self.gameuid = gameuid
|
self.gameuid = gameuid
|
||||||
self.editpath = QLineEdit(uid2gamepath[gameuid])
|
|
||||||
self.editpath.setReadOnly(True)
|
|
||||||
formLayout.addRow(
|
formLayout.addRow(
|
||||||
"路径",
|
"路径",
|
||||||
getboxlayout(
|
getboxlayout(
|
||||||
[
|
[
|
||||||
self.editpath,
|
getsimplepatheditor(
|
||||||
getIconButton(functools.partial(self.selectexe), icon="fa.gear"),
|
uid2gamepath[gameuid],
|
||||||
|
callback=self.selectexe,
|
||||||
|
clearable=False,
|
||||||
|
icons=("fa.gear",),
|
||||||
|
),
|
||||||
getIconButton(
|
getIconButton(
|
||||||
lambda: browserdialog(
|
lambda: browserdialog(
|
||||||
gobject.baseobject.commonstylebase, gameuid
|
gobject.baseobject.commonstylebase, gameuid
|
||||||
@ -476,6 +478,15 @@ class dialog_setting_game_internal(QWidget):
|
|||||||
layout.addWidget(w)
|
layout.addWidget(w)
|
||||||
do()
|
do()
|
||||||
|
|
||||||
|
def selectexe_lauch(self, p):
|
||||||
|
if p:
|
||||||
|
p = os.path.normpath(p)
|
||||||
|
savehook_new_data[self.gameuid]["launchpath"] = p
|
||||||
|
|
||||||
|
_icon = getExeIcon(get_launchpath(self.gameuid), cache=True)
|
||||||
|
|
||||||
|
self.setWindowIcon(_icon)
|
||||||
|
|
||||||
def starttab(self, formLayout: LFormLayout, gameuid):
|
def starttab(self, formLayout: LFormLayout, gameuid):
|
||||||
box = QGroupBox()
|
box = QGroupBox()
|
||||||
settinglayout = LFormLayout()
|
settinglayout = LFormLayout()
|
||||||
@ -490,14 +501,23 @@ class dialog_setting_game_internal(QWidget):
|
|||||||
box.show()
|
box.show()
|
||||||
|
|
||||||
__launch_method = getsimplecombobox(
|
__launch_method = getsimplecombobox(
|
||||||
[_.name for _ in getgamecamptools(uid2gamepath[gameuid])],
|
[_.name for _ in getgamecamptools(get_launchpath(gameuid))],
|
||||||
savehook_new_data[gameuid],
|
savehook_new_data[gameuid],
|
||||||
"launch_method",
|
"launch_method",
|
||||||
internal=[_.id for _ in getgamecamptools(uid2gamepath[gameuid])],
|
internal=[_.id for _ in getgamecamptools(get_launchpath(gameuid))],
|
||||||
callback=functools.partial(
|
callback=functools.partial(
|
||||||
__, box, settinglayout, savehook_new_data[gameuid]
|
__, box, settinglayout, savehook_new_data[gameuid]
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
formLayout.addRow(
|
||||||
|
"启动程序",
|
||||||
|
getsimplepatheditor(
|
||||||
|
get_launchpath(gameuid),
|
||||||
|
callback=self.selectexe_lauch,
|
||||||
|
icons=("fa.gear", "fa.window-close-o"),
|
||||||
|
clearset=uid2gamepath[gameuid],
|
||||||
|
),
|
||||||
|
)
|
||||||
formLayout.addRow("启动方式", __launch_method)
|
formLayout.addRow("启动方式", __launch_method)
|
||||||
formLayout.addRow(box)
|
formLayout.addRow(box)
|
||||||
|
|
||||||
@ -779,7 +799,7 @@ class dialog_setting_game_internal(QWidget):
|
|||||||
False,
|
False,
|
||||||
filt,
|
filt,
|
||||||
functools.partial(selectimg, gameuid, key),
|
functools.partial(selectimg, gameuid, key),
|
||||||
True,
|
icons=("fa.folder-open", "fa.window-close-o"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1114,7 +1134,6 @@ class dialog_setting_game_internal(QWidget):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect:
|
def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect:
|
||||||
original_center = original_rect.center()
|
original_center = original_rect.center()
|
||||||
new_left = original_center.x() - size.width() // 2
|
new_left = original_center.x() - size.width() // 2
|
||||||
@ -1122,6 +1141,7 @@ def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect:
|
|||||||
new_rect = QRect(new_left, new_top, size.width(), size.height())
|
new_rect = QRect(new_left, new_top, size.width(), size.height())
|
||||||
return new_rect
|
return new_rect
|
||||||
|
|
||||||
|
|
||||||
@Singleton_close
|
@Singleton_close
|
||||||
class dialog_setting_game(LDialog):
|
class dialog_setting_game(LDialog):
|
||||||
|
|
||||||
@ -1131,7 +1151,7 @@ class dialog_setting_game(LDialog):
|
|||||||
|
|
||||||
self.setWindowTitle(savehook_new_data[gameuid]["title"])
|
self.setWindowTitle(savehook_new_data[gameuid]["title"])
|
||||||
|
|
||||||
self.setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
self.setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
_ = dialog_setting_game_internal(self, gameuid)
|
_ = dialog_setting_game_internal(self, gameuid)
|
||||||
_.methodtab.setCurrentIndex(setindexhook)
|
_.methodtab.setCurrentIndex(setindexhook)
|
||||||
_.setMinimumSize(QSize(600, 500))
|
_.setMinimumSize(QSize(600, 500))
|
||||||
|
@ -8,7 +8,7 @@ from myutils.config import (
|
|||||||
savehook_new_list,
|
savehook_new_list,
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
savegametaged,
|
savegametaged,
|
||||||
uid2gamepath,
|
get_launchpath,
|
||||||
extradatas,
|
extradatas,
|
||||||
globalconfig,
|
globalconfig,
|
||||||
)
|
)
|
||||||
@ -96,16 +96,14 @@ class clickitem(QWidget):
|
|||||||
self.lay.setContentsMargins(0, 0, 0, 0)
|
self.lay.setContentsMargins(0, 0, 0, 0)
|
||||||
|
|
||||||
self.maskshowfileexists = QLabel(self)
|
self.maskshowfileexists = QLabel(self)
|
||||||
|
exits = os.path.exists(get_launchpath(uid))
|
||||||
c = globalconfig["dialog_savegame_layout"][
|
c = globalconfig["dialog_savegame_layout"][
|
||||||
("onfilenoexistscolor1", "backcolor1")[os.path.exists(uid2gamepath[uid])]
|
("onfilenoexistscolor1", "backcolor1")[exits]
|
||||||
]
|
]
|
||||||
c = str2rgba(
|
c = str2rgba(
|
||||||
c,
|
c,
|
||||||
globalconfig["dialog_savegame_layout"][
|
globalconfig["dialog_savegame_layout"][
|
||||||
("transparentnotexits", "transparent")[
|
("transparentnotexits", "transparent")[exits]
|
||||||
os.path.exists(uid2gamepath[uid])
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
|
self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
|
||||||
@ -121,9 +119,7 @@ class clickitem(QWidget):
|
|||||||
_.setFixedSize(QSize(size, size))
|
_.setFixedSize(QSize(size, size))
|
||||||
_.setScaledContents(True)
|
_.setScaledContents(True)
|
||||||
_.setStyleSheet("background-color: rgba(255,255,255, 0);")
|
_.setStyleSheet("background-color: rgba(255,255,255, 0);")
|
||||||
icon = getpixfunction(
|
icon = getpixfunction(uid, small=True)
|
||||||
uid, small=True
|
|
||||||
) # getExeIcon(uid2gamepath[uid], icon=False, cache=True)
|
|
||||||
icon.setDevicePixelRatio(self.devicePixelRatioF())
|
icon.setDevicePixelRatio(self.devicePixelRatioF())
|
||||||
_.setPixmap(icon)
|
_.setPixmap(icon)
|
||||||
self.lay.addWidget(_)
|
self.lay.addWidget(_)
|
||||||
@ -229,19 +225,17 @@ class MyQListWidget(QListWidget):
|
|||||||
end = self.indexAt(self.viewport().rect().bottomRight()).row()
|
end = self.indexAt(self.viewport().rect().bottomRight()).row()
|
||||||
if start < 0:
|
if start < 0:
|
||||||
return
|
return
|
||||||
if end < 0:
|
|
||||||
end = start
|
|
||||||
with self.lock:
|
with self.lock:
|
||||||
model = self.model()
|
model = self.model()
|
||||||
|
if end < 0:
|
||||||
|
end = model.rowCount()
|
||||||
for row in range(start, end + 1):
|
for row in range(start, end + 1):
|
||||||
index = model.index(row, 0)
|
index = model.index(row, 0)
|
||||||
if not index.data(ImageRequestedRole):
|
if not index.data(ImageRequestedRole):
|
||||||
self.model().setData(index, True, ImageRequestedRole)
|
self.model().setData(index, True, ImageRequestedRole)
|
||||||
image = getcachedimage(index.data(PathRole), True)
|
image = getcachedimage(index.data(PathRole), True)
|
||||||
if image is None:
|
if image is None:
|
||||||
self.blockSignals(True)
|
|
||||||
self.takeItem(index.row())
|
self.takeItem(index.row())
|
||||||
self.blockSignals(False)
|
|
||||||
else:
|
else:
|
||||||
self.item(index.row()).setIcon(QIcon(image))
|
self.item(index.row()).setIcon(QIcon(image))
|
||||||
except:
|
except:
|
||||||
@ -670,7 +664,7 @@ class dialog_savedgame_v3(QWidget):
|
|||||||
_able1 = b and (
|
_able1 = b and (
|
||||||
(not exists)
|
(not exists)
|
||||||
or (self.currentfocusuid)
|
or (self.currentfocusuid)
|
||||||
and (os.path.exists(uid2gamepath[self.currentfocusuid]))
|
and (os.path.exists(get_launchpath(self.currentfocusuid)))
|
||||||
)
|
)
|
||||||
_btn.setEnabled(_able1)
|
_btn.setEnabled(_able1)
|
||||||
if self.currentfocusuid:
|
if self.currentfocusuid:
|
||||||
@ -712,7 +706,7 @@ class dialog_savedgame_v3(QWidget):
|
|||||||
|
|
||||||
menu.addAction(addlist)
|
menu.addAction(addlist)
|
||||||
else:
|
else:
|
||||||
exists = os.path.exists(uid2gamepath[self.currentfocusuid])
|
exists = os.path.exists(get_launchpath(self.currentfocusuid))
|
||||||
if exists:
|
if exists:
|
||||||
menu.addAction(startgame)
|
menu.addAction(startgame)
|
||||||
menu.addAction(delgame)
|
menu.addAction(delgame)
|
||||||
@ -862,10 +856,9 @@ class dialog_savedgame_v3(QWidget):
|
|||||||
self.stack.insertw(i, group0)
|
self.stack.insertw(i, group0)
|
||||||
rowreal = 0
|
rowreal = 0
|
||||||
for row, k in enumerate(lst):
|
for row, k in enumerate(lst):
|
||||||
if globalconfig["hide_not_exists"] and not os.path.exists(
|
if globalconfig["hide_not_exists"]:
|
||||||
uid2gamepath[k]
|
if not os.path.exists(get_launchpath(k)):
|
||||||
):
|
continue
|
||||||
continue
|
|
||||||
self.reallist[tagid].append(k)
|
self.reallist[tagid].append(k)
|
||||||
if opened and isfirst and (rowreal == 0):
|
if opened and isfirst and (rowreal == 0):
|
||||||
vis = True
|
vis = True
|
||||||
|
@ -3,7 +3,7 @@ import sqlite3, os, json, functools
|
|||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from myutils.config import globalconfig, _TR
|
from myutils.config import globalconfig, _TR
|
||||||
from myutils.utils import autosql
|
from myutils.utils import autosql
|
||||||
from gui.usefulwidget import getQMessageBox, LFocusCombo, getsimplepatheditor
|
from gui.usefulwidget import getQMessageBox, LFocusCombo
|
||||||
from gui.dynalang import LFormLayout, LPushButton, LDialog
|
from gui.dynalang import LFormLayout, LPushButton, LDialog
|
||||||
from textsource.texthook import splitembedlines
|
from textsource.texthook import splitembedlines
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
@ -6,7 +6,7 @@ from myutils.config import (
|
|||||||
globalconfig,
|
globalconfig,
|
||||||
_TR,
|
_TR,
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
uid2gamepath,
|
get_launchpath,
|
||||||
savehook_new_list,
|
savehook_new_list,
|
||||||
static_data,
|
static_data,
|
||||||
)
|
)
|
||||||
@ -224,7 +224,7 @@ def exportchspatch(self):
|
|||||||
gameuid = selectgameuid(self)
|
gameuid = selectgameuid(self)
|
||||||
if gameuid is None:
|
if gameuid is None:
|
||||||
return
|
return
|
||||||
exe = uid2gamepath[gameuid]
|
exe = get_launchpath(gameuid)
|
||||||
if exe.lower().endswith(".exe") == False:
|
if exe.lower().endswith(".exe") == False:
|
||||||
f = QFileDialog.getOpenFileName(
|
f = QFileDialog.getOpenFileName(
|
||||||
self, caption=_TR("选择EXE文件"), filter="*.exe"
|
self, caption=_TR("选择EXE文件"), filter="*.exe"
|
||||||
|
@ -2035,11 +2035,13 @@ def getsimplepatheditor(
|
|||||||
isdir=False,
|
isdir=False,
|
||||||
filter1="*.*",
|
filter1="*.*",
|
||||||
callback=None,
|
callback=None,
|
||||||
useiconbutton=False,
|
icons=None,
|
||||||
reflist=None,
|
reflist=None,
|
||||||
name=None,
|
name=None,
|
||||||
header=None,
|
header=None,
|
||||||
dirorfile=False,
|
dirorfile=False,
|
||||||
|
clearable=True,
|
||||||
|
clearset=""
|
||||||
):
|
):
|
||||||
lay = QHBoxLayout()
|
lay = QHBoxLayout()
|
||||||
lay.setContentsMargins(0, 0, 0, 0)
|
lay.setContentsMargins(0, 0, 0, 0)
|
||||||
@ -2055,12 +2057,14 @@ def getsimplepatheditor(
|
|||||||
else:
|
else:
|
||||||
e = QLineEdit(text)
|
e = QLineEdit(text)
|
||||||
e.setReadOnly(True)
|
e.setReadOnly(True)
|
||||||
if useiconbutton:
|
if icons:
|
||||||
bu = getIconButton(icon="fa.folder-open")
|
bu = getIconButton(icon=icons[0])
|
||||||
clear = getIconButton(icon="fa.window-close-o")
|
if clearable:
|
||||||
|
clear = getIconButton(icon=icons[1])
|
||||||
else:
|
else:
|
||||||
bu = LPushButton("选择" + ("文件夹" if isdir else "文件"))
|
bu = LPushButton("选择" + ("文件夹" if isdir else "文件"))
|
||||||
clear = LPushButton("清除")
|
if clearable:
|
||||||
|
clear = LPushButton("清除")
|
||||||
bu.clicked.connect(
|
bu.clicked.connect(
|
||||||
functools.partial(
|
functools.partial(
|
||||||
openfiledirectory,
|
openfiledirectory,
|
||||||
@ -2072,15 +2076,16 @@ def getsimplepatheditor(
|
|||||||
callback,
|
callback,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def __(_cb, _e):
|
|
||||||
_cb("")
|
|
||||||
_e.setText("")
|
|
||||||
|
|
||||||
clear.clicked.connect(functools.partial(__, callback, e))
|
|
||||||
lay.addWidget(e)
|
lay.addWidget(e)
|
||||||
lay.addWidget(bu)
|
lay.addWidget(bu)
|
||||||
lay.addWidget(clear)
|
if clearable:
|
||||||
|
|
||||||
|
def __(_cb, _e, t):
|
||||||
|
_cb("")
|
||||||
|
_e.setText(t)
|
||||||
|
|
||||||
|
clear.clicked.connect(functools.partial(__, callback, e, clearset))
|
||||||
|
lay.addWidget(clear)
|
||||||
return lay
|
return lay
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ from myutils.utils import initanewitem, gamdidchangedtask
|
|||||||
import functools, time, json, gobject
|
import functools, time, json, gobject
|
||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
from metadata.abstract import common
|
from metadata.abstract import common
|
||||||
from gui.usefulwidget import getlineedit
|
|
||||||
from gui.dialog_savedgame import getreflist, getalistname
|
from gui.dialog_savedgame import getreflist, getalistname
|
||||||
from myutils.wrapper import Singleton_close, threader
|
from myutils.wrapper import Singleton_close, threader
|
||||||
from gui.dynalang import LPushButton
|
from gui.dynalang import LPushButton
|
||||||
@ -121,9 +120,11 @@ class bgmsettings(QDialog):
|
|||||||
getalistname(self, callback)
|
getalistname(self, callback)
|
||||||
|
|
||||||
infosig = pyqtSignal(str)
|
infosig = pyqtSignal(str)
|
||||||
|
showhide = pyqtSignal(bool)
|
||||||
|
|
||||||
@threader
|
@threader
|
||||||
def checkvalid(self, k):
|
def checkvalid(self, k):
|
||||||
|
self.showhide.emit(False)
|
||||||
self.lbinfo.setText("")
|
self.lbinfo.setText("")
|
||||||
t = time.time()
|
t = time.time()
|
||||||
self.tm = t
|
self.tm = t
|
||||||
@ -146,6 +147,17 @@ class bgmsettings(QDialog):
|
|||||||
expires = response.get("expires", 0)
|
expires = response.get("expires", 0)
|
||||||
if expires:
|
if expires:
|
||||||
info = ""
|
info = ""
|
||||||
|
try:
|
||||||
|
response1 = requests.get(
|
||||||
|
f"https://api.bgm.tv/v0/me",
|
||||||
|
params={"access_token": k},
|
||||||
|
headers=self.headers,
|
||||||
|
proxies=self._ref.proxy,
|
||||||
|
)
|
||||||
|
print(response1.json())
|
||||||
|
info += "用户名: " + response1.json()["nickname"] + "\n"
|
||||||
|
except:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
create = (
|
create = (
|
||||||
json.loads(response["info"])
|
json.loads(response["info"])
|
||||||
@ -160,10 +172,12 @@ class bgmsettings(QDialog):
|
|||||||
info += "有效期至: " + time.strftime(
|
info += "有效期至: " + time.strftime(
|
||||||
"%Y-%m-%d %H:%M:%S", time.localtime(expires)
|
"%Y-%m-%d %H:%M:%S", time.localtime(expires)
|
||||||
)
|
)
|
||||||
|
self.showhide.emit(True)
|
||||||
else:
|
else:
|
||||||
info = " ".join(
|
info = " ".join(
|
||||||
(response.get("error", ""), response.get("error_description", ""))
|
(response.get("error", ""), response.get("error_description", ""))
|
||||||
)
|
)
|
||||||
|
self.showhide.emit(False)
|
||||||
self.lbinfo.setText(info)
|
self.lbinfo.setText(info)
|
||||||
|
|
||||||
def __oauth(self):
|
def __oauth(self):
|
||||||
@ -223,7 +237,13 @@ class bgmsettings(QDialog):
|
|||||||
s = QLineEdit()
|
s = QLineEdit()
|
||||||
self.lbinfo = QLabel()
|
self.lbinfo = QLabel()
|
||||||
s.textChanged.connect(self.checkvalid)
|
s.textChanged.connect(self.checkvalid)
|
||||||
s.setText(_ref.config["access-token"])
|
fl2 = QFormLayout()
|
||||||
|
fl2.setContentsMargins(0, 0, 0, 0)
|
||||||
|
ww = QWidget()
|
||||||
|
ww.setLayout(fl2)
|
||||||
|
ww.hide()
|
||||||
|
self.fl2 = ww
|
||||||
|
self.showhide.connect(self.fl2.setVisible)
|
||||||
self._token = s
|
self._token = s
|
||||||
vbox.addLayout(hbox)
|
vbox.addLayout(hbox)
|
||||||
hbox.addWidget(s)
|
hbox.addWidget(s)
|
||||||
@ -232,22 +252,23 @@ class bgmsettings(QDialog):
|
|||||||
oauth.clicked.connect(self.__oauth)
|
oauth.clicked.connect(self.__oauth)
|
||||||
vbox.addWidget(self.lbinfo)
|
vbox.addWidget(self.lbinfo)
|
||||||
fl.addRow("access-token", vbox)
|
fl.addRow("access-token", vbox)
|
||||||
|
|
||||||
btn = LPushButton("上传游戏")
|
btn = LPushButton("上传游戏")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.singleupload_existsoverride, gameuid)
|
functools.partial(self.singleupload_existsoverride, gameuid)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
btn = LPushButton("上传游戏列表")
|
btn = LPushButton("上传游戏列表")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.__getalistname, self.getalistname_upload)
|
functools.partial(self.__getalistname, self.getalistname_upload)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
btn = LPushButton("获取游戏列表")
|
btn = LPushButton("获取游戏列表")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.__getalistname, self.getalistname_download)
|
functools.partial(self.__getalistname, self.getalistname_download)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
|
fl.addRow(ww)
|
||||||
|
s.setText(_ref.config["access-token"])
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,13 +6,12 @@ import time
|
|||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
from gui.inputdialog import autoinitdialog
|
from gui.inputdialog import autoinitdialog
|
||||||
from metadata.abstract import common
|
from metadata.abstract import common
|
||||||
from gui.usefulwidget import getlineedit
|
|
||||||
from gui.dialog_savedgame import getreflist, getalistname
|
from gui.dialog_savedgame import getreflist, getalistname
|
||||||
from myutils.wrapper import Singleton_close
|
from myutils.wrapper import Singleton_close, threader
|
||||||
from gui.dynalang import LPushButton
|
from gui.dynalang import LPushButton
|
||||||
|
|
||||||
|
|
||||||
def saferequestvndb(proxy, method, url, json=None, headers=None):
|
def saferequestvndb(proxy, method, url, json=None, headers=None, failnone=True):
|
||||||
print(method, url, json)
|
print(method, url, json)
|
||||||
resp = requests.request(
|
resp = requests.request(
|
||||||
method,
|
method,
|
||||||
@ -35,11 +34,14 @@ def saferequestvndb(proxy, method, url, json=None, headers=None):
|
|||||||
except:
|
except:
|
||||||
print(resp.status_code)
|
print(resp.status_code)
|
||||||
print(resp.text)
|
print(resp.text)
|
||||||
return None
|
if failnone:
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
return resp.text
|
||||||
|
|
||||||
|
|
||||||
def safegetvndbjson(proxy, url, json):
|
def safegetvndbjson(proxy, url, json=None, headers=None):
|
||||||
return saferequestvndb(proxy, "POST", url, json)
|
return saferequestvndb(proxy, "POST", url, json, headers)
|
||||||
|
|
||||||
|
|
||||||
def gettitlefromjs(js):
|
def gettitlefromjs(js):
|
||||||
@ -279,28 +281,69 @@ class vndbsettings(QDialog):
|
|||||||
def __getalistname(self, callback, _):
|
def __getalistname(self, callback, _):
|
||||||
getalistname(self, callback)
|
getalistname(self, callback)
|
||||||
|
|
||||||
|
showhide = pyqtSignal(bool)
|
||||||
|
|
||||||
|
@threader
|
||||||
|
def checkvalid(self, k):
|
||||||
|
self.showhide.emit(False)
|
||||||
|
self.lbinfo.setText("")
|
||||||
|
t = time.time()
|
||||||
|
self.tm = t
|
||||||
|
if k != self._ref.config["Token"]:
|
||||||
|
self._ref.config["Token"] = k
|
||||||
|
response = saferequestvndb(
|
||||||
|
self._ref.proxy, "GET", "authinfo", headers=self.headers, failnone=False
|
||||||
|
)
|
||||||
|
if t != self.tm:
|
||||||
|
return
|
||||||
|
print(response)
|
||||||
|
if isinstance(response, dict) and response.get("username"):
|
||||||
|
info = "username: " + response.get("username")
|
||||||
|
self.showhide.emit(True)
|
||||||
|
else:
|
||||||
|
info = response
|
||||||
|
self.showhide.emit(False)
|
||||||
|
self.lbinfo.setText(info)
|
||||||
|
|
||||||
def __init__(self, parent, _ref: common, gameuid: str) -> None:
|
def __init__(self, parent, _ref: common, gameuid: str) -> None:
|
||||||
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
|
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
|
||||||
|
self.tm = None
|
||||||
self._ref = _ref
|
self._ref = _ref
|
||||||
self.resize(QSize(800, 10))
|
self.resize(QSize(800, 10))
|
||||||
self.setWindowTitle(self._ref.config_all["name"])
|
self.setWindowTitle(self._ref.config_all["name"])
|
||||||
fl = QFormLayout(self)
|
fl = QFormLayout(self)
|
||||||
fl.addRow("Token", getlineedit(_ref.config, "Token"))
|
vbox = QVBoxLayout()
|
||||||
|
s = QLineEdit()
|
||||||
|
self.lbinfo = QLabel()
|
||||||
|
s.textChanged.connect(self.checkvalid)
|
||||||
|
fl2 = QFormLayout()
|
||||||
|
fl2.setContentsMargins(0, 0, 0, 0)
|
||||||
|
ww = QWidget()
|
||||||
|
ww.setLayout(fl2)
|
||||||
|
ww.hide()
|
||||||
|
self.fl2 = ww
|
||||||
|
self.showhide.connect(self.fl2.setVisible)
|
||||||
|
self._token = s
|
||||||
|
vbox.addWidget(s)
|
||||||
|
vbox.addWidget(self.lbinfo)
|
||||||
|
fl.addRow("Token", vbox)
|
||||||
btn = LPushButton("上传游戏")
|
btn = LPushButton("上传游戏")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.singleupload_existsoverride, gameuid)
|
functools.partial(self.singleupload_existsoverride, gameuid)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
btn = LPushButton("上传游戏列表")
|
btn = LPushButton("上传游戏列表")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.__getalistname, self.getalistname_upload)
|
functools.partial(self.__getalistname, self.getalistname_upload)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
btn = LPushButton("获取游戏列表")
|
btn = LPushButton("获取游戏列表")
|
||||||
btn.clicked.connect(
|
btn.clicked.connect(
|
||||||
functools.partial(self.__getalistname, self.getalistname_download)
|
functools.partial(self.__getalistname, self.getalistname_download)
|
||||||
)
|
)
|
||||||
fl.addRow(btn)
|
fl2.addRow(btn)
|
||||||
|
fl.addRow(ww)
|
||||||
|
s.setText(_ref.config["Token"])
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ ocrsetting = tryreadconfig("ocrsetting.json")
|
|||||||
def getdefaultsavehook(title=None):
|
def getdefaultsavehook(title=None):
|
||||||
default = {
|
default = {
|
||||||
"gamepath": "", # 不要直接访问,要通过uid2gamepath来间接访问
|
"gamepath": "", # 不要直接访问,要通过uid2gamepath来间接访问
|
||||||
|
#"launchpath": "",
|
||||||
"hooksetting_follow_default": True,
|
"hooksetting_follow_default": True,
|
||||||
"hooksetting_private": {}, # 显示时再加载,缺省用global中的键
|
"hooksetting_private": {}, # 显示时再加载,缺省用global中的键
|
||||||
"textproc_follow_default": True,
|
"textproc_follow_default": True,
|
||||||
@ -336,6 +337,11 @@ class __uid2gamepath:
|
|||||||
|
|
||||||
uid2gamepath = __uid2gamepath()
|
uid2gamepath = __uid2gamepath()
|
||||||
|
|
||||||
|
def get_launchpath(uid):
|
||||||
|
launch = savehook_new_data[uid].get("launchpath", "")
|
||||||
|
if not launch:
|
||||||
|
launch = uid2gamepath[uid]
|
||||||
|
return launch
|
||||||
|
|
||||||
def findgameuidofpath(gamepath, findall=False):
|
def findgameuidofpath(gamepath, findall=False):
|
||||||
collect = []
|
collect = []
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import windows, os, winreg, winsharedutils, re, functools
|
import windows, os, winsharedutils, re, functools
|
||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
from myutils.config import savehook_new_data, uid2gamepath, globalconfig
|
from myutils.config import savehook_new_data, get_launchpath, globalconfig
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getlineedit,
|
getlineedit,
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
@ -12,7 +12,6 @@ from gui.usefulwidget import (
|
|||||||
getsimplepatheditor,
|
getsimplepatheditor,
|
||||||
clearlayout,
|
clearlayout,
|
||||||
)
|
)
|
||||||
from traceback import print_exc
|
|
||||||
from gui.dynalang import LFormLayout
|
from gui.dynalang import LFormLayout
|
||||||
|
|
||||||
|
|
||||||
@ -529,9 +528,9 @@ def fundlauncher(_id):
|
|||||||
def localeswitchedrun(gameuid):
|
def localeswitchedrun(gameuid):
|
||||||
config = savehook_new_data[gameuid]
|
config = savehook_new_data[gameuid]
|
||||||
launch_method = config.get("launch_method", None)
|
launch_method = config.get("launch_method", None)
|
||||||
gameexe = uid2gamepath[gameuid]
|
gameexe = get_launchpath(gameuid)
|
||||||
tools = getgamecamptools(gameexe)
|
tools = getgamecamptools(gameexe)
|
||||||
ids = [_.id for _ in getgamecamptools(uid2gamepath[gameuid])]
|
ids = [_.id for _ in tools]
|
||||||
if launch_method not in ids:
|
if launch_method not in ids:
|
||||||
index = 0
|
index = 0
|
||||||
else:
|
else:
|
||||||
|
@ -3,12 +3,7 @@ import time
|
|||||||
import os, threading
|
import os, threading
|
||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from myutils.config import (
|
from myutils.config import findgameuidofpath, savehook_new_data
|
||||||
uid2gamepath,
|
|
||||||
findgameuidofpath,
|
|
||||||
savehook_new_list,
|
|
||||||
savehook_new_data,
|
|
||||||
)
|
|
||||||
from myutils.hwnd import getpidexe
|
from myutils.hwnd import getpidexe
|
||||||
import windows
|
import windows
|
||||||
import gobject
|
import gobject
|
||||||
|
@ -20,7 +20,6 @@ from myutils.config import (
|
|||||||
import threading, winreg
|
import threading, winreg
|
||||||
import re, heapq, winsharedutils
|
import re, heapq, winsharedutils
|
||||||
from myutils.wrapper import tryprint, threader
|
from myutils.wrapper import tryprint, threader
|
||||||
from myutils.subproc import subproc_w
|
|
||||||
|
|
||||||
|
|
||||||
def checkisusingwine():
|
def checkisusingwine():
|
||||||
@ -195,17 +194,19 @@ def dispatchsearchfordata(gameuid, target, vid):
|
|||||||
targetmod[target].dispatchsearchfordata(gameuid, vid)
|
targetmod[target].dispatchsearchfordata(gameuid, vid)
|
||||||
|
|
||||||
|
|
||||||
def trysearchforid_1(gameuid, searchargs: list):
|
def trysearchforid_1(gameuid, searchargs: list, target=None):
|
||||||
infoid = None
|
infoid = None
|
||||||
primitivtemetaorigin = globalconfig["primitivtemetaorigin"]
|
if target is None:
|
||||||
__ = [primitivtemetaorigin]
|
primitivtemetaorigin = globalconfig["primitivtemetaorigin"]
|
||||||
for k in targetmod:
|
__ = [primitivtemetaorigin]
|
||||||
if k == primitivtemetaorigin:
|
for k in targetmod:
|
||||||
continue
|
if k == primitivtemetaorigin:
|
||||||
if not globalconfig["metadata"][k]["auto"]:
|
continue
|
||||||
continue
|
if not globalconfig["metadata"][k]["auto"]:
|
||||||
__.append(k)
|
continue
|
||||||
|
__.append(k)
|
||||||
|
else:
|
||||||
|
__ = [target]
|
||||||
for key in __:
|
for key in __:
|
||||||
vid = None
|
vid = None
|
||||||
for arg in searchargs:
|
for arg in searchargs:
|
||||||
@ -232,13 +233,16 @@ def trysearchforid_1(gameuid, searchargs: list):
|
|||||||
dispatchsearchfordata(gameuid, key, vid)
|
dispatchsearchfordata(gameuid, key, vid)
|
||||||
|
|
||||||
|
|
||||||
def trysearchforid(gameuid, searchargs: list):
|
def trysearchforid(*argc):
|
||||||
threading.Thread(target=trysearchforid_1, args=(gameuid, searchargs)).start()
|
threading.Thread(target=trysearchforid_1, args=argc).start()
|
||||||
|
|
||||||
|
|
||||||
def gamdidchangedtask(key, idname, gameuid):
|
def gamdidchangedtask(key, idname, gameuid):
|
||||||
vid = savehook_new_data[gameuid].get(idname, "")
|
vid = savehook_new_data[gameuid].get(idname, "")
|
||||||
dispatchsearchfordata(gameuid, key, vid)
|
if not vid:
|
||||||
|
trysearchforid(gameuid, [savehook_new_data[gameuid]["title"]], key)
|
||||||
|
else:
|
||||||
|
dispatchsearchfordata(gameuid, key, vid)
|
||||||
|
|
||||||
|
|
||||||
def titlechangedtask(gameuid, title):
|
def titlechangedtask(gameuid, title):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from myutils.config import globalconfig, savehook_new_data, uid2gamepath
|
from myutils.config import globalconfig, savehook_new_data, get_launchpath
|
||||||
from myutils.utils import postusewhich
|
from myutils.utils import postusewhich
|
||||||
from gui.inputdialog import postconfigdialog_
|
from gui.inputdialog import postconfigdialog_
|
||||||
import gobject
|
import gobject
|
||||||
@ -24,7 +24,7 @@ class Process:
|
|||||||
"专有名词翻译_sakura_gpt_词典_-_" + savehook_new_data[gameuid]["title"],
|
"专有名词翻译_sakura_gpt_词典_-_" + savehook_new_data[gameuid]["title"],
|
||||||
["原文", "翻译", "注释"],
|
["原文", "翻译", "注释"],
|
||||||
dictkeys=["src", "dst", "info"],
|
dictkeys=["src", "dst", "info"],
|
||||||
).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
|
|
||||||
def process_before(self, japanese):
|
def process_before(self, japanese):
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ from gui.usefulwidget import threebuttons, TableViewW
|
|||||||
from myutils.wrapper import Singleton_close
|
from myutils.wrapper import Singleton_close
|
||||||
from myutils.utils import postusewhich
|
from myutils.utils import postusewhich
|
||||||
from gui.dynalang import LDialog, LPushButton, LStandardItemModel
|
from gui.dynalang import LDialog, LPushButton, LStandardItemModel
|
||||||
from myutils.config import uid2gamepath
|
from myutils.config import get_launchpath
|
||||||
from myutils.hwnd import getExeIcon
|
from myutils.hwnd import getExeIcon
|
||||||
|
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class Process:
|
|||||||
parent_window,
|
parent_window,
|
||||||
savehook_new_data[gameuid]["noundictconfig"],
|
savehook_new_data[gameuid]["noundictconfig"],
|
||||||
"专有名词翻译_占位符_-_" + savehook_new_data[gameuid]["title"],
|
"专有名词翻译_占位符_-_" + savehook_new_data[gameuid]["title"],
|
||||||
).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_setting_window(parent_window):
|
def get_setting_window(parent_window):
|
||||||
|
@ -2,7 +2,7 @@ from myutils.config import transerrorfixdictconfig, savehook_new_data
|
|||||||
from myutils.utils import parsemayberegexreplace, postusewhich
|
from myutils.utils import parsemayberegexreplace, postusewhich
|
||||||
from gui.inputdialog import noundictconfigdialog1
|
from gui.inputdialog import noundictconfigdialog1
|
||||||
import gobject
|
import gobject
|
||||||
from myutils.config import uid2gamepath
|
from myutils.config import get_launchpath
|
||||||
from myutils.hwnd import getExeIcon
|
from myutils.hwnd import getExeIcon
|
||||||
|
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ class Process:
|
|||||||
savehook_new_data[gameuid]["transerrorfix"],
|
savehook_new_data[gameuid]["transerrorfix"],
|
||||||
"翻译结果修正_-_" + savehook_new_data[gameuid]["title"],
|
"翻译结果修正_-_" + savehook_new_data[gameuid]["title"],
|
||||||
["正则",'转义', "翻译", "替换"],
|
["正则",'转义', "翻译", "替换"],
|
||||||
).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
|
|
||||||
def process_after(self, res, mp1):
|
def process_after(self, res, mp1):
|
||||||
res = parsemayberegexreplace(self.usewhich(), res)
|
res = parsemayberegexreplace(self.usewhich(), res)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from myutils.config import globalconfig, savehook_new_data, uid2gamepath
|
from myutils.config import globalconfig, savehook_new_data, get_launchpath
|
||||||
from myutils.utils import postusewhich, parsemayberegexreplace
|
from myutils.utils import postusewhich, parsemayberegexreplace
|
||||||
from gui.inputdialog import noundictconfigdialog1
|
from gui.inputdialog import noundictconfigdialog1
|
||||||
import gobject, json, functools
|
import gobject
|
||||||
from myutils.hwnd import getExeIcon
|
from myutils.hwnd import getExeIcon
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ class Process:
|
|||||||
savehook_new_data[gameuid]["namemap2"],
|
savehook_new_data[gameuid]["namemap2"],
|
||||||
"专有名词翻译_直接替换_-_" + savehook_new_data[gameuid]["title"],
|
"专有名词翻译_直接替换_-_" + savehook_new_data[gameuid]["title"],
|
||||||
["正则", "转义", "原文", "翻译"],
|
["正则", "转义", "原文", "翻译"],
|
||||||
).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True))
|
).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def using_X(self):
|
def using_X(self):
|
||||||
|
@ -1943,7 +1943,7 @@
|
|||||||
"type": "api",
|
"type": "api",
|
||||||
"use": false,
|
"use": false,
|
||||||
"color": "blue",
|
"color": "blue",
|
||||||
"name": "Azure Openai",
|
"name": "Azure",
|
||||||
"is_gpt_like": true
|
"is_gpt_like": true
|
||||||
},
|
},
|
||||||
"cohere": {
|
"cohere": {
|
||||||
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "كلمة .",
|
"单词": "كلمة .",
|
||||||
"成功添加后关闭窗口": "إغلاق النافذة بعد إضافة ناجحة",
|
"成功添加后关闭窗口": "إغلاق النافذة بعد إضافة ناجحة",
|
||||||
"绑定窗口": "ملزمة نافذة",
|
"绑定窗口": "ملزمة نافذة",
|
||||||
"(点击自己取消)": "( انقر على نفسك لإلغاء )"
|
"(点击自己取消)": "( انقر على نفسك لإلغاء )",
|
||||||
|
"启动程序": "بدء البرنامج"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "單詞",
|
"单词": "單詞",
|
||||||
"成功添加后关闭窗口": "成功添加後關閉窗口",
|
"成功添加后关闭窗口": "成功添加後關閉窗口",
|
||||||
"绑定窗口": "綁定視窗",
|
"绑定窗口": "綁定視窗",
|
||||||
"(点击自己取消)": "(點擊自己取消)"
|
"(点击自己取消)": "(點擊自己取消)",
|
||||||
|
"启动程序": "啟動程式"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "slovo",
|
"单词": "slovo",
|
||||||
"成功添加后关闭窗口": "Zavřít okno po úspěšném přidání",
|
"成功添加后关闭窗口": "Zavřít okno po úspěšném přidání",
|
||||||
"绑定窗口": "Vázat okno",
|
"绑定窗口": "Vázat okno",
|
||||||
"(点击自己取消)": "(Kliknutím zrušíte sami)"
|
"(点击自己取消)": "(Kliknutím zrušíte sami)",
|
||||||
|
"启动程序": "Spustit program"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "Wort",
|
"单词": "Wort",
|
||||||
"成功添加后关闭窗口": "Fenster nach erfolgreichem Hinzufügen schließen",
|
"成功添加后关闭窗口": "Fenster nach erfolgreichem Hinzufügen schließen",
|
||||||
"绑定窗口": "Fenster binden",
|
"绑定窗口": "Fenster binden",
|
||||||
"(点击自己取消)": "(Klicken Sie, um selbst abzubrechen)"
|
"(点击自己取消)": "(Klicken Sie, um selbst abzubrechen)",
|
||||||
|
"启动程序": "Programm starten"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "word",
|
"单词": "word",
|
||||||
"成功添加后关闭窗口": "Close the window after successful addition",
|
"成功添加后关闭窗口": "Close the window after successful addition",
|
||||||
"绑定窗口": "Bind Window",
|
"绑定窗口": "Bind Window",
|
||||||
"(点击自己取消)": "(Click to cancel by yourself)"
|
"(点击自己取消)": "(Click to cancel by yourself)",
|
||||||
|
"启动程序": "Start the program"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "Palabras",
|
"单词": "Palabras",
|
||||||
"成功添加后关闭窗口": "Cerrar la ventana después de agregar con éxito",
|
"成功添加后关闭窗口": "Cerrar la ventana después de agregar con éxito",
|
||||||
"绑定窗口": "Ventana vinculada",
|
"绑定窗口": "Ventana vinculada",
|
||||||
"(点击自己取消)": "(haga clic para cancelar por sí mismo)"
|
"(点击自己取消)": "(haga clic para cancelar por sí mismo)",
|
||||||
|
"启动程序": "Iniciar el programa"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "Mots",
|
"单词": "Mots",
|
||||||
"成功添加后关闭窗口": "Fermer la fenêtre après un ajout réussi",
|
"成功添加后关闭窗口": "Fermer la fenêtre après un ajout réussi",
|
||||||
"绑定窗口": "Fenêtre de liaison",
|
"绑定窗口": "Fenêtre de liaison",
|
||||||
"(点击自己取消)": "(cliquez vous - même pour annuler)"
|
"(点击自己取消)": "(cliquez vous - même pour annuler)",
|
||||||
|
"启动程序": "Lancer le programme"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "parola",
|
"单词": "parola",
|
||||||
"成功添加后关闭窗口": "Chiudere la finestra dopo l'aggiunta riuscita",
|
"成功添加后关闭窗口": "Chiudere la finestra dopo l'aggiunta riuscita",
|
||||||
"绑定窗口": "Associa finestra",
|
"绑定窗口": "Associa finestra",
|
||||||
"(点击自己取消)": "(Clicca per annullare da solo)"
|
"(点击自己取消)": "(Clicca per annullare da solo)",
|
||||||
|
"启动程序": "Avvia il programma"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "単語",
|
"单词": "単語",
|
||||||
"成功添加后关闭窗口": "追加に成功したらウィンドウを閉じる",
|
"成功添加后关闭窗口": "追加に成功したらウィンドウを閉じる",
|
||||||
"绑定窗口": "「バインド」ウィンドウ",
|
"绑定窗口": "「バインド」ウィンドウ",
|
||||||
"(点击自己取消)": "(自分でキャンセルするをクリック)"
|
"(点击自己取消)": "(自分でキャンセルするをクリック)",
|
||||||
|
"启动程序": "スタートアッププログラム"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "단어",
|
"单词": "단어",
|
||||||
"成功添加后关闭窗口": "성공적으로 추가한 후 창 닫기",
|
"成功添加后关闭窗口": "성공적으로 추가한 후 창 닫기",
|
||||||
"绑定窗口": "바인딩 창",
|
"绑定窗口": "바인딩 창",
|
||||||
"(点击自己取消)": "(자체 취소 클릭)"
|
"(点击自己取消)": "(자체 취소 클릭)",
|
||||||
|
"启动程序": "프로그램 시작"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "woord",
|
"单词": "woord",
|
||||||
"成功添加后关闭窗口": "Sluit het venster na succesvolle toevoeging",
|
"成功添加后关闭窗口": "Sluit het venster na succesvolle toevoeging",
|
||||||
"绑定窗口": "Venster binden",
|
"绑定窗口": "Venster binden",
|
||||||
"(点击自己取消)": "(Klik om zelf te annuleren)"
|
"(点击自己取消)": "(Klik om zelf te annuleren)",
|
||||||
|
"启动程序": "Start het programma"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "słowo",
|
"单词": "słowo",
|
||||||
"成功添加后关闭窗口": "Zamknij okno po pomyślnym dodaniu",
|
"成功添加后关闭窗口": "Zamknij okno po pomyślnym dodaniu",
|
||||||
"绑定窗口": "Wiąż okno",
|
"绑定窗口": "Wiąż okno",
|
||||||
"(点击自己取消)": "(Kliknij, aby anulować samodzielnie)"
|
"(点击自己取消)": "(Kliknij, aby anulować samodzielnie)",
|
||||||
|
"启动程序": "Uruchom program"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "palavra",
|
"单词": "palavra",
|
||||||
"成功添加后关闭窗口": "Fechar a janela após a adição bem sucedida",
|
"成功添加后关闭窗口": "Fechar a janela após a adição bem sucedida",
|
||||||
"绑定窗口": "Janela Vincular",
|
"绑定窗口": "Janela Vincular",
|
||||||
"(点击自己取消)": "(Clique para cancelar por si mesmo)"
|
"(点击自己取消)": "(Clique para cancelar por si mesmo)",
|
||||||
|
"启动程序": "Iniciar o programa"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "Слова",
|
"单词": "Слова",
|
||||||
"成功添加后关闭窗口": "Закрыть окно после успешного добавления",
|
"成功添加后关闭窗口": "Закрыть окно после успешного добавления",
|
||||||
"绑定窗口": "Связанное окно",
|
"绑定窗口": "Связанное окно",
|
||||||
"(点击自己取消)": "(Нажмите сами, чтобы отменить)"
|
"(点击自己取消)": "(Нажмите сами, чтобы отменить)",
|
||||||
|
"启动程序": "Запуск программы"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "ord",
|
"单词": "ord",
|
||||||
"成功添加后关闭窗口": "Stäng fönstret efter lyckat tillägg",
|
"成功添加后关闭窗口": "Stäng fönstret efter lyckat tillägg",
|
||||||
"绑定窗口": "Bind fönster",
|
"绑定窗口": "Bind fönster",
|
||||||
"(点击自己取消)": "(Klicka för att avbryta själv)"
|
"(点击自己取消)": "(Klicka för att avbryta själv)",
|
||||||
|
"启动程序": "Starta programmet"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "คำศัพท์",
|
"单词": "คำศัพท์",
|
||||||
"成功添加后关闭窗口": "ปิดหน้าต่างหลังจากเพิ่มเรียบร้อยแล้ว",
|
"成功添加后关闭窗口": "ปิดหน้าต่างหลังจากเพิ่มเรียบร้อยแล้ว",
|
||||||
"绑定窗口": "หน้าต่างที่ถูกผูกไว้",
|
"绑定窗口": "หน้าต่างที่ถูกผูกไว้",
|
||||||
"(点击自己取消)": "(คลิกเพื่อยกเลิกด้วยตัวเอง)"
|
"(点击自己取消)": "(คลิกเพื่อยกเลิกด้วยตัวเอง)",
|
||||||
|
"启动程序": "เริ่มโปรแกรม"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "kelime",
|
"单词": "kelime",
|
||||||
"成功添加后关闭窗口": "Başarılı eklendikten sonra pencereyi kapat",
|
"成功添加后关闭窗口": "Başarılı eklendikten sonra pencereyi kapat",
|
||||||
"绑定窗口": "Bağlam Penceresi",
|
"绑定窗口": "Bağlam Penceresi",
|
||||||
"(点击自己取消)": "(Kendin iptal etmek için tıklayın)"
|
"(点击自己取消)": "(Kendin iptal etmek için tıklayın)",
|
||||||
|
"启动程序": "Programı başlat"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "слово",
|
"单词": "слово",
|
||||||
"成功添加后关闭窗口": "Закрити вікно після успішного додавання",
|
"成功添加后关闭窗口": "Закрити вікно після успішного додавання",
|
||||||
"绑定窗口": "В’ єднати вікно",
|
"绑定窗口": "В’ єднати вікно",
|
||||||
"(点击自己取消)": "(Натисніть, щоб скасувати самостійно)"
|
"(点击自己取消)": "(Натисніть, щоб скасувати самостійно)",
|
||||||
|
"启动程序": "Запустити програму"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "Từ",
|
"单词": "Từ",
|
||||||
"成功添加后关闭窗口": "Đóng cửa sổ sau khi thêm thành công",
|
"成功添加后关闭窗口": "Đóng cửa sổ sau khi thêm thành công",
|
||||||
"绑定窗口": "Cửa sổ bị ràng buộc",
|
"绑定窗口": "Cửa sổ bị ràng buộc",
|
||||||
"(点击自己取消)": "(Click vào tự hủy)"
|
"(点击自己取消)": "(Click vào tự hủy)",
|
||||||
|
"启动程序": "Khởi chạy chương trình"
|
||||||
}
|
}
|
@ -846,5 +846,6 @@
|
|||||||
"单词": "",
|
"单词": "",
|
||||||
"成功添加后关闭窗口": "",
|
"成功添加后关闭窗口": "",
|
||||||
"绑定窗口": "",
|
"绑定窗口": "",
|
||||||
"(点击自己取消)": ""
|
"(点击自己取消)": "",
|
||||||
|
"启动程序": ""
|
||||||
}
|
}
|
@ -28,8 +28,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
|
|||||||
include(generate_product_version)
|
include(generate_product_version)
|
||||||
|
|
||||||
set(VERSION_MAJOR 5)
|
set(VERSION_MAJOR 5)
|
||||||
set(VERSION_MINOR 31)
|
set(VERSION_MINOR 32)
|
||||||
set(VERSION_PATCH 5)
|
set(VERSION_PATCH 0)
|
||||||
|
|
||||||
add_library(pch pch.cpp)
|
add_library(pch pch.cpp)
|
||||||
target_precompile_headers(pch PUBLIC pch.h)
|
target_precompile_headers(pch PUBLIC pch.h)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user