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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"markdown-preview-enhanced.revealjsTheme": "black.css",
"markdown-preview-enhanced.previewTheme": "atom-dark.css",
"files.associations": {
"*.qss": "css"
"*.qss": "css",
"*.gui": "json"
},
"gitLineAuthor.colorConfigs": [
{
Expand Down
11 changes: 11 additions & 0 deletions Gui/hooks/zip_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import json
import sys

def zip_json(json_file):
with open(json_file, 'r') as f:
data = json.load(f)
with open(json_file, 'w') as f:
json.dump(data, f, ensure_ascii=False)

if __name__ == '__main__':
zip_json(sys.argv[1])
7 changes: 2 additions & 5 deletions Gui/install_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,14 @@ def closeEvent(self, event):
shared_memory = QSharedMemory(mem_id[2])
if shared_memory.attach():
# 已经有一个实例在运行
QMessageBox.critical(None, get_init_lang('1d'), get_init_lang('33'))
sys.exit(2)
shared_memory.create(1)

is_running = any(list(map(lambda x: QSharedMemory(x).attach(), mem_id[3:4])))
if is_running:
# 已经有一个实例在运行
QMessageBox.critical(None, get_init_lang('1d'), get_init_lang('31'))
sys.exit(2)

is_ipk = '--ipk' in app.arguments()
Expand Down Expand Up @@ -886,11 +888,6 @@ def closeEvent(self, event):
sys.exit(1)

if is_admin():
is_running = any(list(map(lambda x: QSharedMemory(x).attach(), mem_id[3:4])))
if is_running:
# 已经有一个实例在运行
sys.exit(2)

has_package = os.path.exists(get_resource_path('packages'))
if not has_package:
QMessageBox.warning(None, get_ipk_lang('1d'), get_ipk_lang('1f'))
Expand Down
7 changes: 4 additions & 3 deletions Gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,13 @@ def click_loop():
break
if not self.paused:
try:
pyautogui.click(button=button)
sleep(delay / 1000)
i += 1
if times == float('inf'):
self.click_conuter.emit('inf', str(i), str(delay))
else:
self.click_conuter.emit(str(times), str(i), str(delay))
pyautogui.click(button=button)
sleep(delay / 1000)
i += 1
except Exception:
trace = format_exc()
MessageBox.critical(None, get_lang('14'), f'{get_lang('1b')}\n{trace}')
Expand Down Expand Up @@ -3320,6 +3320,7 @@ def on_start(self):
shared_memory = QSharedMemory(mem_id[0])
if shared_memory.attach():
# 已经有一个实例在运行
QMessageBox.critical(None, get_lang('14'), get_lang('d6'))
sys.exit(2)
shared_memory.create(1)

Expand Down
2 changes: 1 addition & 1 deletion Gui/res/dev_settings.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
4 changes: 2 additions & 2 deletions Gui/res/langs/control.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"05": "The program has successfully uninstalled, but some contents may remain, please delete this folder: {0}",
"06": "Do you want to uninstall clickmouse and its related components?",
"07": "Please run this program as an administrator.",
"08": "Clickmouse is running, please close it before trying to fix it",
"08": "There is already a clickmouse instance running, please close it. if you can't find the window, you can wake it up from the tray.",
"09": "Do you want to fix clickmouse?",
"0a": "Fix successful.",
"0b": "Clickmouse Repair Tool",
Expand Down Expand Up @@ -45,7 +45,7 @@
"05": "程序已成功卸载,但是部分内容可能有残留,请删除这个文件夹:{0}",
"06": "是否卸载clickmouse和其相关组件?",
"07": "请以管理员身份运行本程序。",
"08": "Clickmouse正在运行,请关闭后再尝试修复",
"08": "已经有一个clickmouse相关实例在运行,请先关闭它,如果你没有找到窗口,可前往托盘唤醒。",
"09": "是否修复Clickmouse?",
"0a": "修复成功。",
"0b": "clickmouse 修复工具",
Expand Down
8 changes: 6 additions & 2 deletions Gui/res/langs/init.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
"2d": "\nStart menu shortcut",
"2e": "Checking for update files...",
"2f": "No package change",
"30": "Current status:"
"30": "Current status:",
"31": "There is already a uninstall or repair program instance running, please close it.",
"33": "There is already a modify program instance running."
}
},
{
Expand Down Expand Up @@ -104,7 +106,9 @@
"2d": "\n开始菜单快捷方式",
"2e": "检查需要更新的文件...",
"2f": "没有包变动",
"30": "当前状态:"
"30": "当前状态:",
"31": "已经有一个卸载或修复程序实例在运行,请先关闭它。",
"33": "已经有一个修改程序实例在运行。"
}
}
]
10 changes: 6 additions & 4 deletions Gui/res/langs/langs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"0e": "Stop",
"0f": "Pause",
"10": "Restart",
"11": "Delay(ms)",
"11": "Delay",
"12": "Find the index of the style is out of range, the default style setting has been restored.",
"13": "Resource File Corrupted",
"14": "Error",
Expand Down Expand Up @@ -211,7 +211,8 @@
"d2": "Repair successfully.",
"d3": "Lab",
"d4": "To test some experimental features, which may not be stable.",
"d5": "Hide \"lab\" when no experimental features"
"d5": "Hide \"lab\" when no experimental features",
"d6": "There is already an instance running, if you can't find the window, you can wake it up from the tray."
}
},
{
Expand All @@ -237,7 +238,7 @@
"0e": "停止",
"0f": "暂停",
"10": "重启",
"11": "延迟(ms)",
"11": "延迟",
"12": "设置的样式索引超出范围,已恢复默认样式设置。",
"13": "资源文件出现损坏",
"14": "错误",
Expand Down Expand Up @@ -426,7 +427,8 @@
"d2": "修复成功。",
"d3": "实验室",
"d4": "用于测试一些功能,可能不稳定。",
"d5": "无实验项时候隐藏\"实验室\"设置项"
"d5": "无实验项时候隐藏\"实验室\"设置项",
"d6": "已经有一个实例在运行,如果你没有找到窗口,可前往托盘唤醒。"
}
}
]
2 changes: 1 addition & 1 deletion Gui/res/versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"package_format_version": "1.2.0", "clickmouse":"3.2.2.21"}
{"clickmouse":"3.2.3.22"}
2 changes: 1 addition & 1 deletion Gui/runhook.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off

