重构完代码结构了

This commit is contained in:
2025-07-26 01:22:52 +08:00
parent 47e0b8419f
commit 501a9ddff4
108 changed files with 224 additions and 2017 deletions

View File

@@ -1,7 +1,9 @@
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QMessageBox
from PyQt5.QtCore import Qt
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtGui import QDesktopServices
from qfluentwidgets import PrimaryPushSettingCard, FluentIcon
from qfluentwidgets import InfoBar, InfoBarPosition
from qfluentwidgets import InfoBar, InfoBarPosition, SubtitleLabel
from .function_fit_interface import FunctionFitInterface
from app.tools.check_update import check_update
@@ -15,11 +17,18 @@ class AboutInterface(QWidget):
layout = QVBoxLayout(self)
layout.setAlignment(Qt.AlignTop)
layout.setContentsMargins(20, 30, 20, 20) # 添加边距
title = SubtitleLabel("MRobot 帮助页面", self)
title.setAlignment(Qt.AlignCenter)
layout.addWidget(title)
# 添加空间隔
layout.addSpacing(10)
card = PrimaryPushSettingCard(
text="检查更新",
icon=FluentIcon.DOWNLOAD,
title="关于",
title="更新",
content=f"MRobot_Toolbox 当前版本:{__version__}",
)
card.clicked.connect(self.on_check_update_clicked)
@@ -29,9 +38,11 @@ class AboutInterface(QWidget):
try:
latest = check_update(__version__)
if latest:
# 直接用浏览器打开下载链接
QDesktopServices.openUrl(QUrl("https://github.com/goldenfishs/MRobot/releases/latest"))
InfoBar.success(
title="发现新版本",
content=f"检测到新版本:{latest}请前往官网或仓库下载更新",
content=f"检测到新版本:{latest}已为你打开下载页面",
parent=self,
position=InfoBarPosition.TOP,
duration=5000