Skip to content

Commit

Permalink
Merge pull request #59 from IvanHanloth/OptimizeConfig
Browse files Browse the repository at this point in the history
优化配置文件读取
  • Loading branch information
IvanHanloth authored Feb 2, 2025
2 parents a58d1ae + 2646bc8 commit 1e7ed4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ Boss-Key
- 无法隐藏部分游戏窗口,可能由于游戏窗口加密导致

## 更新日志
**V2.1.0 (更新于2025/1/17)**
- 修改已在运行时的提醒
- 修复窗口销毁后再打开隐藏失败的问题
- 优化同时运行检测
- 保存新窗口绑定时自动显示已隐藏的窗口

**V2.0.0 (更新于2025/1/5)**
- 重构设置页面
- 新增支持多窗口、多进程隐藏
Expand All @@ -149,7 +155,6 @@ Boss-Key
- 修复单文件版提示无图标的问题

**V1.4.2(更新于2024/11/16)**

- 新增允许2个以上按键的热键
- 新增录制热键功能
- 优化后台适配
Expand Down
12 changes: 7 additions & 5 deletions main/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

class Config:
AppName = "Boss Key"
AppVersion = "v2.0.1.0"
AppReleaseDate = "2025-1-17"
AppVersion = "v2.0.2.0"
AppReleaseDate = "2025-02-02"
AppAuthor = "IvanHanloth"
AppDescription = "老板来了?快用Boss-Key一键隐藏静音当前窗口!上班摸鱼必备神器"
AppDescription = "老板来了?快用Boss-Key老板键一键隐藏静音当前窗口!上班摸鱼必备神器"
AppCopyRight = "Copyright © 2022-2025 Ivan Hanloth All Rights Reserved."
AppWebsite = "https://github.com/IvanHanloth/Boss-Key"
AppLicense = """MIT License
Expand Down Expand Up @@ -71,13 +71,15 @@ def load():
if os.path.exists(os.path.join(os.getcwd(), "config.ini")):
Config.import_from_ini()


if Config.first_start:
Config.save()
return

with open(Config.config_path, 'r', encoding='utf-8') as f:
config = json.load(f)
try:
config = json.load(f)
except:
config = {} # 避免出现配置文件损坏导致程序无法启动

Config.history = config.get("history", [])

Expand Down

0 comments on commit 1e7ed4f

Please sign in to comment.