From 18c271d1cbc972083c7ca1ef4ab41095532fe3e7 Mon Sep 17 00:00:00 2001 From: xystudio_u <173288240@qq.com> Date: Sat, 14 Mar 2026 10:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85feat(clickmouse)=203.2.1.20:=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0"=E6=97=A0=E5=AE=9E=E9=AA=8C=E9=A1=B9=E6=97=B6?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=AE=9E=E9=AA=8C=E5=AE=A4"=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gui/main.py | 42 +++++++++++++++++++++++++------------ Gui/res/defaultsetting.json | 2 +- Gui/res/dev_settings.json | 2 +- Gui/res/langs/langs.json | 8 ++++--- Gui/txtinfo.py | 5 +++++ makefile | 4 ++-- 6 files changed, 43 insertions(+), 20 deletions(-) diff --git a/Gui/main.py b/Gui/main.py index 7ff6d3d..f3064c2 100644 --- a/Gui/main.py +++ b/Gui/main.py @@ -2281,6 +2281,9 @@ def __init__(self, values:dict | None = None): self.page_choice_buttons = [get_lang('42'), get_lang('a6'), get_lang('43'), get_lang('44'), get_lang('69'), filter_hotkey(get_lang('5f')), get_lang('cb'), get_lang('d3')] else: self.page_choice_buttons = [get_lang('42'), get_lang('a6'), get_lang('43'), get_lang('44'), get_lang('69'), filter_hotkey(get_lang('5f')), get_lang('d3')] + + self.create_setting_page_value() + self.last_page = None self.now_page = 0 self.values = {} if values is None else values @@ -2293,6 +2296,23 @@ def __init__(self, values:dict | None = None): logger.debug('初始化设置窗口完成') + def create_setting_page_value(self): + self.page_general = self.page_choice_buttons[0] # 默认设置 + self.page_style = self.page_choice_buttons[1] # 样式设置 + self.page_click = self.page_choice_buttons[2] # 连点器设置 + self.page_update = self.page_choice_buttons[3] # 更新设置 + self.page_hotkey = self.page_choice_buttons[4] # 热键设置 + self.page_doc = self.page_choice_buttons[5] # 文档设置 + if dev_flags.get('new_settings', False): + self.page_notify = self.page_choice_buttons[6] # 提示设置 + self.page_flags = self.page_choice_buttons[7] # 实验室 + else: + self.page_notify = '' + self.page_flags = self.page_choice_buttons[6] # 实验室 + + if (setting_value.hide_flags and len(dev_settings) == 0): + del self.page_choice_buttons[self.page_choice_buttons.index(self.page_flags)] + def check_values(self): '''检查设置值''' # 热键设置 @@ -2318,19 +2338,6 @@ def create_horizontal_line(): def parse_hotkey(input: UHotkeyLineEdit): return input.text().split('+') - self.page_general = self.page_choice_buttons[0] # 默认设置 - self.page_style = self.page_choice_buttons[1] # 样式设置 - self.page_click = self.page_choice_buttons[2] # 连点器设置 - self.page_update = self.page_choice_buttons[3] # 更新设置 - self.page_hotkey = self.page_choice_buttons[4] # 热键设置 - self.page_doc = self.page_choice_buttons[5] # 文档设置 - if dev_flags.get('new_settings', False): - self.page_notify = self.page_choice_buttons[6] # 提示设置 - self.page_flags = self.page_choice_buttons[7] # 实验室 - else: - self.page_notify = '' - self.page_flags = self.page_choice_buttons[6] # 实验室 - # 标题标签 title_label = QLabel(title) set_style(title_label, StyleClass.big_24) @@ -2434,6 +2441,10 @@ def parse_hotkey(input: UHotkeyLineEdit): repair_layout.addWidget(self.repair_button) repair_layout.addStretch(1) + + # 无实验项时自动隐藏实验室 + hide_flags_checkbox = UCheckBox(get_lang('d5')) + hide_flags_checkbox.setChecked(setting_value.hide_flags) # 布局 layout.addLayout(lang_choice_layout) @@ -2450,6 +2461,9 @@ def parse_hotkey(input: UHotkeyLineEdit): layout.addWidget(delay_layout_text) layout.addWidget(delay_tip_label) layout.addWidget(create_horizontal_line()) + if dev_flags.get('new_settings', False): + layout.addWidget(hide_flags_checkbox) + layout.addWidget(create_horizontal_line()) layout.addLayout(repair_layout) # 绑定事件 @@ -2462,6 +2476,8 @@ def parse_hotkey(input: UHotkeyLineEdit): feedback_input.textChanged.connect(lambda: self.on_setting_changed(feedback_input.text, SettingText.feedback)) repair_feedback_link_button.clicked.connect(lambda: self.repair_settings(SettingText.feedback)) repair_start_button.clicked.connect(self.repair_auto_start) + hide_flags_checkbox.checkStateChanged.connect(lambda: self.on_setting_changed(hide_flags_checkbox.isChecked, SettingText.hide_flags)) + hide_flags_checkbox.checkStateChanged.connect(lambda: self.restart_window()) case self.page_click: set_content_label(get_lang('84')) # 选择默认连点器延迟 diff --git a/Gui/res/defaultsetting.json b/Gui/res/defaultsetting.json index c85939f..294a851 100644 --- a/Gui/res/defaultsetting.json +++ b/Gui/res/defaultsetting.json @@ -1 +1 @@ -{"select_lang": "!var system_lang", "show_tray_icon": true, "soft_delay": 100, "click_delay": "", "click_times": "", "delay_unit": 0, "times_unit": 0, "failed_use_default": false, "times_failed_use_default": false, "update_enabled": true, "update_notify": true, "quiet_update": false, "update_ok_notify": true, "update_frequency": 1, "select_style": 0, "use_windows_color": true, "theme": "!var default_theme", "left_click_hotkey": ["F2"], "right_click_hotkey": ["F3"], "pause_click_hotkey": ["F4"], "stop_click_hotkey": ["F6"], "click_attr_hotkey": ["Ctrl", "Alt", "A"], "fast_click_hotkey": ["Ctrl", "Alt", "F"], "main_window_hotkey": ["Ctrl", "Alt", "M"], "default_doc_link": "https://xystudiocode.github.io/clickmouse_docs/{lang}", "lang_doc": 0, "update_log_path": "updatelog", "hotkey_enabled": false, "show_warning": true, "show_package_warning": true, "feedback": "https://github.com/xystudiocode/pyClickMouse/issues/new/choose"} \ No newline at end of file +{"select_lang": "!var system_lang", "show_tray_icon": true, "soft_delay": 100, "click_delay": "", "click_times": "", "delay_unit": 0, "times_unit": 0, "failed_use_default": false, "times_failed_use_default": false, "update_enabled": true, "update_notify": true, "quiet_update": false, "update_ok_notify": true, "update_frequency": 1, "select_style": 0, "use_windows_color": true, "theme": "!var default_theme", "left_click_hotkey": ["F2"], "right_click_hotkey": ["F3"], "pause_click_hotkey": ["F4"], "stop_click_hotkey": ["F6"], "click_attr_hotkey": ["Ctrl", "Alt", "A"], "fast_click_hotkey": ["Ctrl", "Alt", "F"], "main_window_hotkey": ["Ctrl", "Alt", "M"], "default_doc_link": "https://xystudiocode.github.io/clickmouse_docs/{lang}", "lang_doc": 0, "update_log_path": "updatelog", "hotkey_enabled": false, "show_warning": true, "show_package_warning": true, "feedback": "https://github.com/xystudiocode/pyClickMouse/issues/new/choose", "hide_flags": true} \ No newline at end of file diff --git a/Gui/res/dev_settings.json b/Gui/res/dev_settings.json index 6deaaa9..962ed0f 100644 --- a/Gui/res/dev_settings.json +++ b/Gui/res/dev_settings.json @@ -2,6 +2,6 @@ { "name": "More settings", "key": "new_settings", - "desc": "Can add more settings include:\nToast settings\nEnable hotkey checkbox\nFeedback settings." + "desc": "Can add more settings include:\nToast settings\nEnable hotkey checkbox\nFeedback settings and more..." } ] \ No newline at end of file diff --git a/Gui/res/langs/langs.json b/Gui/res/langs/langs.json index 19d3c23..3b02723 100644 --- a/Gui/res/langs/langs.json +++ b/Gui/res/langs/langs.json @@ -179,7 +179,7 @@ "b2": "res/key.json file not found. Please configure res/key.json and recompile.", "b3": "Install the update successfully", "b4": "Note: This operation will not completely change the component style.\nComponents such as selection boxes will still use the system accent color.", - "b5": "(Restart the program to take effect.)", + "b5": "(Restart program to effect.)", "b6": "Auto startup", "b7": "Clicker is running, please stop it first.", "b8": "Close the clickmouse to update.", @@ -210,7 +210,8 @@ "d1": "If your startup is not working, or startup opened the clickmouse\nwindow, you can try to click to fix it.", "d2": "Repair successfully.", "d3": "Lab", - "d4": "To test some experimental features, which may not be stable." + "d4": "To test some experimental features, which may not be stable.", + "d5": "Hide \"lab\" when no experimental features" } }, { @@ -424,7 +425,8 @@ "d1": "如果你的开机自启动出现问题,或打开了clickmouse窗口,可尝试点击\n它来修复。", "d2": "修复成功。", "d3": "实验室", - "d4": "用于测试一些功能,可能不稳定。" + "d4": "用于测试一些功能,可能不稳定。", + "d5": "无实验项时候隐藏\"实验室\"设置项" } } ] \ No newline at end of file diff --git a/Gui/txtinfo.py b/Gui/txtinfo.py index 8423429..b2a30f1 100644 --- a/Gui/txtinfo.py +++ b/Gui/txtinfo.py @@ -34,6 +34,7 @@ class SettingText: show_warning = 'show_warning' show_package_warning ='show_package_warning' feedback = 'feedback' + hide_flags = 'hide_flags' class SettingValue: def get(self, value): @@ -177,6 +178,10 @@ def show_package_warning(self): def feedback(self): return self[SettingText.feedback] + @property + def hide_flags(self): + return self[SettingText.hide_flags] + class StyleClass: big_16 = 'big_text_16' big_20 = 'big_text_20' diff --git a/makefile b/makefile index c01ce6e..e279bdf 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,10 @@ -command = python -m nuitka --msvc=latest --remove-output --company-name="xystudio" --copyright="Copyright 2026 xystudio" --trademarks="xystudio" --product-version="3.2.0" --standalone --output-dir=dist/clickmouse/ +command = python -m nuitka --msvc=latest --remove-output --company-name="xystudio" --copyright="Copyright 2026 xystudio" --trademarks="xystudio" --product-version="3.2.1" --standalone --output-dir=dist/clickmouse/ main: echo Please run a build command, such as "make clickmouse". clickmouse: gui/main.py - $(command) --file-description="Clickmouse" --product-name="ClickMouse" --windows-icon-from-ico=gui/res/icons/clickmouse/icon.ico --include-data-dir=gui/res/=res/ --include-data-file=gui/key=key gui/main.py --file-version="3.2.0.19" --enable-plugin=pyside6 --windows-console-mode="disable" --include-data-file=gui/7z.exe=7z.exe --include-data-file=gui/7z.dll=7z.dll + $(command) --file-description="Clickmouse" --product-name="ClickMouse" --windows-icon-from-ico=gui/res/icons/clickmouse/icon.ico --include-data-dir=gui/res/=res/ --include-data-file=gui/key=key gui/main.py --file-version="3.2.1.20" --enable-plugin=pyside6 --windows-console-mode="disable" --include-data-file=gui/7z.exe=7z.exe --include-data-file=gui/7z.dll=7z.dll $(command) --file-description="Clickmouse uninstall" --product-name="uninstall" --windows-icon-from-ico=gui/res/icons/clickmouse/uninstall.ico --file-version="2.1.4.7" gui/uninstall.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin $(command) --file-description="Clickmouse IPK" --product-name="CmIPK" --windows-icon-from-ico=gui/res/icons/clickmouse/init.ico --file-version="2.0.6.10" gui/install_pack.py --enable-plugin=pyside6 --windows-console-mode="disable" $(command) --file-description="Clickmouse repair" --product-name="CmRepair" --windows-icon-from-ico=gui/res/icons/clickmouse/repair.ico --file-version="2.2.3.6" gui/repair.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin