This commit is contained in:
恍兮惚兮 2024-06-02 13:11:28 +08:00
parent 345310c455
commit ebd0c3ec8a
51 changed files with 785 additions and 378 deletions

View File

@ -34,7 +34,7 @@ from gui.transhist import transhist
from gui.edittext import edittext from gui.edittext import edittext
import importlib, qtawesome import importlib, qtawesome
from functools import partial from functools import partial
from gui.settin import Settin from gui.setting import Setting
from gui.showocrimage import showocrimage from gui.showocrimage import showocrimage
from gui.attachprocessdialog import AttachProcessDialog from gui.attachprocessdialog import AttachProcessDialog
import windows import windows
@ -960,7 +960,7 @@ class MAINUI:
self.startoutputer() self.startoutputer()
self.__commonstylebase = commonstylebase(self.translation_ui) self.__commonstylebase = commonstylebase(self.translation_ui)
self.setcommonstylesheet() self.setcommonstylesheet()
self.settin_ui = Settin(self.__commonstylebase) self.settin_ui = Setting(self.__commonstylebase)
self.transhis = transhist(self.settin_ui) self.transhis = transhist(self.settin_ui)
self.startreader() self.startreader()
self.searchwordW = searchwordW(self.settin_ui) self.searchwordW = searchwordW(self.settin_ui)

View File

@ -2325,10 +2325,6 @@ class mdict(cishubase):
try: try:
with open("userconfig/mdict_config.json", "r", encoding="utf8") as ff: with open("userconfig/mdict_config.json", "r", encoding="utf8") as ff:
self.extraconf = json.loads(ff.read()) self.extraconf = json.loads(ff.read())
except:
try:
with open("cache/mdict/config.json", "r", encoding="utf8") as ff:
self.extraconf = json.loads(ff.read())
except: except:
self.extraconf = {} self.extraconf = {}
self.sql = None self.sql = None

View File

@ -1,9 +1,8 @@
from qtsymbols import * from qtsymbols import *
import os, functools
import windows, qtawesome, gobject
from winsharedutils import getpidhwndfirst from winsharedutils import getpidhwndfirst
import functools
from myutils.config import globalconfig, _TR from myutils.config import globalconfig, _TR
import windows
import os, gobject
from myutils.wrapper import Singleton_close from myutils.wrapper import Singleton_close
from myutils.hwnd import ( from myutils.hwnd import (
getpidexe, getpidexe,
@ -11,8 +10,6 @@ from myutils.hwnd import (
mouseselectwindow, mouseselectwindow,
getExeIcon, getExeIcon,
) )
import qtawesome
from gui.usefulwidget import saveposwindow, getQMessageBox from gui.usefulwidget import saveposwindow, getQMessageBox

View File

@ -1,10 +1,9 @@
import functools
from qtsymbols import * from qtsymbols import *
from gui.usefulwidget import getspinbox, threebuttons, getlineedit import functools
from myutils.utils import checkencoding from myutils.utils import checkencoding
from myutils.config import globalconfig, _TR, _TRL from myutils.config import globalconfig, _TR, _TRL
from myutils.wrapper import Singleton from myutils.wrapper import Singleton
from gui.usefulwidget import getspinbox, threebuttons, getlineedit
nowsuppertcodes = _TRL( nowsuppertcodes = _TRL(
[ [

View File

@ -1,8 +1,8 @@
from qtsymbols import * from qtsymbols import *
from myutils.config import _TR, globalconfig
from gui.usefulwidget import saveposwindow
from myutils.wrapper import Singleton_close
import os import os
from myutils.config import _TR, globalconfig
from myutils.wrapper import Singleton_close
from gui.usefulwidget import saveposwindow
@Singleton_close @Singleton_close

View File

@ -1,26 +1,19 @@
import time
from datetime import datetime, timedelta
from gui.specialwidget import ScrollFlow, chartwidget, lazyscrollflow
from qtsymbols import * from qtsymbols import *
import functools, threading import os, functools
from datetime import datetime, timedelta
from traceback import print_exc from traceback import print_exc
import windows import windows, gobject, winsharedutils
import os from myutils.vndb import parsehtmlmethod
from myutils.config import (
from gui.usefulwidget import ( savehook_new_list,
getsimplecombobox, savehook_new_data,
getspinbox, vndbtagdata,
getcolorbutton, _TR,
getsimpleswitch, _TRL,
getspinbox, globalconfig,
selectcolor, static_data,
) )
import os
from myutils.config import savehook_new_list, savehook_new_data, vndbtagdata
from myutils.hwnd import getExeIcon from myutils.hwnd import getExeIcon
import gobject
from myutils.config import _TR, _TRL, globalconfig, static_data
import winsharedutils
from myutils.wrapper import Singleton_close, Singleton, threader, tryprint from myutils.wrapper import Singleton_close, Singleton, threader, tryprint
from myutils.utils import ( from myutils.utils import (
checkifnewgame, checkifnewgame,
@ -29,6 +22,14 @@ from myutils.utils import (
titlechangedtask, titlechangedtask,
imgchangedtask, imgchangedtask,
) )
from gui.inputdialog import noundictconfigdialog1
from gui.specialwidget import (
ScrollFlow,
chartwidget,
lazyscrollflow,
stackedlist,
shrinkableitem,
)
from gui.usefulwidget import ( from gui.usefulwidget import (
yuitsu_switch, yuitsu_switch,
saveposwindow, saveposwindow,
@ -36,9 +37,15 @@ from gui.usefulwidget import (
getlineedit, getlineedit,
auto_select_webview, auto_select_webview,
Prompt_dialog, Prompt_dialog,
getsimplecombobox,
getspinbox,
getcolorbutton,
makesubtab_lazy,
tabadd_lazy,
getsimpleswitch,
getspinbox,
selectcolor,
) )
from myutils.vndb import parsehtmlmethod
from gui.inputdialog import noundictconfigdialog1
class ItemWidget(QWidget): class ItemWidget(QWidget):
@ -565,8 +572,7 @@ def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect:
return new_rect return new_rect
@Singleton_close class dialog_setting_game_internal(QWidget):
class dialog_setting_game(QDialog):
def selectexe(self): def selectexe(self):
f = QFileDialog.getOpenFileName(directory=self.exepath) f = QFileDialog.getOpenFileName(directory=self.exepath)
res = f[0] res = f[0]
@ -584,26 +590,15 @@ class dialog_setting_game(QDialog):
self.editpath.setText(res) self.editpath.setText(res)
self.exepath = res self.exepath = res
def closeEvent(self, a0: QCloseEvent) -> None:
self.isopened = False
return super().closeEvent(a0)
def __init__(self, parent, exepath) -> None: def __init__(self, parent, exepath) -> None:
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint) super().__init__(parent)
global _global_dialog_setting_game vbox = QVBoxLayout(self)
_global_dialog_setting_game = self vbox.setContentsMargins(0, 0, 0, 0)
self.isopened = True
vbox = QVBoxLayout(self) # 配置layout
self.setLayout(vbox) self.setLayout(vbox)
formwidget = QWidget()
formLayout = QFormLayout() formLayout = QFormLayout()
formwidget.setLayout(formLayout)
self.exepath = exepath self.exepath = exepath
self.editpath = QLineEdit(exepath) self.editpath = QLineEdit(exepath)
self.editpath.setReadOnly(True) self.editpath.setReadOnly(True)
self.setWindowTitle(savehook_new_data[exepath]["title"])
self.setWindowIcon(getExeIcon(exepath, cache=True))
formLayout.addRow( formLayout.addRow(
_TR("路径"), _TR("路径"),
getboxlayout( getboxlayout(
@ -696,30 +691,27 @@ class dialog_setting_game(QDialog):
), ),
) )
methodtab = QTabWidget() methodtab, do = makesubtab_lazy(
methodtab.addTab(self.starttab(exepath), _TR("启动")) _TRL(["启动", "HOOK", "预翻译", "语音", "标签", "统计信息", "存档备份"]),
methodtab.addTab(self.gethooktab(exepath), "HOOK") [
methodtab.addTab(self.getpretranstab(exepath), _TR("预翻译")) functools.partial(self.doaddtab, self.starttab, exepath),
methodtab.addTab(self.getttssetting(exepath), _TR("语音")) functools.partial(self.doaddtab, self.gethooktab, exepath),
methodtab.addTab(self.getlabelsetting(exepath), _TR("标签")) functools.partial(self.doaddtab, self.getpretranstab, exepath),
methodtab.addTab(self.getstatistic(exepath), _TR("统计信息")) functools.partial(self.doaddtab, self.getttssetting, exepath),
methodtab.addTab(self.getbackup(exepath), _TR("存档备份")) functools.partial(self.doaddtab, self.getlabelsetting, exepath),
functools.partial(self.doaddtab, self.getstatistic, exepath),
functools.partial(self.doaddtab, self.getbackup, exepath),
],
delay=True,
)
vbox.addWidget(formwidget) vbox.addLayout(formLayout)
vbox.addWidget(methodtab) vbox.addWidget(methodtab)
do()
self.show() def doaddtab(self, wfunct, exe, layout):
self.resize(QSize(600, 1)) w = wfunct(exe)
self.adjustSize() layout.addWidget(w)
self.resize(QSize(600, self.height()))
try:
self.setGeometry(
calculate_centered_rect(
_global_dialog_savedgame_new.geometry(), self.size()
)
)
except:
pass
def selectbackupdir(self, edit): def selectbackupdir(self, edit):
res = QFileDialog.getExistingDirectory( res = QFileDialog.getExistingDirectory(
@ -864,8 +856,10 @@ class dialog_setting_game(QDialog):
formLayout.addLayout(getboxlayout([QLabel(_TR("游戏时间")), self._timelabel])) formLayout.addLayout(getboxlayout([QLabel(_TR("游戏时间")), self._timelabel]))
formLayout.addWidget(chart) formLayout.addWidget(chart)
t = QTimer(self)
threading.Thread(target=self.refresh).start() t.setInterval(1000)
t.timeout.connect(self.refresh)
t.start(0)
return _w return _w
def split_range_into_days(self, times): def split_range_into_days(self, times):
@ -904,7 +898,6 @@ class dialog_setting_game(QDialog):
return lists return lists
def refresh(self): def refresh(self):
while self.isopened:
self._timelabel.setText( self._timelabel.setText(
self.formattime(savehook_new_data[self.exepath]["statistic_playtime"]) self.formattime(savehook_new_data[self.exepath]["statistic_playtime"])
) )
@ -916,7 +909,6 @@ class dialog_setting_game(QDialog):
savehook_new_data[self.exepath]["traceplaytime_v2"] savehook_new_data[self.exepath]["traceplaytime_v2"]
) )
) )
time.sleep(1)
def formattime(self, t, usingnotstart=True): def formattime(self, t, usingnotstart=True):
t = int(t) t = int(t)
@ -1182,10 +1174,39 @@ class dialog_setting_game(QDialog):
) )
@Singleton_close
class dialog_setting_game(QDialog):
def __init__(self, parent, exepath) -> None:
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
global _global_dialog_setting_game
_global_dialog_setting_game = self
self.setWindowTitle(savehook_new_data[exepath]["title"])
self.setWindowIcon(getExeIcon(exepath, cache=True))
_ = dialog_setting_game_internal(self, exepath)
_.setMinimumSize(QSize(600, 500))
l = QHBoxLayout(self)
self.setLayout(l)
l.addWidget(_)
self.show()
try:
self.setGeometry(
calculate_centered_rect(
_global_dialog_savedgame_new.geometry(), self.size()
)
)
except:
pass
@Singleton @Singleton
class dialog_syssetting(QDialog): class dialog_syssetting(QDialog):
def __init__(self, parent) -> None: def __init__(self, parent, type_=1) -> None:
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint) super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
self.setWindowTitle(_TR("其他设置")) self.setWindowTitle(_TR("其他设置"))
formLayout = QFormLayout(self) formLayout = QFormLayout(self)
@ -1193,6 +1214,7 @@ class dialog_syssetting(QDialog):
QLabel(_TR("隐藏不存在的游戏")), QLabel(_TR("隐藏不存在的游戏")),
getsimpleswitch(globalconfig, "hide_not_exists"), getsimpleswitch(globalconfig, "hide_not_exists"),
) )
if type_ == 1:
for key, name in [ for key, name in [
("itemw", "宽度"), ("itemw", "宽度"),
("itemh", "高度"), ("itemh", "高度"),
@ -1232,6 +1254,7 @@ class dialog_syssetting(QDialog):
(_TR("不透明度")), (_TR("不透明度")),
getspinbox(0, 100, globalconfig["dialog_savegame_layout"], "transparent"), getspinbox(0, 100, globalconfig["dialog_savegame_layout"], "transparent"),
) )
if type_ == 1:
formLayout.addRow( formLayout.addRow(
_TR("缩放"), _TR("缩放"),
getsimplecombobox( getsimplecombobox(
@ -1244,6 +1267,8 @@ class dialog_syssetting(QDialog):
QLabel(_TR("启动游戏不修改顺序")), QLabel(_TR("启动游戏不修改顺序")),
getsimpleswitch(globalconfig, "startgamenototop"), getsimpleswitch(globalconfig, "startgamenototop"),
) )
if type_ == 1:
formLayout.addRow( formLayout.addRow(
QLabel(_TR("显示标题")), QLabel(_TR("显示标题")),
getsimpleswitch(globalconfig, "showgametitle"), getsimpleswitch(globalconfig, "showgametitle"),
@ -1409,27 +1434,72 @@ class listediter(QDialog):
) )
@Singleton_close def _getpixfunction(kk):
class dialog_savedgame_new(saveposwindow): _pix = QPixmap(savehook_new_data[kk]["imagepath"])
def startgame(self, game): if _pix.isNull():
if os.path.exists(game): _pix = getExeIcon(kk, False, cache=True)
return _pix
def startgamecheck(self, game):
if not game:
return
if not os.path.exists(game):
return
if globalconfig["startgamenototop"] == False: if globalconfig["startgamenototop"] == False:
idx = savehook_new_list.index(game) idx = savehook_new_list.index(game)
savehook_new_list.insert(0, savehook_new_list.pop(idx)) savehook_new_list.insert(0, savehook_new_list.pop(idx))
self.close() self.close()
startgame(game) startgame(game)
def clicked2(self):
def removegame(game):
try: try:
game = self.currentfocuspath
idx = savehook_new_list.index(game) idx = savehook_new_list.index(game)
savehook_new_list.pop(idx) savehook_new_list.pop(idx)
if game in savehook_new_data: if game in savehook_new_data:
savehook_new_data.pop(game) savehook_new_data.pop(game)
except:
print_exc()
def addgamesingle(callback):
f = QFileDialog.getOpenFileName(options=QFileDialog.Option.DontResolveSymlinks)
res = f[0]
if res == "":
return
res = os.path.normpath(res)
if res not in savehook_new_list:
checkifnewgame(res)
callback(res)
def addgamebatch(callback):
res = QFileDialog.getExistingDirectory(
options=QFileDialog.Option.DontResolveSymlinks
)
if res == "":
return
for _dir, _, _fs in os.walk(res):
for _f in _fs:
path = os.path.normpath(os.path.abspath(os.path.join(_dir, _f)))
if path.lower().endswith(".exe") == False:
continue
if path not in savehook_new_list:
checkifnewgame(path)
callback(path)
@Singleton_close
class dialog_savedgame_new(saveposwindow):
def clicked2(self):
try:
game = self.currentfocuspath
idx2 = savehook_new_list.index(game)
removegame(game)
idx2 = self.idxsave.index(game)
self.flow.removeidx(idx2) self.flow.removeidx(idx2)
self.idxsave.pop(idx2)
self.flow.setfocus(idx2) self.flow.setfocus(idx2)
except: except:
pass pass
@ -1438,29 +1508,10 @@ class dialog_savedgame_new(saveposwindow):
opendir(self.currentfocuspath) opendir(self.currentfocuspath)
def clicked3_batch(self): def clicked3_batch(self):
res = QFileDialog.getExistingDirectory( addgamebatch(lambda res: self.newline(res, True))
options=QFileDialog.Option.DontResolveSymlinks
)
if res != "":
for _dir, _, _fs in os.walk(res):
for _f in _fs:
path = os.path.abspath(os.path.join(_dir, _f))
if path.lower().endswith(".exe") == False:
continue
if path not in savehook_new_list:
checkifnewgame(path)
self.newline(path, True)
def clicked3(self): def clicked3(self):
addgamesingle(lambda res: self.newline(res, True))
f = QFileDialog.getOpenFileName(options=QFileDialog.Option.DontResolveSymlinks)
res = f[0]
if res != "":
res = os.path.normpath(res)
if res not in savehook_new_list:
checkifnewgame(res)
self.newline(res, True)
def tagschanged(self, tags): def tagschanged(self, tags):
self.currtags = tags self.currtags = tags
@ -1469,7 +1520,6 @@ class dialog_savedgame_new(saveposwindow):
ItemWidget.clearfocus() ItemWidget.clearfocus()
self.formLayout.removeWidget(self.flow) self.formLayout.removeWidget(self.flow)
self.flow.deleteLater() self.flow.deleteLater()
self.idxsave.clear()
self.flow = lazyscrollflow() self.flow = lazyscrollflow()
self.flow.bgclicked.connect(ItemWidget.clearfocus) self.flow.bgclicked.connect(ItemWidget.clearfocus)
self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow) self.formLayout.insertWidget(self.formLayout.count() - 1, self.flow)
@ -1522,9 +1572,12 @@ class dialog_savedgame_new(saveposwindow):
othersetting = QAction(_TR("其他设置")) othersetting = QAction(_TR("其他设置"))
if self.currentfocuspath: if self.currentfocuspath:
exists = os.path.exists(self.currentfocuspath)
if exists:
menu.addAction(startgame) menu.addAction(startgame)
menu.addAction(gamesetting) menu.addAction(gamesetting)
menu.addAction(delgame) menu.addAction(delgame)
if exists:
menu.addAction(opendir) menu.addAction(opendir)
else: else:
menu.addAction(addgame) menu.addAction(addgame)
@ -1532,7 +1585,7 @@ class dialog_savedgame_new(saveposwindow):
menu.addAction(othersetting) menu.addAction(othersetting)
action = menu.exec(self.mapToGlobal(p)) action = menu.exec(self.mapToGlobal(p))
if action == startgame: if action == startgame:
self.startgame(self.currentfocuspath) startgamecheck(self, self.currentfocuspath)
elif action == gamesetting: elif action == gamesetting:
self.showsettingdialog() self.showsettingdialog()
elif action == delgame: elif action == delgame:
@ -1617,7 +1670,7 @@ class dialog_savedgame_new(saveposwindow):
self.buttonlayout = buttonlayout self.buttonlayout = buttonlayout
self.savebutton = [] self.savebutton = []
self.simplebutton( self.simplebutton(
"开始游戏", True, lambda: self.startgame(self.currentfocuspath), True "开始游戏", True, lambda: startgamecheck(self, self.currentfocuspath), True
) )
self.simplebutton("游戏设置", True, self.showsettingdialog, False) self.simplebutton("游戏设置", True, self.showsettingdialog, False)
self.simplebutton("删除游戏", True, self.clicked2, False) self.simplebutton("删除游戏", True, self.clicked2, False)
@ -1636,7 +1689,6 @@ class dialog_savedgame_new(saveposwindow):
self.activategamenum = 1 self.activategamenum = 1
self.itemfocuschanged(False, None) self.itemfocuschanged(False, None)
self.show() self.show()
self.idxsave = []
if globalconfig["hide_not_exists"]: if globalconfig["hide_not_exists"]:
self.tagswidget.addTag(_TR("存在"), tagitem.TYPE_EXISTS) self.tagswidget.addTag(_TR("存在"), tagitem.TYPE_EXISTS)
else: else:
@ -1658,17 +1710,13 @@ class dialog_savedgame_new(saveposwindow):
def moverank(self, dx): def moverank(self, dx):
game = self.currentfocuspath game = self.currentfocuspath
idx1 = self.idxsave.index(game)
idx2 = (idx1 + dx) % len(self.idxsave)
game2 = self.idxsave[idx2]
self.idxsave[idx1], self.idxsave[idx2] = self.idxsave[idx2], self.idxsave[idx1]
self.flow.switchidx(idx1, idx2)
idx1 = savehook_new_list.index(game) idx1 = savehook_new_list.index(game)
idx2 = savehook_new_list.index(game2) idx2 = (idx1 + dx) % len(savehook_new_list)
savehook_new_list[idx1], savehook_new_list[idx2] = ( savehook_new_list[idx1], savehook_new_list[idx2] = (
savehook_new_list[idx2], savehook_new_list[idx2],
savehook_new_list[idx1], savehook_new_list[idx1],
) )
self.flow.switchidx(idx1, idx2)
def showsettingdialog(self): def showsettingdialog(self):
try: try:
@ -1701,17 +1749,11 @@ class dialog_savedgame_new(saveposwindow):
) )
_btn.setEnabled(_able1) _btn.setEnabled(_able1)
def _getpixfunction(self, kk):
_pix = QPixmap(savehook_new_data[kk]["imagepath"])
if _pix.isNull():
_pix = getExeIcon(kk, False, cache=True)
return _pix
def getagameitem(self, k): def getagameitem(self, k):
gameitem = ItemWidget( gameitem = ItemWidget(
k, functools.partial(self._getpixfunction, k), savehook_new_data[k]["title"] k, functools.partial(_getpixfunction, k), savehook_new_data[k]["title"]
) )
gameitem.doubleclicked.connect(self.startgame) gameitem.doubleclicked.connect(functools.partial(startgamecheck, self))
gameitem.focuschanged.connect(self.itemfocuschanged) gameitem.focuschanged.connect(self.itemfocuschanged)
return gameitem return gameitem
@ -1725,13 +1767,10 @@ class dialog_savedgame_new(saveposwindow):
self.flow.insertwidget( self.flow.insertwidget(
0, (functools.partial(self.getagameitem, k), QSize(itemw, itemh)) 0, (functools.partial(self.getagameitem, k), QSize(itemw, itemh))
) )
self.idxsave.insert(0, k)
else: else:
self.flow.addwidget( self.flow.addwidget(
(functools.partial(self.getagameitem, k), QSize(itemw, itemh)) (functools.partial(self.getagameitem, k), QSize(itemw, itemh))
) )
# self.flow.addwidget( self.getagameitem(k))
self.idxsave.append(k)
@Singleton_close @Singleton_close
@ -1754,33 +1793,22 @@ class dialog_savedgame_lagacy(QDialog):
def clicked2(self): def clicked2(self):
try: try:
key = savehook_new_list.pop(self.table.currentIndex().row()) removegame(savehook_new_list[self.table.currentIndex().row()])
if key in savehook_new_data:
savehook_new_data.pop(key)
self.model.removeRow(self.table.currentIndex().row()) self.model.removeRow(self.table.currentIndex().row())
except: except:
pass pass
def clicked3(self): def clicked3(self):
def call(res):
f = QFileDialog.getOpenFileName(directory="")
res = f[0]
if res != "":
row = 0 # model.rowCount()
res = res.replace("/", "\\")
if res in savehook_new_list:
return
self.newline(0, res) self.newline(0, res)
self.table.setCurrentIndex(self.model.index(0, 0)) self.table.setCurrentIndex(self.model.index(0, 0))
addgamesingle(call)
def clicked(self): def clicked(self):
if os.path.exists(self.model.item(self.table.currentIndex().row(), 2).savetext): startgamecheck(
savehook_new_list.insert( self, self.model.item(self.table.currentIndex().row(), 2).savetext
0, savehook_new_list.pop(self.table.currentIndex().row())
) )
self.close()
startgame(self.model.item(self.table.currentIndex().row(), 2).savetext)
def newline(self, row, k): def newline(self, row, k):
keyitem = QStandardItem() keyitem = QStandardItem()
@ -1800,7 +1828,9 @@ class dialog_savedgame_lagacy(QDialog):
) )
self.table.setIndexWidget( self.table.setIndexWidget(
self.model.index(row, 1), self.model.index(row, 1),
getcolorbutton("", "", functools.partial(opendir, k), qicon=getExeIcon(k)), getcolorbutton(
"", "", functools.partial(opendir, k), qicon=getExeIcon(k, cache=True)
),
) )
self.table.setIndexWidget( self.table.setIndexWidget(
@ -1818,9 +1848,9 @@ class dialog_savedgame_lagacy(QDialog):
# if dialog_savedgame._sigleton : # if dialog_savedgame._sigleton :
# return # return
# dialog_savedgame._sigleton=True # dialog_savedgame._sigleton=True
super().__init__(parent, Qt.WindowCloseButtonHint) super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
globalconfig["gamemanageruseversion"] = 1 globalconfig["gamemanageruseversion"] = 1
self.setWindowTitle(_TR("已保存游戏")) self.setWindowTitle(_TR("游戏管理"))
formLayout = QVBoxLayout(self) # formLayout = QVBoxLayout(self) #
model = QStandardItemModel() model = QStandardItemModel()
model.setHorizontalHeaderLabels(_TRL(["转区", "", "设置", "游戏"])) # ,'HOOK']) model.setHorizontalHeaderLabels(_TRL(["转区", "", "设置", "游戏"])) # ,'HOOK'])
@ -1828,11 +1858,13 @@ class dialog_savedgame_lagacy(QDialog):
self.model = model self.model = model
table = QTableView() table = QTableView()
table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents) table.horizontalHeader().setSectionResizeMode(
QHeaderView.ResizeMode.ResizeToContents
)
table.horizontalHeader().setStretchLastSection(True) table.horizontalHeader().setStretchLastSection(True)
# table.setEditTriggers(QAbstractItemView.NoEditTriggers); # table.setEditTriggers(QAbstractItemView.NoEditTriggers);
table.setSelectionBehavior(QAbstractItemView.SelectRows) table.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows)
table.setSelectionMode((QAbstractItemView.SingleSelection)) table.setSelectionMode((QAbstractItemView.SelectionMode.SingleSelection))
table.setWordWrap(False) table.setWordWrap(False)
table.setModel(model) table.setModel(model)
self.table = table self.table = table
@ -1857,3 +1889,277 @@ class dialog_savedgame_lagacy(QDialog):
formLayout.addWidget(button2) formLayout.addWidget(button2)
self.resize(QSize(800, 400)) self.resize(QSize(800, 400))
self.show() self.show()
class clickitem(QWidget):
focuschanged = pyqtSignal(bool, str)
doubleclicked = pyqtSignal(str)
globallashfocus = None
@classmethod
def clearfocus(cls):
try: # 可能已被删除
if clickitem.globallashfocus:
clickitem.globallashfocus.focusOut()
except:
pass
clickitem.globallashfocus = None
def mouseDoubleClickEvent(self, e):
self.doubleclicked.emit(self.exe)
def click(self):
try:
self.bottommask.setStyleSheet(
f'background-color: {str2rgba(globalconfig["dialog_savegame_layout"]["onselectcolor"],globalconfig["dialog_savegame_layout"]["transparent"])};'
)
if self != clickitem.globallashfocus:
clickitem.clearfocus()
clickitem.globallashfocus = self
self.focuschanged.emit(True, self.exe)
except:
print_exc()
def mousePressEvent(self, ev) -> None:
self.click()
def focusOut(self):
self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);")
self.focuschanged.emit(False, self.exe)
def resizeEvent(self, a0: QResizeEvent) -> None:
self.bottommask.resize(a0.size())
self.maskshowfileexists.resize(a0.size())
def __init__(self, exe):
super().__init__()
self.exe = exe
self.lay = QHBoxLayout()
self.lay.setSpacing(0)
self.lay.setContentsMargins(0, 0, 0, 0)
self.maskshowfileexists = QLabel(self)
c = globalconfig["dialog_savegame_layout"][
("onfilenoexistscolor", "backcolor")[os.path.exists(exe)]
]
c = str2rgba(c, globalconfig["dialog_savegame_layout"]["transparent"])
self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
self.bottommask = QLabel(self)
self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);")
_ = QLabel()
_.setFixedSize(QSize(40, 40))
_.setScaledContents(True)
_.setStyleSheet("background-color: rgba(255,255,255, 0);")
icon = getExeIcon(exe, icon=False, cache=True)
icon.setDevicePixelRatio(self.devicePixelRatioF())
_.setPixmap(icon)
self.lay.addWidget(_)
_ = QLabel(savehook_new_data[exe]["title"])
_.setWordWrap(True)
_.setFixedHeight(40)
self.lay.addWidget(_)
self.setLayout(self.lay)
_.setStyleSheet(
"""background-color: rgba(255,255,255, 0);border-bottom: 1px solid black;"""
)
class pixwrapper(QWidget):
def __init__(self) -> None:
super().__init__()
self.pixview = QLabel(self)
self.pixmap = None
def resizeEvent(self, e: QResizeEvent):
self.pixview.resize(e.size())
if self.pixmap:
self.pixview.setPixmap(self.scalepix(self.pixmap))
def setpix(self, pix: QPixmap):
pix.setDevicePixelRatio(self.devicePixelRatioF())
self.pixmap = pix
self.pixview.setPixmap(self.scalepix(pix))
def scalepix(self, pix: QPixmap):
pix = pix.scaled(
self.pixview.size() * self.devicePixelRatioF(),
Qt.AspectRatioMode.KeepAspectRatio,
Qt.TransformationMode.SmoothTransformation,
)
return pix
@Singleton_close
class dialog_savedgame_v3(saveposwindow):
def viewitem(self, k):
try:
_pix = _getpixfunction(k)
self.pixview.setpix(_pix)
self.currentfocuspath = k
if self.righttop.count() > 1:
self.righttop.removeTab(1)
tabadd_lazy(
self.righttop,
savehook_new_data[k]["title"],
lambda v: v.addWidget(dialog_setting_game_internal(self, k)),
)
except:
print_exc()
def itemfocuschanged(self, b, k):
if b:
self.currentfocuspath = k
else:
self.currentfocuspath = None
for _btn, exists in self.savebutton:
_able1 = b and (
(not exists)
or (self.currentfocuspath)
and (os.path.exists(self.currentfocuspath))
)
_btn.setEnabled(_able1)
if self.currentfocuspath:
self.viewitem(k)
def newline(self, row, k, select):
item = clickitem(k)
item.doubleclicked.connect(functools.partial(startgamecheck, self))
item.focuschanged.connect(self.itemfocuschanged)
if select:
item.click()
self.group0.insertw(row, item)
def stack_showmenu(self, p):
if not self.currentfocuspath:
return
menu = QMenu(self)
startgame = QAction(_TR("开始游戏"))
delgame = QAction(_TR("删除游戏"))
opendir = QAction(_TR("打开目录"))
exists = os.path.exists(self.currentfocuspath)
if exists:
menu.addAction(startgame)
menu.addAction(delgame)
if exists:
menu.addAction(opendir)
action = menu.exec(QCursor.pos())
if action == startgame:
startgamecheck(self, self.currentfocuspath)
elif action == delgame:
self.clicked2()
elif action == opendir:
self.clicked4()
def __init__(self, parent) -> None:
super().__init__(
parent,
flags=Qt.WindowType.WindowMinMaxButtonsHint
| Qt.WindowType.WindowCloseButtonHint,
dic=globalconfig,
key="savegamedialoggeo3",
)
globalconfig["gamemanageruseversion"] = 2
self.setWindowTitle(_TR("游戏管理"))
self.currentfocuspath = None
self.stack = stackedlist()
self.stack.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
self.stack.customContextMenuRequested.connect(self.stack_showmenu)
self.stack.setFixedWidth(300)
w = QWidget()
self.setCentralWidget(w)
lay = QHBoxLayout()
w.setLayout(lay)
lay.addWidget(self.stack)
self.group0 = shrinkableitem(QPushButton("GLOBAL"))
self.stack.addw(self.group0)
self.righttop = makesubtab_lazy()
self.pixview = pixwrapper()
_w = QWidget()
rightlay = QVBoxLayout()
rightlay.setContentsMargins(0, 0, 0, 0)
_w.setLayout(rightlay)
self.righttop.addTab(_w, " ")
lay.addWidget(self.righttop)
rightlay.addWidget(self.pixview)
self.buttonlayout = QHBoxLayout()
self.savebutton = []
rightlay.addLayout(self.buttonlayout)
self.simplebutton(
"开始游戏", True, lambda: startgamecheck(self, self.currentfocuspath), True
)
self.simplebutton("删除游戏", True, self.clicked2, False)
self.simplebutton("打开目录", True, self.clicked4, True)
if globalconfig["startgamenototop"]:
self.simplebutton("Up", True, functools.partial(self.moverank, -1), False)
self.simplebutton("Down", True, functools.partial(self.moverank, 1), False)
self.simplebutton("添加游戏", False, self.clicked3, 1)
self.simplebutton("批量添加", False, self.clicked3_batch, 1)
self.simplebutton(
"其他设置", False, lambda: dialog_syssetting(self, type_=2), False
)
self.show()
for row, k in enumerate(savehook_new_list): # 2
if globalconfig["hide_not_exists"]:
if not os.path.exists(k):
continue
self.newline(row, k, row == 0)
def moverank(self, dx):
game = self.currentfocuspath
idx1 = savehook_new_list.index(game)
idx2 = (idx1 + dx) % len(savehook_new_list)
savehook_new_list[idx1], savehook_new_list[idx2] = (
savehook_new_list[idx2],
savehook_new_list[idx1],
)
self.group0.insertw(idx2, self.group0.popw(idx1))
def clicked2(self):
if not self.currentfocuspath:
return
try:
game = self.currentfocuspath
idx2 = savehook_new_list.index(game)
self.group0.popw(idx2).deleteLater()
removegame(game)
self.currentfocuspath = savehook_new_list[idx2]
except:
pass
def clicked4(self):
opendir(self.currentfocuspath)
def clicked3_batch(self):
addgamebatch(lambda res: self.newline(res, True, False))
def clicked3(self):
addgamesingle(lambda res: self.newline(0, res, True))
def clicked(self):
startgamecheck(self, self.currentfocuspath)
def simplebutton(self, text, save, callback, exists):
button5 = QPushButton()
button5.setText(_TR(text))
if save:
self.savebutton.append((button5, exists))
button5.clicked.connect(callback)
button5.setFocusPolicy(Qt.FocusPolicy.NoFocus)
self.buttonlayout.addWidget(button5)
return button5

View File

@ -1,11 +1,10 @@
from qtsymbols import * from qtsymbols import *
import qtawesome import threading, windows, time
import threading, windows import gobject, qtawesome
import gobject, time
from myutils.config import globalconfig, _TR, _TRL from myutils.config import globalconfig, _TR, _TRL
from gui.usefulwidget import saveposwindow, getsimplecombobox
from myutils.utils import str2rgba from myutils.utils import str2rgba
from myutils.wrapper import Singleton_close, threader from myutils.wrapper import Singleton_close, threader
from gui.usefulwidget import saveposwindow, getsimplecombobox
@Singleton_close @Singleton_close

View File

@ -1,10 +1,10 @@
import functools
from qtsymbols import * from qtsymbols import *
import qtawesome, importlib import functools, importlib
import qtawesome
from myutils.config import globalconfig, _TR, _TRL from myutils.config import globalconfig, _TR, _TRL
from gui.usefulwidget import MySwitch, selectcolor, getsimpleswitch, threebuttons
from myutils.utils import makehtml from myutils.utils import makehtml
from myutils.wrapper import Singleton from myutils.wrapper import Singleton
from gui.usefulwidget import MySwitch, selectcolor, getsimpleswitch, threebuttons
@Singleton @Singleton

View File

@ -1,8 +1,6 @@
from qtsymbols import * from qtsymbols import *
import sqlite3, os import sqlite3, os, json, functools
import json
from traceback import print_exc from traceback import print_exc
import functools
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 from gui.usefulwidget import getQMessageBox

View File

@ -1,8 +1,7 @@
from qtsymbols import * from qtsymbols import *
from myutils.config import _TR
from myutils.config import globalconfig
from gui.resizeablemainwindow import Mainw
import windows, winsharedutils import windows, winsharedutils
from myutils.config import _TR, globalconfig
from gui.resizeablemainwindow import Mainw
class rangeadjust(Mainw): class rangeadjust(Mainw):

View File

@ -1,15 +1,11 @@
import functools, json, windows
from traceback import print_exc
from qtsymbols import * from qtsymbols import *
from myutils.config import savehook_new_data, static_data import functools, json, subprocess, os, time, binascii
import qtawesome
import subprocess
import winsharedutils
import os, time
import gobject
import binascii
from myutils.config import globalconfig, _TR, _TRL
from collections import OrderedDict from collections import OrderedDict
from traceback import print_exc
import qtawesome, windows, winsharedutils, gobject
from myutils.config import savehook_new_data, static_data, globalconfig, _TR, _TRL
from myutils.utils import checkchaos, get_time_stamp
from gui.dialog_savedgame import dialog_setting_game
from gui.usefulwidget import ( from gui.usefulwidget import (
closeashidewindow, closeashidewindow,
getQMessageBox, getQMessageBox,
@ -18,8 +14,6 @@ from gui.usefulwidget import (
getsimpleswitch, getsimpleswitch,
textbrowappendandmovetoend, textbrowappendandmovetoend,
) )
from myutils.utils import checkchaos, get_time_stamp
from gui.dialog_savedgame import dialog_setting_game
def getformlayoutw(w=None, cls=QFormLayout, hide=False): def getformlayoutw(w=None, cls=QFormLayout, hide=False):

View File

@ -1,25 +1,25 @@
from qtsymbols import * from qtsymbols import *
import qtawesome
import functools import functools
from myutils.config import globalconfig, _TR import qtawesome
from myutils.config import globalconfig, _TR, _TRL
from myutils.utils import wavmp3player from myutils.utils import wavmp3player
from gui.settingpage1 import setTabOne_lazy from gui.usefulwidget import closeashidewindow, makesubtab_lazy
from gui.settingpage2 import setTabTwo_lazy, checkconnected from gui.setting_textinput import setTabOne_lazy
from gui.settingpage_xianshishezhi import setTabThree_lazy from gui.setting_translate import setTabTwo_lazy, checkconnected
from gui.gui_xianshi_text import maybehavefontsizespin from gui.setting_display import setTabThree_lazy
from gui.settingpage_tts import setTab5, showvoicelist from gui.setting_display_text import maybehavefontsizespin
from gui.settingpage_cishu import setTabcishu from gui.setting_tts import setTab5, showvoicelist
from gui.settingpage_quick import setTab_quick, registrhotkeys from gui.setting_cishu import setTabcishu
from gui.setting_hotkey import setTab_quick, registrhotkeys
from gui.setting_lang import setTablang from gui.setting_lang import setTablang
from gui.setting_proxy import setTab_proxy from gui.setting_proxy import setTab_proxy
from gui.settingpage7 import setTab7_lazy, delaysetcomparetext from gui.setting_transopti import setTab7_lazy, delaysetcomparetext
from gui.settingpage_about import ( from gui.setting_about import (
setTab_aboutlazy, setTab_aboutlazy,
versionlabelmaybesettext, versionlabelmaybesettext,
updateprogress, updateprogress,
getversion, getversion,
) )
from gui.usefulwidget import closeashidewindow, makesubtab_lazy
class TabWidget(QWidget): class TabWidget(QWidget):
@ -62,7 +62,7 @@ class TabWidget(QWidget):
return self.tab_widget.currentWidget() return self.tab_widget.currentWidget()
class Settin(closeashidewindow): class Setting(closeashidewindow):
voicelistsignal = pyqtSignal(list, int) voicelistsignal = pyqtSignal(list, int)
mp3playsignal = pyqtSignal(bytes, int, bool) mp3playsignal = pyqtSignal(bytes, int, bool)
versiontextsignal = pyqtSignal(str) versiontextsignal = pyqtSignal(str)
@ -72,7 +72,7 @@ class Settin(closeashidewindow):
showandsolvesig = pyqtSignal(str) showandsolvesig = pyqtSignal(str)
def __init__(self, parent): def __init__(self, parent):
super(Settin, self).__init__(parent, globalconfig, "setting_geo_2") super(Setting, self).__init__(parent, globalconfig, "setting_geo_2")
self.setWindowIcon(qtawesome.icon("fa.gear")) self.setWindowIcon(qtawesome.icon("fa.gear"))
self.mp3player = wavmp3player() self.mp3player = wavmp3player()
self.mp3playsignal.connect(self.mp3player.mp3playfunction) self.mp3playsignal.connect(self.mp3player.mp3playfunction)
@ -101,6 +101,7 @@ class Settin(closeashidewindow):
self.setWindowTitle(_TR("设置")) self.setWindowTitle(_TR("设置"))
self.tab_widget, do = makesubtab_lazy( self.tab_widget, do = makesubtab_lazy(
_TRL(
[ [
"文本输入", "文本输入",
"翻译设置", "翻译设置",
@ -112,7 +113,8 @@ class Settin(closeashidewindow):
"语言设置", "语言设置",
"代理设置", "代理设置",
"其他设置", "其他设置",
], ]
),
[ [
functools.partial(setTabOne_lazy, self), functools.partial(setTabOne_lazy, self),
functools.partial(setTabTwo_lazy, self), functools.partial(setTabTwo_lazy, self),

View File

@ -1,17 +1,16 @@
from qtsymbols import * from qtsymbols import *
import platform, functools, sys, os
import winsharedutils
from myutils.config import globalconfig, _TR, static_data, _TRL
from myutils.wrapper import threader
from myutils.utils import makehtml, getimageformatlist
from myutils.githubupdate import updatemethod, getvesionmethod
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimpleswitch, D_getsimpleswitch,
D_getsimplecombobox, D_getsimplecombobox,
makescrollgrid, makescrollgrid,
makesubtab_lazy, makesubtab_lazy,
) )
from myutils.config import globalconfig, _TR, static_data
from myutils.wrapper import threader
import platform, winsharedutils, sys, os
from myutils.utils import makehtml, getimageformatlist
import functools
from myutils.githubupdate import updatemethod, getvesionmethod
@threader @threader
def getversion(self): def getversion(self):
@ -121,7 +120,7 @@ def resourcegrid(self, l):
__ = True __ = True
grid.append([(_TR(name), 1, ""), (makehtml(link, __), 2, "link")]) grid.append([(_TR(name), 1, ""), (makehtml(link, __), 2, "link")])
makewidgetsfunctions.append(functools.partial(makescrollgrid, grid)) makewidgetsfunctions.append(functools.partial(makescrollgrid, grid))
tab, dotab = makesubtab_lazy(titles, makewidgetsfunctions, delay=True) tab, dotab = makesubtab_lazy(_TRL(titles), makewidgetsfunctions, delay=True)
l.addWidget(tab) l.addWidget(tab)
dotab() dotab()
@ -224,7 +223,7 @@ def setTab_aboutlazy(self, basel):
] ]
tab, dotab = makesubtab_lazy( tab, dotab = makesubtab_lazy(
["相关说明", "其他设置", "资源下载"], _TRL(["相关说明", "其他设置", "资源下载"]),
[ [
functools.partial(makescrollgrid, shuominggrid), functools.partial(makescrollgrid, shuominggrid),
functools.partial(makescrollgrid, grid2), functools.partial(makescrollgrid, grid2),

View File

@ -1,4 +1,5 @@
import functools, os import functools, os
import gobject
from myutils.config import globalconfig, _TRL from myutils.config import globalconfig, _TRL
from gui.inputdialog import autoinitdialog, autoinitdialog_items from gui.inputdialog import autoinitdialog, autoinitdialog_items
from gui.usefulwidget import ( from gui.usefulwidget import (
@ -8,7 +9,6 @@ from gui.usefulwidget import (
D_getsimpleswitch, D_getsimpleswitch,
D_getsimplecombobox, D_getsimplecombobox,
) )
import gobject
def setTabcishu(self, basel): def setTabcishu(self, basel):

View File

@ -1,11 +1,11 @@
import functools
from qtsymbols import * from qtsymbols import *
from myutils.config import globalconfig import functools
import gobject import gobject
from gui.gui_xianshi_buttons import createbuttonwidget from myutils.config import globalconfig, _TRL
from gui.gui_xianshi_text import xianshigrid from gui.setting_display_buttons import createbuttonwidget
from gui.gui_xianshi_ui import uisetting from gui.setting_display_text import xianshigrid
from gui.gui_xianshi_scale import makescalew from gui.setting_display_ui import uisetting
from gui.setting_display_scale import makescalew
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getspinbox, D_getspinbox,
makesubtab_lazy, makesubtab_lazy,
@ -85,7 +85,7 @@ def _xingw():
def setTabThree_lazy(self, basel): def setTabThree_lazy(self, basel):
tab, do = makesubtab_lazy( tab, do = makesubtab_lazy(
["文本设置", "界面主题", "窗口行为", "工具按钮", "窗口缩放"], _TRL(["文本设置", "界面主题", "窗口行为", "工具按钮", "窗口缩放"]),
[ [
lambda l: makescrollgrid(xianshigrid(self), l), lambda l: makescrollgrid(xianshigrid(self), l),
lambda l: makescrollgrid(uisetting(self), l), lambda l: makescrollgrid(uisetting(self), l),

View File

@ -1,8 +1,8 @@
import functools
from qtsymbols import * from qtsymbols import *
import functools, json
import qtawesome, gobject
from myutils.config import globalconfig, _TR, _TRL from myutils.config import globalconfig, _TR, _TRL
from myutils.wrapper import Singleton from myutils.wrapper import Singleton
import qtawesome, gobject, json
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
D_getcolorbutton, D_getcolorbutton,

View File

@ -1,6 +1,6 @@
import functools
from qtsymbols import * from qtsymbols import *
from myutils.config import globalconfig, magpie_config, static_data import functools
from myutils.config import globalconfig, magpie_config, static_data, _TRL
from gui.inputdialog import getsomepath1 from gui.inputdialog import getsomepath1
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
@ -315,7 +315,7 @@ def makescalew(self, lay):
gw, gd = makegrid(commonfsgrid, delay=True) gw, gd = makegrid(commonfsgrid, delay=True)
vl.addWidget(gw) vl.addWidget(gw)
tw, td = makesubtab_lazy( tw, td = makesubtab_lazy(
["Magpie", "外部缩放软件"], _TRL(["Magpie", "外部缩放软件"]),
[ [
functools.partial(makescrollgrid, innermagpie), functools.partial(makescrollgrid, innermagpie),
functools.partial(makescrollgrid, losslessgrid), functools.partial(makescrollgrid, losslessgrid),

View File

@ -1,8 +1,8 @@
import functools
from qtsymbols import * from qtsymbols import *
from gui.inputdialog import multicolorset import functools
from myutils.config import globalconfig, _TRL
import gobject import gobject
from myutils.config import globalconfig, _TRL
from gui.inputdialog import multicolorset
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
getsimpleswitch, getsimpleswitch,

View File

@ -1,7 +1,7 @@
import functools
from qtsymbols import * from qtsymbols import *
from myutils.config import globalconfig, _TRL, static_data import functools
import gobject import gobject
from myutils.config import globalconfig, _TRL, static_data
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
D_getspinbox, D_getspinbox,

View File

@ -1,16 +1,15 @@
from qtsymbols import *
import functools import functools
import gobject, windows, winsharedutils
from myutils.config import globalconfig, _TR from myutils.config import globalconfig, _TR
from myutils.winsyshotkey import SystemHotkey, registerException from myutils.winsyshotkey import SystemHotkey, registerException
import winsharedutils from myutils.hwnd import grabwindow
import gobject, windows, functools from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey
from qtsymbols import *
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimpleswitch, D_getsimpleswitch,
D_getsimplekeyseq, D_getsimplekeyseq,
makescrollgrid, makescrollgrid,
) )
from myutils.hwnd import grabwindow
from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey
def delaycreatereferlabels(self, name): def delaycreatereferlabels(self, name):

View File

@ -1,6 +1,6 @@
from qtsymbols import * from qtsymbols import *
from myutils.config import _TR import os, functools
from myutils.config import globalconfig from myutils.config import _TR, _TRL, globalconfig
from myutils.utils import splittranslatortypes from myutils.utils import splittranslatortypes
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimpleswitch, D_getsimpleswitch,
@ -9,7 +9,6 @@ from gui.usefulwidget import (
getvboxwidget, getvboxwidget,
makescrollgrid, makescrollgrid,
) )
import os, functools
def getall(l, item="fanyi", name=""): def getall(l, item="fanyi", name=""):
@ -99,7 +98,7 @@ def setTab_proxy_lazy(self, basel):
gridlayoutwidget, do = makegrid(grid1, delay=True) gridlayoutwidget, do = makegrid(grid1, delay=True)
vl.addWidget(gridlayoutwidget) vl.addWidget(gridlayoutwidget)
tab, dotab = makesubtab_lazy( tab, dotab = makesubtab_lazy(
["在线翻译", "注册在线翻译", "在线OCR"], _TRL(["在线翻译", "注册在线翻译", "在线OCR"]),
[ [
functools.partial(makescrollgrid, mianfei), functools.partial(makescrollgrid, mianfei),
functools.partial(makescrollgrid, shoufei), functools.partial(makescrollgrid, shoufei),

View File

@ -1,25 +1,28 @@
import functools, os, windows, json
from qtsymbols import * from qtsymbols import *
from gui.pretransfile import sqlite2json2 import functools, os, json
from gui.settingpage_ocr import getocrgrid import windows, gobject
from myutils.utils import makehtml, getfilemd5
from myutils.config import globalconfig, _TR, _TRL, savehook_new_data, savehook_new_list from myutils.config import globalconfig, _TR, _TRL, savehook_new_data, savehook_new_list
from gui.dialog_savedgame import dialog_savedgame_new, dialog_savedgame_lagacy from gui.pretransfile import sqlite2json2
import gobject from gui.codeacceptdialog import codeacceptdialog
from gui.setting_textinput_ocr import getocrgrid
from gui.dialog_savedgame import (
dialog_savedgame_new,
dialog_savedgame_lagacy,
dialog_savedgame_v3,
)
from gui.inputdialog import regexedit from gui.inputdialog import regexedit
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
D_getspinbox, D_getspinbox,
D_getcolorbutton, D_getcolorbutton,
makegrid, makegrid,
tabadd_lazy,
yuitsu_switch, yuitsu_switch,
getvboxwidget, getvboxwidget,
D_getsimpleswitch, D_getsimpleswitch,
makesubtab_lazy, makesubtab_lazy,
makescrollgrid, makescrollgrid,
) )
from gui.codeacceptdialog import codeacceptdialog
from myutils.utils import makehtml, getfilemd5
def dynamicusemanager(self): def dynamicusemanager(self):
@ -27,6 +30,8 @@ def dynamicusemanager(self):
dialog_savedgame_new(self) dialog_savedgame_new(self)
elif globalconfig["gamemanageruseversion"] == 1: elif globalconfig["gamemanageruseversion"] == 1:
dialog_savedgame_lagacy(self) dialog_savedgame_lagacy(self)
elif globalconfig["gamemanageruseversion"] == 2:
dialog_savedgame_v3(self)
def gethookgrid(self): def gethookgrid(self):
@ -433,10 +438,6 @@ def outputgrid(self):
return grids return grids
def setTabOne(self):
tabadd_lazy(self.tab_widget, ("文本输入"), lambda l: setTabOne_lazy(self, l))
def setTabOne_lazy(self, basel): def setTabOne_lazy(self, basel):
tab1grids = [ tab1grids = [
[("选择文本输入源", -1)], [("选择文本输入源", -1)],
@ -509,7 +510,7 @@ def setTabOne_lazy(self, basel):
gridlayoutwidget, do = makegrid(tab1grids, delay=True) gridlayoutwidget, do = makegrid(tab1grids, delay=True)
vl.addWidget(gridlayoutwidget) vl.addWidget(gridlayoutwidget)
tab, dotab = makesubtab_lazy( tab, dotab = makesubtab_lazy(
["HOOK设置", "OCR设置", "剪贴板", "内嵌翻译", "文本输出"], _TRL(["HOOK设置", "OCR设置", "剪贴板", "内嵌翻译", "文本输出"]),
[ [
lambda l: makescrollgrid(gethookgrid(self), l), lambda l: makescrollgrid(gethookgrid(self), l),
lambda l: makescrollgrid(getocrgrid(self), l), lambda l: makescrollgrid(getocrgrid(self), l),

View File

@ -1,5 +1,8 @@
from qtsymbols import *
import functools, os import functools, os
import gobject
from myutils.config import globalconfig, ocrsetting, _TRL, ocrerrorfix from myutils.config import globalconfig, ocrsetting, _TRL, ocrerrorfix
from gui.inputdialog import autoinitdialog, postconfigdialog, autoinitdialog_items
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
D_getspinbox, D_getspinbox,
@ -8,9 +11,6 @@ from gui.usefulwidget import (
D_getsimpleswitch, D_getsimpleswitch,
selectcolor, selectcolor,
) )
from qtsymbols import *
from gui.inputdialog import autoinitdialog, postconfigdialog, autoinitdialog_items
import gobject
def __label1(self): def __label1(self):

View File

@ -1,12 +1,12 @@
from qtsymbols import * from qtsymbols import *
import functools, gobject import functools, os, time, hashlib
import requests, gobject
from myutils.wrapper import threader
from myutils.config import globalconfig, translatorsetting from myutils.config import globalconfig, translatorsetting
from myutils.subproc import subproc_w from myutils.subproc import subproc_w
from gui.pretransfile import sqlite2json from myutils.config import globalconfig, _TR, _TRL
from myutils.config import globalconfig, _TR
from myutils.utils import selectdebugfile, splittranslatortypes, checkportavailable from myutils.utils import selectdebugfile, splittranslatortypes, checkportavailable
import os, time, requests from gui.pretransfile import sqlite2json
from gui.inputdialog import autoinitdialog, autoinitdialog_items from gui.inputdialog import autoinitdialog, autoinitdialog_items
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getspinbox, D_getspinbox,
@ -19,8 +19,6 @@ from gui.usefulwidget import (
makescrollgrid, makescrollgrid,
getvboxwidget, getvboxwidget,
) )
from myutils.wrapper import threader
import time, hashlib
def hashtext(a): def hashtext(a):
@ -277,7 +275,7 @@ def setTabTwo_lazy(self, basel):
gridlayoutwidget, do = makegrid(grids, delay=True) gridlayoutwidget, do = makegrid(grids, delay=True)
vl.addWidget(gridlayoutwidget) vl.addWidget(gridlayoutwidget)
tab, dotab = makesubtab_lazy( tab, dotab = makesubtab_lazy(
["在线翻译", "develop", "注册在线翻译", "离线翻译", "预翻译"], _TRL(["在线翻译", "develop", "注册在线翻译", "离线翻译", "预翻译"]),
[ [
functools.partial(makescrollgrid, onlinegrid), functools.partial(makescrollgrid, onlinegrid),
functools.partial(makescrollgrid, developgrid), functools.partial(makescrollgrid, developgrid),

View File

@ -1,13 +1,22 @@
import functools, copy, os, gobject
from qtsymbols import * from qtsymbols import *
import functools, copy, os
from traceback import print_exc from traceback import print_exc
import gobject
from myutils.post import POSTSOLVE
from myutils.utils import (
selectdebugfile,
checkpostlangmatch,
loadpostsettingwindowmethod,
)
from myutils.config import ( from myutils.config import (
globalconfig, globalconfig,
postprocessconfig, postprocessconfig,
static_data, static_data,
_TRL,
savehook_new_data, savehook_new_data,
_TR, _TR,
) )
from gui.codeacceptdialog import codeacceptdialog
from gui.usefulwidget import ( from gui.usefulwidget import (
getcolorbutton, getcolorbutton,
D_getcolorbutton, D_getcolorbutton,
@ -16,18 +25,11 @@ from gui.usefulwidget import (
getvboxwidget, getvboxwidget,
makesubtab_lazy, makesubtab_lazy,
) )
from gui.codeacceptdialog import codeacceptdialog
from gui.inputdialog import ( from gui.inputdialog import (
postconfigdialog, postconfigdialog,
autoinitdialog, autoinitdialog,
autoinitdialog_items, autoinitdialog_items,
) )
from myutils.utils import (
selectdebugfile,
checkpostlangmatch,
loadpostsettingwindowmethod,
)
from myutils.post import POSTSOLVE
def savegameprocesstext(): def savegameprocesstext():
@ -254,7 +256,7 @@ def setTab7_lazy(self, basel):
vbox.addWidget(getcomparelayout(self)) vbox.addWidget(getcomparelayout(self))
tab, dotab = makesubtab_lazy( tab, dotab = makesubtab_lazy(
["文本预处理", "翻译优化"], _TRL(["文本预处理", "翻译优化"]),
[___, functools.partial(makescrollgrid, grids2)], [___, functools.partial(makescrollgrid, grids2)],
delay=True, delay=True,
) )

View File

@ -1,9 +1,8 @@
import functools
from qtsymbols import * from qtsymbols import *
from gui.inputdialog import autoinitdialog_items, noundictconfigdialog1, autoinitdialog
from myutils.config import globalconfig, _TRL
import os, functools import os, functools
import gobject import gobject
from myutils.config import globalconfig, _TRL
from gui.inputdialog import autoinitdialog_items, noundictconfigdialog1, autoinitdialog
from gui.usefulwidget import ( from gui.usefulwidget import (
D_getsimplecombobox, D_getsimplecombobox,
D_getspinbox, D_getspinbox,

View File

@ -1,9 +1,9 @@
from qtsymbols import * from qtsymbols import *
import qtawesome, gobject import qtawesome, gobject
from myutils.ocrutil import imagesolve from myutils.ocrutil import imagesolve
from gui.usefulwidget import saveposwindow
from myutils.config import globalconfig, _TR from myutils.config import globalconfig, _TR
from myutils.wrapper import Singleton_close from myutils.wrapper import Singleton_close
from gui.usefulwidget import saveposwindow
@Singleton_close @Singleton_close

View File

@ -1,14 +1,16 @@
from qtsymbols import * from qtsymbols import *
from myutils.hwnd import grabwindow import json, time, functools, os, base64, uuid
from urllib.parse import quote from urllib.parse import quote
from traceback import print_exc from traceback import print_exc
import requests, json, time import qtawesome, requests, gobject, windows
import qtawesome, functools, os, base64 import myutils.ankiconnect as anki
import gobject, uuid, windows from myutils.hwnd import grabwindow
from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey
from myutils.config import globalconfig, _TR, static_data from myutils.config import globalconfig, _TR, static_data
import myutils.ankiconnect as anki from myutils.subproc import subproc_w
from myutils.wrapper import threader
from myutils.ocrutil import imageCut, ocr_run
from gui.rangeselect import rangeselct_function
from gui.usefulwidget import ( from gui.usefulwidget import (
closeashidewindow, closeashidewindow,
getQMessageBox, getQMessageBox,
@ -22,10 +24,6 @@ from gui.usefulwidget import (
makesubtab_lazy, makesubtab_lazy,
tabadd_lazy, tabadd_lazy,
) )
from myutils.subproc import subproc_w
from myutils.wrapper import threader
from myutils.ocrutil import imageCut, ocr_run
from gui.rangeselect import rangeselct_function
class loopbackrecorder: class loopbackrecorder:
@ -145,8 +143,8 @@ class AnkiWindow(QWidget):
self.currentword = "" self.currentword = ""
self.tabs = makesubtab_lazy(callback=self.ifshowrefresh) self.tabs = makesubtab_lazy(callback=self.ifshowrefresh)
self.tabs.addTab(self.createaddtab(), _TR("添加")) self.tabs.addTab(self.createaddtab(), _TR("添加"))
tabadd_lazy(self.tabs, "设置", self.creatsetdtab) tabadd_lazy(self.tabs, _TR("设置"), self.creatsetdtab)
tabadd_lazy(self.tabs, "模板", self.creattemplatetab) tabadd_lazy(self.tabs, _TR("模板"), self.creattemplatetab)
l = QHBoxLayout() l = QHBoxLayout()
l.setContentsMargins(0, 0, 0, 0) l.setContentsMargins(0, 0, 0, 0)

View File

@ -1,7 +1,7 @@
from qtsymbols import * from qtsymbols import *
import threading
from traceback import print_exc from traceback import print_exc
from myutils.wrapper import trypass from myutils.wrapper import trypass
import threading
class chartwidget(QWidget): class chartwidget(QWidget):
@ -13,7 +13,7 @@ class chartwidget(QWidget):
fhall = fmetrics.height() fhall = fmetrics.height()
self.font = font self.font = font
self.data = None
self.ymargin = int(fhall) + 10 # 20 self.ymargin = int(fhall) + 10 # 20
self.valuewidth = 10 self.valuewidth = 10
self.xtext = lambda x: str(x) self.xtext = lambda x: str(x)
@ -463,3 +463,96 @@ class lazyscrollflow(QWidget):
new_height = y + line_height - rect.y() + self._margin new_height = y + line_height - rect.y() + self._margin
self.internalwid.setFixedHeight(new_height) self.internalwid.setFixedHeight(new_height)
return new_height return new_height
class simplelistw(QWidget):
def __init__(self):
super().__init__()
self.lay = QVBoxLayout()
self.lay.setContentsMargins(0, 0, 0, 0)
self.lay.setSpacing(0)
self.setLayout(self.lay)
def addw(self, w):
self.lay.addWidget(w)
def insertw(self, i, w):
self.lay.insertWidget(i, w)
def popw(self, i):
return self.lay.takeAt(i).widget()
def w(self, i):
return self.lay.itemAt(i).widget()
def len(self):
return self.lay.count()
class shrinkableitem(QWidget):
def __init__(self, shrinker: QPushButton):
super().__init__()
self.lay = QVBoxLayout()
# self.setSizePolicy(QSizePolicy.Policy.Expanding,QSizePolicy.Policy.Fixed)
self.setLayout(self.lay)
self.lay.setContentsMargins(0, 0, 0, 0)
self.lay.setSpacing(0)
self.btn = shrinker
self.items = simplelistw()
self.btn.clicked.connect(self.Revert)
self.lay.addWidget(self.btn)
self.lay.addWidget(self.items)
def Revert(self):
self.items.setVisible(not self.items.isVisible())
def Show(self):
self.items.show()
def Hide(self):
self.items.hide()
def addw(self, w):
self.items.addw(w)
def insertw(self, i, w):
self.items.insertw(i, w)
def popw(self, i):
return self.items.popw(i)
def w(self, i):
return self.items.w(i)
def len(self):
return self.items.len()
class stackedlist(QScrollArea):
def __init__(self):
super().__init__()
self.setStyleSheet("""QScrollArea{background-color:transparent;border:0px}""")
self.setWidgetResizable(True)
internal = QWidget()
self.setWidget(internal)
self.lay = QVBoxLayout()
self.lay.setAlignment(Qt.AlignmentFlag.AlignTop)
self.lay.setSpacing(0)
self.lay.setContentsMargins(0, 0, 0, 0)
internal.setLayout(self.lay)
self.internal = internal
def addw(self, w):
self.lay.addWidget(w)
def insertw(self, i, w):
self.lay.insertWidget(i, w)
def popw(self, i):
return self.lay.takeAt(i).widget()
def w(self, i):
return self.lay.itemAt(i).widget()
def len(self):
return self.lay.count()

View File

@ -1,7 +1,7 @@
from qtsymbols import * from qtsymbols import *
import functools import functools
from myutils.config import globalconfig
from traceback import print_exc from traceback import print_exc
from myutils.config import globalconfig
class Qlabel_c(QLabel): class Qlabel_c(QLabel):

View File

@ -1,8 +1,9 @@
from qtsymbols import * from qtsymbols import *
import qtawesome, functools, winsharedutils import functools
from gui.usefulwidget import closeashidewindow import qtawesome, winsharedutils
from myutils.config import globalconfig, _TR from myutils.config import globalconfig, _TR
from myutils.utils import get_time_stamp from myutils.utils import get_time_stamp
from gui.usefulwidget import closeashidewindow
class transhist(closeashidewindow): class transhist(closeashidewindow):

View File

@ -1,27 +1,24 @@
import time
import functools
import threading
import os, sys
import windows, importlib
from traceback import print_exc
import qtawesome
from qtsymbols import * from qtsymbols import *
import gobject import time, functools, threading, os, sys, importlib, shutil
from traceback import print_exc
import windows, qtawesome, gobject, winsharedutils
from myutils.wrapper import threader, trypass from myutils.wrapper import threader, trypass
import winsharedutils
from myutils.config import globalconfig, saveallconfig, _TR, static_data from myutils.config import globalconfig, saveallconfig, _TR, static_data
from myutils.subproc import endsubprocs from myutils.subproc import endsubprocs
from myutils.ocrutil import ocr_run, imageCut from myutils.ocrutil import ocr_run, imageCut
from myutils.utils import loadpostsettingwindowmethod, getimageformat, str2rgba from myutils.utils import loadpostsettingwindowmethod, getimageformat, str2rgba
from myutils.hwnd import mouseselectwindow, grabwindow, getExeIcon from myutils.hwnd import mouseselectwindow, grabwindow, getExeIcon
from gui.dialog_savedgame import dialog_savedgame_new, dialog_savedgame_lagacy
from gui.dialog_memory import dialog_memory from gui.dialog_memory import dialog_memory
from gui.textbrowser import Textbrowser from gui.textbrowser import Textbrowser
from gui.rangeselect import rangeselct_function from gui.rangeselect import rangeselct_function
from gui.usefulwidget import resizableframeless, isinrect from gui.usefulwidget import resizableframeless, isinrect
from gui.dialog_savedgame import browserdialog
from gui.edittext import edittrans from gui.edittext import edittrans
import shutil from gui.dialog_savedgame import (
browserdialog,
dialog_savedgame_new,
dialog_savedgame_lagacy,
dialog_savedgame_v3,
)
class QUnFrameWindow(resizableframeless): class QUnFrameWindow(resizableframeless):
@ -405,7 +402,11 @@ class QUnFrameWindow(resizableframeless):
("backtransbutton", lambda: self.changemousetransparentstate(1)), ("backtransbutton", lambda: self.changemousetransparentstate(1)),
("locktoolsbutton", self.changetoolslockstate), ("locktoolsbutton", self.changetoolslockstate),
("gamepad_new", lambda: dialog_savedgame_new(gobject.baseobject.settin_ui)), ("gamepad_new", lambda: dialog_savedgame_new(gobject.baseobject.settin_ui)),
("gamepad_lagacy", lambda: dialog_savedgame_lagacy(gobject.baseobject.settin_ui)), (
"gamepad_lagacy",
lambda: dialog_savedgame_lagacy(gobject.baseobject.settin_ui),
),
("gamepad_v3", lambda: dialog_savedgame_v3(gobject.baseobject.settin_ui)),
( (
"selectgame", "selectgame",
lambda: gobject.baseobject.createattachprocess(), lambda: gobject.baseobject.createattachprocess(),

View File

@ -1,16 +1,15 @@
from qtsymbols import * from qtsymbols import *
import os, platform, functools, threading, time
from traceback import print_exc
import windows, qtawesome
from webviewpy import ( from webviewpy import (
webview_native_handle_kind_t, webview_native_handle_kind_t,
Webview, Webview,
declare_library_path, declare_library_path,
) )
from myutils.config import _TR, globalconfig
from traceback import print_exc
import qtawesome, functools, threading, time
from myutils.wrapper import Singleton
from winsharedutils import HTMLBrowser from winsharedutils import HTMLBrowser
import windows, os, platform from myutils.config import _TR, globalconfig
from myutils.wrapper import Singleton
@Singleton @Singleton
@ -853,7 +852,7 @@ def tabadd_lazy(tab, title, getrealwidgetfunction):
q.setLayout(v) q.setLayout(v)
v.setContentsMargins(0, 0, 0, 0) v.setContentsMargins(0, 0, 0, 0)
q.lazyfunction = functools.partial(getrealwidgetfunction, v) q.lazyfunction = functools.partial(getrealwidgetfunction, v)
tab.addTab(q, _TR(title)) tab.addTab(q, title)
def automakegrid(grid: QGridLayout, lis, save=False, savelist=None): def automakegrid(grid: QGridLayout, lis, save=False, savelist=None):

View File

@ -2,7 +2,7 @@ try:
from PyQt5 import QtSvg from PyQt5 import QtSvg
from PyQt5.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QAction,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider from PyQt5.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QAction,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider
from PyQt5.QtGui import QIconEngine,QIntValidator,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent from PyQt5.QtGui import QIconEngine,QIntValidator,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent
from PyQt5.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex from PyQt5.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex,QTimer
isqt5 = True isqt5 = True
except: except:
#from traceback import print_exc #from traceback import print_exc
@ -10,5 +10,5 @@ except:
from PyQt6 import QtSvg from PyQt6 import QtSvg
from PyQt6.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider from PyQt6.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider
from PyQt6.QtGui import QIconEngine,QIntValidator,QAction,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent from PyQt6.QtGui import QIconEngine,QIntValidator,QAction,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent
from PyQt6.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex from PyQt6.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex,QTimer
isqt5 = False isqt5 = False

View File

@ -129,6 +129,12 @@
1200, 1200,
600 600
], ],
"savegamedialoggeo3": [
100,
100,
1200,
600
],
"browserwidget": [ "browserwidget": [
100, 100,
100, 100,
@ -265,6 +271,7 @@
"locktoolsbutton", "locktoolsbutton",
"gamepad_new", "gamepad_new",
"gamepad_lagacy", "gamepad_lagacy",
"gamepad_v3",
"selectgame", "selectgame",
"selecttext", "selecttext",
"selectocrrange", "selectocrrange",
@ -470,6 +477,12 @@
"icon": "fa.gamepad", "icon": "fa.gamepad",
"align": 0 "align": 0
}, },
"gamepad_v3": {
"use": false,
"tip": "游戏管理_v3",
"icon": "fa.gamepad",
"align": 0
},
"edit": { "edit": {
"use": false, "use": false,
"tip": "编辑", "tip": "编辑",
@ -1130,7 +1143,7 @@
}, },
"txocr": { "txocr": {
"use": false, "use": false,
"name": "tencent.ocr" "name": "腾讯OCR"
}, },
"txocrtrans": { "txocrtrans": {
"use": false, "use": false,
@ -1150,7 +1163,7 @@
}, },
"googlecloudvision": { "googlecloudvision": {
"use": false, "use": false,
"name": "googlecloudvision" "name": "Google Cloud Vision"
}, },
"xunfei": { "xunfei": {
"use": false, "use": false,

View File

@ -809,5 +809,6 @@
"显示时间": "عرض الوقت", "显示时间": "عرض الوقت",
"不显示时间": "لا وقت العرض", "不显示时间": "لا وقت العرض",
"过滤历史重复": "تصفية التاريخ تكرار", "过滤历史重复": "تصفية التاريخ تكرار",
"缓存条数": "عدد شرائط التخزين المؤقت" "缓存条数": "عدد شرائط التخزين المؤقت",
"腾讯OCR": "تينسنت التعرف الضوئي على الحروف"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "顯示時間", "显示时间": "顯示時間",
"不显示时间": "不顯示時間", "不显示时间": "不顯示時間",
"过滤历史重复": "過濾歷史重複", "过滤历史重复": "過濾歷史重複",
"缓存条数": "緩存條數" "缓存条数": "緩存條數",
"腾讯OCR": "騰訊OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Display time", "显示时间": "Display time",
"不显示时间": "Do not display time", "不显示时间": "Do not display time",
"过滤历史重复": "Filter historical duplicates", "过滤历史重复": "Filter historical duplicates",
"缓存条数": "Number of cache entries" "缓存条数": "Number of cache entries",
"腾讯OCR": "Tencent OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Tiempo de visualización", "显示时间": "Tiempo de visualización",
"不显示时间": "No muestra el tiempo", "不显示时间": "No muestra el tiempo",
"过滤历史重复": "Filtrar repetición histórica", "过滤历史重复": "Filtrar repetición histórica",
"缓存条数": "Número de barras de caché" "缓存条数": "Número de barras de caché",
"腾讯OCR": "Tencent OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Afficher l'heure", "显示时间": "Afficher l'heure",
"不显示时间": "Ne pas afficher l'heure", "不显示时间": "Ne pas afficher l'heure",
"过滤历史重复": "Filtrer historique répétition", "过滤历史重复": "Filtrer historique répétition",
"缓存条数": "Nombre de barres de cache" "缓存条数": "Nombre de barres de cache",
"腾讯OCR": "OCR Tencent"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Tempo di visualizzazione", "显示时间": "Tempo di visualizzazione",
"不显示时间": "Non visualizzare l'ora", "不显示时间": "Non visualizzare l'ora",
"过滤历史重复": "Filtra duplicati storici", "过滤历史重复": "Filtra duplicati storici",
"缓存条数": "Numero di voci della cache" "缓存条数": "Numero di voci della cache",
"腾讯OCR": "Tencent OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "表示時間", "显示时间": "表示時間",
"不显示时间": "時間を表示しない", "不显示时间": "時間を表示しない",
"过滤历史重复": "フィルタ履歴の繰り返し", "过滤历史重复": "フィルタ履歴の繰り返し",
"缓存条数": "キャッシュ・エントリ数" "缓存条数": "キャッシュ・エントリ数",
"腾讯OCR": "テンセントOCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "표시 시간", "显示时间": "표시 시간",
"不显示时间": "시간 표시 안 함", "不显示时间": "시간 표시 안 함",
"过滤历史重复": "반복된 기록 필터링", "过滤历史重复": "반복된 기록 필터링",
"缓存条数": "캐시 바 수" "缓存条数": "캐시 바 수",
"腾讯OCR": "텐센트 OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Czas wyświetlania", "显示时间": "Czas wyświetlania",
"不显示时间": "Nie wyświetlaj czasu", "不显示时间": "Nie wyświetlaj czasu",
"过滤历史重复": "Filtruj duplikaty historyczne", "过滤历史重复": "Filtruj duplikaty historyczne",
"缓存条数": "Liczba wpisów pamięci podręcznej" "缓存条数": "Liczba wpisów pamięci podręcznej",
"腾讯OCR": "Dziesięć OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Показать время", "显示时间": "Показать время",
"不显示时间": "Не показывать время", "不显示时间": "Не показывать время",
"过滤历史重复": "Фильтровать повторение истории", "过滤历史重复": "Фильтровать повторение истории",
"缓存条数": "Количество кэшированных записей" "缓存条数": "Количество кэшированных записей",
"腾讯OCR": "Скачать OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "แสดงเวลา", "显示时间": "แสดงเวลา",
"不显示时间": "ไม่แสดงเวลา", "不显示时间": "ไม่แสดงเวลา",
"过滤历史重复": "ประวัติการกรอง ทำซ้ำ", "过滤历史重复": "ประวัติการกรอง ทำซ้ำ",
"缓存条数": "จำนวนแถบแคช" "缓存条数": "จำนวนแถบแคช",
"腾讯OCR": "Tencent โอซีอาร์"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Display time", "显示时间": "Display time",
"不显示时间": "Zamanı gösterme", "不显示时间": "Zamanı gösterme",
"过滤历史重复": "Tarihi çizgileri sil", "过滤历史重复": "Tarihi çizgileri sil",
"缓存条数": "Cache girişlerinin sayısı" "缓存条数": "Cache girişlerinin sayısı",
"腾讯OCR": "Tencent OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Час показу", "显示时间": "Час показу",
"不显示时间": "Не показувати час", "不显示时间": "Не показувати час",
"过滤历史重复": "Фільтрувати історичні дублікати", "过滤历史重复": "Фільтрувати історичні дублікати",
"缓存条数": "Кількість записів кешу" "缓存条数": "Кількість записів кешу",
"腾讯OCR": "Похильний OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "Thời gian hiển thị", "显示时间": "Thời gian hiển thị",
"不显示时间": "Không hiển thị thời gian", "不显示时间": "Không hiển thị thời gian",
"过滤历史重复": "Lọc lịch sử lặp lại", "过滤历史重复": "Lọc lịch sử lặp lại",
"缓存条数": "Số thanh bộ nhớ cache" "缓存条数": "Số thanh bộ nhớ cache",
"腾讯OCR": "Thông tin OCR"
} }

View File

@ -809,5 +809,6 @@
"显示时间": "", "显示时间": "",
"不显示时间": "", "不显示时间": "",
"过滤历史重复": "", "过滤历史重复": "",
"缓存条数": "" "缓存条数": "",
"腾讯OCR": ""
} }

View File

@ -29,7 +29,7 @@ include(generate_product_version)
set(VERSION_MAJOR 3) set(VERSION_MAJOR 3)
set(VERSION_MINOR 1) set(VERSION_MINOR 1)
set(VERSION_PATCH 0) set(VERSION_PATCH 1)
add_library(pch pch.cpp) add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h) target_precompile_headers(pch PUBLIC pch.h)