py hooks/%1.py
py hooks/%1.py %2
2 changes: 1 addition & 1 deletion Gui/uiStyles/QUI.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6.QtCore import *
from PySide6.QtWidgets import *
from PySide6.QtGui import *
import sys
import sys
11 changes: 6 additions & 5 deletions guiclean/clickclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from webbrowser import open as open_url # 关于作者
from uiStyles import (UnitInputLayout, styles, StyleReplaceMode, CustonMessageButton, SelectUI, UCheckBox, UMessageBox, MessageButtonTemplate) # 软件界面样式
from sharelibs import (run_software, langs, __version__, get_icon, default_button_text, get_unit_value, unit_lang, system_lang, settings, QtThread,
default_settings, get_resource_path, get_lang, create_shortcut) # 共享库
default_settings, get_lang, create_shortcut) # 共享库
import winreg # 注册表库
import math # 数学库
import colorsys # 颜色库
Expand Down Expand Up @@ -629,13 +629,13 @@ def click_loop():
break
if not self.paused:
try:
pyautogui.click(button=button)
sleep(delay / 1000)
i += 1
if times == float('inf'):
self.click_conuter.emit('inf', str(i), str(delay))
else:
self.click_conuter.emit(str(times), str(i), str(delay))
pyautogui.click(button=button)
sleep(delay / 1000)
i += 1
except Exception:
trace = format_exc()
UMessageBox.critical(None, get_lang('14'), f'{get_lang('1b')}\n{trace}')
Expand Down Expand Up @@ -937,7 +937,7 @@ def create_menu_bar(self):
menu_bar = self.menuBar()

# 功能菜单
function_menu = menu_bar.addMenu(get_lang('d6'))
function_menu = menu_bar.addMenu(get_lang('d5'))

# 设置菜单
settings_action = function_menu.addAction(get_lang('05'))
Expand Down Expand Up @@ -1778,6 +1778,7 @@ def on_combination_pressed(self, combination):
shared_memory = QSharedMemory('clickmouse_running')
if shared_memory.attach():
# 已经有一个实例在运行
QMessageBox.critical(None, get_lang('14'), get_lang('d6'))
sys.exit(2)
shared_memory.create(1)

Expand Down
14 changes: 8 additions & 6 deletions guiclean/res/langs/langs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"0e": "Stop",
"0f": "Pause",
"10": "Restart",
"11": "Delay(ms)",
"11": "Delay",
"12": "Find the index of the style is out of range, the default style setting has been restored.",
"14": "Error",
"15": "Warning",
Expand Down Expand Up @@ -87,9 +87,10 @@
"b5": "(Restart program to effect.)",
"c9": "Enable hotkey",
"d1": "If your startup is not working, or startup opened the clickmouse\nwindow, you can try to click to fix it.",
"d6": "Tool",
"d5": "Tool",
"ba": "Feedback(&F)",
"b6": "Auto startup"
"b6": "Auto startup",
"d6": "There is already an instance running, if you can't find the window, you can wake it up from the tray."
}
},
{
Expand All @@ -110,7 +111,7 @@
"0e": "停止",
"0f": "暂停",
"10": "重启",
"11": "延迟(ms)",
"11": "延迟",
"14": "错误",
"15": "警告",
"16": "提示",
Expand Down Expand Up @@ -180,8 +181,9 @@
"b6": "开机自启动",
"c9": "启用热键",
"d1": "如果你的开机自启动出现问题,或打开了clickmouse窗口,可尝试点击\n它来修复。",
"d6": "工具",
"ba": "反馈(&F)"
"d5": "工具",
"ba": "反馈(&F)",
"d6": "已经有一个实例在运行,如果你没有找到窗口,可前往托盘唤醒。"
}
}
]
2 changes: 1 addition & 1 deletion guiclean/sharelibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def run_software(code_path, exe_path, args=None):
args = [] if args is None else args
subprocess.Popen(f'python {code_path} {' '.join(args)}' if in_dev else f'{exe_path} {" ".join(args)}')

