-
Notifications
You must be signed in to change notification settings - Fork 16
修了一大堆问题 #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修了一大堆问题 #153
Conversation
… and enable logs 人话:我脑子傻了写错判断了()
# Conflicts: # main.py
… and enable logs 人话:我脑子傻了写错判断了()
…andling - Enhanced restart logic to handle single-instance issues and suppress console window pop-ups. - Improved update check flow, added detailed status signals, and updated last check time display handling. - Fixed linkage settings page reloading issue and ensured accurate status on update checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the application restart mechanism and update checking functionality, along with several bug fixes. The main changes refactor restart logic to use an exit code signal, improve update check time handling with thread-safe signals, and fix issues with linkage settings page display.
Changes:
- Refactored restart mechanism to use exit code (EXIT_CODE_RESTART) with process relaunch logic in main.py to prevent deadlocks and console windows
- Improved update check workflow using Qt signals for thread-safe UI updates and accurate last check time tracking
- Fixed linkage settings page blank display issue and enhanced "never checked" display for update checks
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| main.py | Added subprocess import, EXIT_CODE_RESTART handling, cross-platform restart logic, and corrected Sentry initialization |
| app/view/main/window.py | Simplified restart_app to use EXIT_CODE_RESTART exit code instead of spawning process directly |
| app/view/settings/update.py | Added update_check_finished signal for thread-safe UI updates and improved last check time handling |
| app/view/settings/settings.py | Added courseSettingsInterface factory mapping to fix blank page issue |
| app/tools/variable.py | Defined EXIT_CODE_RESTART constant (1000) |
| app/Language/modules/update.py | Added "never_checked" translation entries for Chinese and English |
| CHANGELOG/v2.2.0/CHANGELOG.md | Documented bug fixes for restart, update check time, and linkage settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 过滤掉 --url 等参数 | ||
| filtered_args = [arg for arg in sys.argv if not arg.startswith("--")] |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The restart logic filters out command-line arguments starting with "--" on line 211, but then unconditionally includes filtered_args[1:] implicitly. The first element of sys.argv (sys.argv[0]) is the script/executable name, and should be excluded from filtered_args. Currently, if sys.argv[0] doesn't start with "--", it will be included in filtered_args and passed as an argument to the new process. The filter should exclude sys.argv[0] by using filtered_args = [arg for arg in sys.argv[1:] if not arg.startswith("--")].
| # 过滤掉 --url 等参数 | |
| filtered_args = [arg for arg in sys.argv if not arg.startswith("--")] | |
| # 过滤掉 --url 等参数,并且跳过 sys.argv[0](可执行文件路径) | |
| filtered_args = [arg for arg in sys.argv[1:] if not arg.startswith("--")] |
|
|
||
| # 仅在开发环境(版本号包含 0.0.0)下初始化 Sentry | ||
| if VERSION == "v0.0.0": | ||
| # 仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is incorrect - it states "仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry" (Only initialize Sentry in development environment where version doesn't contain 0.0.0), but the condition if "0.0.0" not in VERSION: actually initializes Sentry in non-development builds (when version doesn't contain "0.0.0"). The comment should say "仅在非开发环境" (Only in non-development environment) or the logic should be inverted to match the comment.
| # 仅在开发环境(版本号不包含 0.0.0)下初始化 Sentry | |
| # 仅在非开发环境(版本号不包含 0.0.0)下初始化 Sentry |
This pull request focuses on improving the application's restart mechanism and the update checking experience, along with several bug fixes and minor enhancements. The main changes include a robust solution for the restart feature to prevent deadlocks and unwanted command line windows, more accurate update check time handling, and improved user feedback during update checks. Additionally, several bug fixes and language improvements are included.
Application Restart Mechanism Improvements:
EXIT_CODE_RESTART) for signaling a restart, moving the actual process relaunch logic tomain.py. This approach ensures only a single instance is running and prevents command line windows from appearing on restart, especially on Windows. [1]], [2]], [3]], [4]], [5]], [6]])main.pythat handles relaunching the application cleanly after receiving the restart exit code, with special handling to avoid console windows on Windows. [1]], [2]])Update Checking and UI Enhancements:
update_check_finished) to ensure UI updates and last check time are handled in the main thread, and accurately reflects the last successful check. [1]], [2]], [3]], [4]], [5]], [6]], [7]])Bug Fixes and Minor Improvements:
Changelog Updates:
修复内容包括:重启异常,联动页面异常,更新时间异常
也许还有,但是我忘了,看上面ai生成的吧