From f7b0b7c443ded45b3dd421e212875a9dea8e98ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Wed, 20 Nov 2024 19:07:42 +0800 Subject: [PATCH] . --- py/LunaTranslator/gui/setting_hotkey.py | 18 +++++- py/files/defaultconfig/static_data.json | 75 +------------------------ 2 files changed, 16 insertions(+), 77 deletions(-) diff --git a/py/LunaTranslator/gui/setting_hotkey.py b/py/LunaTranslator/gui/setting_hotkey.py index 4554b5f2..a8e87550 100644 --- a/py/LunaTranslator/gui/setting_hotkey.py +++ b/py/LunaTranslator/gui/setting_hotkey.py @@ -1,7 +1,7 @@ from qtsymbols import * import functools import gobject, windows, winsharedutils -from myutils.config import globalconfig, static_data +from myutils.config import globalconfig, get_platform from myutils.winsyshotkey import SystemHotkey, registerException from myutils.hwnd import grabwindow from myutils.utils import parsekeystringtomodvkcode, unsupportkey @@ -98,8 +98,20 @@ def registrhotkeys(self): regist_or_not_key(self, name) -def setTab_quick(self, l: QVBoxLayout): +hotkeys = [ + ["通用", ["_1", "_2", "_3", "_5", "_51", "_6", "_8", "_9", "_10", "_16", "_17"]], + ["HOOK", ["_11", "_12"]], + ["OCR", ["_13", "_14", "_14_1", "_23", "_26", "_26_1"]], + ["剪贴板", ["36", "_4", "_28"]], + ["TTS", ["_32", "_7", "_7_1"]], + ["游戏", ["_15", "_20", "_21", "_22", "_25", "_27", "_31"]], + ["查词", ["_29", "_30", "_35", "_33"]], +] + +def setTab_quick(self, l: QVBoxLayout): + if get_platform() == "xp": + hotkeys.pop(2) l.addWidget( getboxlayout( [ @@ -119,7 +131,7 @@ def setTab_quick(self, l: QVBoxLayout): def ___x(ls, l): makescrollgrid(setTab_quick_lazy(self, ls), l) - for _ in static_data["hotkeys"]: + for _ in hotkeys: __vis.append(_[0]) __.append(functools.partial(___x, _[1])) tab, do = makesubtab_lazy(__vis, __, delay=True) diff --git a/py/files/defaultconfig/static_data.json b/py/files/defaultconfig/static_data.json index 8abc562c..f631c78b 100644 --- a/py/files/defaultconfig/static_data.json +++ b/py/files/defaultconfig/static_data.json @@ -1553,78 +1553,5 @@ "bangumi_oauth": { "client_id": "bgm31536662bc84ee9a9", "client_secret": "b4ca9f5dc7c3819bff163843e1b5cdb0" - }, - "hotkeys": [ - [ - "通用", - [ - "_1", - "_2", - "_3", - "_5", - "_51", - "_6", - "_8", - "_9", - "_10", - "_16", - "_17" - ] - ], - [ - "HOOK", - [ - "_11", - "_12" - ] - ], - [ - "OCR", - [ - "_13", - "_14", - "_14_1", - "_23", - "_26", - "_26_1" - ] - ], - [ - "剪贴板", - [ - "36", - "_4", - "_28" - ] - ], - [ - "TTS", - [ - "_32", - "_7", - "_7_1" - ] - ], - [ - "游戏", - [ - "_15", - "_20", - "_21", - "_22", - "_25", - "_27", - "_31" - ] - ], - [ - "查词", - [ - "_29", - "_30", - "_35", - "_33" - ] - ] - ] + } } \ No newline at end of file