Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions Gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
'''检查设置值'''
# 热键设置
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)

# 绑定事件
Expand All @@ -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'))
# 选择默认连点器延迟
Expand Down
2 changes: 1 addition & 1 deletion Gui/res/defaultsetting.json
Original file line number Diff line number Diff line change
@@ -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"}
{"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}
2 changes: 1 addition & 1 deletion Gui/res/dev_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
}
]
8 changes: 5 additions & 3 deletions Gui/res/langs/langs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -424,7 +425,8 @@
"d1": "如果你的开机自启动出现问题,或打开了clickmouse窗口,可尝试点击\n它来修复。",
"d2": "修复成功。",
"d3": "实验室",
"d4": "用于测试一些功能,可能不稳定。"
"d4": "用于测试一些功能,可能不稳定。",
"d5": "无实验项时候隐藏\"实验室\"设置项"
}
}
]
5 changes: 5 additions & 0 deletions Gui/txtinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading