修复:
- 手动点击「检查更新」无视「跳过检查更新」设置:必定输出日志,发现新版本时照常弹窗询问下载(跳过设置只作用于启动时的自动检查)
This commit is contained in:
+5
-5
@@ -1541,7 +1541,7 @@ class SettingsDialog(QDialog):
|
||||
parent._update_done.connect(self._on_check_done)
|
||||
except TypeError:
|
||||
pass # 已连接过,忽略
|
||||
threading.Thread(target=parent._check_update, daemon=True).start()
|
||||
threading.Thread(target=parent._check_update, kwargs={"manual": True}, daemon=True).start()
|
||||
|
||||
def _on_check_done(self):
|
||||
self.lb_hint.setText("检查完成,结果见主界面日志")
|
||||
@@ -2145,14 +2145,14 @@ class MainWindow(QWidget):
|
||||
self.traffic_up.setText(f"↑{_fmt_bytes(up_rate)}/s")
|
||||
self.traffic_down.setText(f"↓{_fmt_bytes(down_rate)}/s")
|
||||
self.traffic_total.setText(_fmt_bytes(up_total + down_total))
|
||||
def _check_update(self):
|
||||
"""后台检查服务器是否有新版本。"""
|
||||
def _check_update(self, manual=False):
|
||||
"""后台检查服务器是否有新版本;manual=True 时无视「跳过检查更新」设置。"""
|
||||
# 先初始化结果,任何路径(含跳过)完成后 _on_update_done 都能安全读取
|
||||
self._latest_version = ""
|
||||
self._download_url = ""
|
||||
try:
|
||||
if _skip_update_check():
|
||||
return # 设置跳过:不检查也不打日志
|
||||
if _skip_update_check() and not manual:
|
||||
return # 设置跳过(仅自动检查):不检查也不打日志
|
||||
import json, urllib.request
|
||||
# 基于 Gitea 仓库 releases API 检查更新;config.json 无 update_url 时用默认地址
|
||||
url = str(_config_val("update_url", "") or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user