__version__ = '3.2.2.21'
__version__ = '3.2.3.22'

with open(get_resource_path('langs', 'units.json'), 'r', encoding='utf-8') as f:
unit_lang = json.load(f)
Expand Down
17 changes: 9 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
command = python -m nuitka --msvc=latest --remove-output --company-name="xystudio" --copyright="Copyright 2026 xystudio" --trademarks="xystudio" --product-version="3.2.2" --standalone
command = python -m nuitka --msvc=latest --remove-output --company-name="xystudio" --copyright="Copyright 2026 xystudio" --trademarks="xystudio" --product-version="3.2.3" --standalone

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.2.21" --enable-plugin=pyside6 --windows-console-mode="disable" --include-data-file=gui/7z.exe=7z.exe --include-data-file=gui/7z.dll=7z.dll --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse uninstall" --product-name="uninstall" --windows-icon-from-ico=gui/res/icons/clickmouse/uninstall.ico --file-version="2.1.4.8" gui/uninstall.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse IPK" --product-name="CmIPK" --windows-icon-from-ico=gui/res/icons/clickmouse/init.ico --file-version="2.0.6.11" gui/install_pack.py --enable-plugin=pyside6 --windows-console-mode="disable" --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse repair" --product-name="CmRepair" --windows-icon-from-ico=gui/res/icons/clickmouse/repair.ico --file-version="2.2.3.7" gui/repair.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin --output-dir=dist/clickmouse/
$(command) --file-version="1.0.1.4" gui/check_reg_ver.py --windows-console-mode="disable" --output-dir=dist/clickmouse/
$(command) --file-version="1.0.0.3" gui/updater.py --windows-console-mode="disable" --output-dir=dist/clickmouse/
$(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.3.22" --enable-plugin=pyside6 --windows-console-mode="disable" --include-data-file=gui/7z.exe=7z.exe --include-data-file=gui/7z.dll=7z.dll --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse uninstall" --product-name="uninstall" --windows-icon-from-ico=gui/res/icons/clickmouse/uninstall.ico --file-version="2026.05.23.1" gui/uninstall.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse IPK" --product-name="CmIPK" --windows-icon-from-ico=gui/res/icons/clickmouse/init.ico --file-version="2026.05.23.1" gui/install_pack.py --enable-plugin=pyside6 --windows-console-mode="disable" --output-dir=dist/clickmouse/
$(command) --file-description="Clickmouse repair" --product-name="CmRepair" --windows-icon-from-ico=gui/res/icons/clickmouse/repair.ico --file-version="2026.05.23.1" gui/repair.py --enable-plugin=pyside6 --windows-console-mode="disable" --windows-uac-admin --output-dir=dist/clickmouse/
$(command) --file-version="2026.05.23.1" gui/check_reg_ver.py --windows-console-mode="disable" --output-dir=dist/clickmouse/
$(command) --file-version="2026.05.23.1" gui/updater.py --windows-console-mode="disable" --output-dir=dist/clickmouse/
powershell -ExecutionPolicy Bypass -Command "./merge-distFolders.ps1 -SourcePath ./dist/clickmouse/"

clickclean: guiclean/clickclean.py
$(command) --file-version="3.2.2.21" guiclean/clickclean.py --windows-console-mode="disable" --product-name="ClickClean" --windows-icon-from-ico=guiclean/res/icons/clickmouse/icon.ico --file-description="ClickClean" --enable-plugin=pyside6 --include-data-dir=guiclean/res/=res/ --output-dir=dist/
$(command) --file-version="3.2.3.22" guiclean/clickclean.py --windows-console-mode="disable" --product-name="ClickClean" --windows-icon-from-ico=guiclean/res/icons/clickmouse/icon.ico --file-description="ClickClean" --enable-plugin=pyside6 --include-data-dir=guiclean/res/=res/ --output-dir=dist/clickmouse/
ren ./dist/clickclean.dist clickclean

clickmouse_lib: setup.py
python setup.py bdist_wheel
Expand Down
Loading