From 3ebebe015f20ff47fe6a97d82f23461f5594e7dd Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Thu, 28 May 2026 19:34:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(gui):=20=E9=87=8D=E6=9E=84=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E5=AF=B9=E8=AF=9D=E6=A1=86=EF=BC=8C=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20QTabWidget=20=E5=88=86=E9=A1=B5=E5=B1=95=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=8E=E8=AE=B8=E5=8F=AF=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原本的单页文本浏览器替换为 TabWidget,分"关于"和"许可证"两个标签页。 同时优化了信息排版和样式,新增 Selenium 版本展示,移除了 UI 文件中的旧控件。 Co-Authored-By: Claude Opus 4.7 --- src/gui/ALAboutDialog.py | 112 +++++++++++++++++++------- src/gui/resources/ui/ALAboutDialog.ui | 49 +---------- 2 files changed, 82 insertions(+), 79 deletions(-) diff --git a/src/gui/ALAboutDialog.py b/src/gui/ALAboutDialog.py index 94c9c7d..7b0524d 100644 --- a/src/gui/ALAboutDialog.py +++ b/src/gui/ALAboutDialog.py @@ -16,11 +16,16 @@ from PySide6.QtCore import ( from PySide6.QtGui import QIcon from PySide6.QtWidgets import ( QApplication, - QDialog + QDialog, + QTabWidget, + QTextBrowser ) from gui.ALVersionInfo import ( - AL_VERSION, AL_COMMIT_SHA, AL_COMMIT_DATE, AL_BUILD_DATE + AL_VERSION, + AL_COMMIT_SHA, + AL_COMMIT_DATE, + AL_BUILD_DATE ) from gui.resources.ui.Ui_ALAboutDialog import Ui_ALAboutDialog from gui.resources import ALResource @@ -43,12 +48,23 @@ class ALAboutDialog(QDialog, Ui_ALAboutDialog): ): self.LogoIconLabel.setPixmap(QIcon(":/res/icons/AutoLibrary_Logo_64.svg").pixmap(48, 48)) - info_text = self.generateAboutText() - self.AboutInfoBrowser.setHtml(info_text) - browser_font = self.AboutInfoBrowser.font() - browser_font.setFamily("Courier New") - self.AboutInfoBrowser.setFont(browser_font) - self.AboutInfoBrowser.setTextInteractionFlags(Qt.TextBrowserInteraction) + self.TabWidget = QTabWidget() + self.TabWidget.setDocumentMode(True) + AboutBrowser = QTextBrowser() + AboutBrowser.setHtml(self.generateAboutText()) + AboutBrowser.setOpenExternalLinks(True) + AboutBrowser.setLineWrapMode(QTextBrowser.LineWrapMode.NoWrap) + AboutBrowser.setTextInteractionFlags(Qt.TextBrowserInteraction) + BrowserFont = AboutBrowser.font() + BrowserFont.setFamilies(["Courier New", "Consolas", "Menlo", "DejaVu Sans Mono", "monospace"]) + AboutBrowser.setFont(BrowserFont) + self.TabWidget.addTab(AboutBrowser, "关于") + LicenseBrowser = QTextBrowser() + LicenseBrowser.setHtml(self.generateLicenseText()) + LicenseBrowser.setOpenExternalLinks(True) + LicenseBrowser.setTextInteractionFlags(Qt.TextBrowserInteraction) + self.TabWidget.addTab(LicenseBrowser, "许可证") + self.AboutInfoLayout.addWidget(self.TabWidget) def connectSignals( self @@ -61,33 +77,57 @@ class ALAboutDialog(QDialog, Ui_ALAboutDialog): ) -> str: os_info = self.getOSInfo() + run_on = f"{os_info['system']} {os_info['version']} {os_info['architecture']}" + selenium_ver = self.getSeleniumVersion() about_text = f""" -

Version Information:

-Version: {AL_VERSION}
+VERSION: {AL_VERSION}
Commit SHA: {AL_COMMIT_SHA}
Commit date: {AL_COMMIT_DATE}
Build date: {AL_BUILD_DATE}
-Python version: {platform.python_version()}
-Qt version: {self.getQtVersion()}
- -

System Information:

+
+SYSTEM INFORMATION
+Running on: {run_on}
Processor: {platform.processor()}
-Operating system: {os_info['system']}
-System version: {os_info['version']}
-System architecture: {os_info['architecture']}
- -

Project Information:

-License: MIT License
-Project repository: https://www.github.com/KenanZhu/AutoLibrary
-Project website: https://www.autolibrary.kenanzhu.com
- -

Author Information:

-Developer: KenanZhu
-Contact: nanoki_zh@163.com
-GitHub: https://www.github.com/KenanZhu
+
+DEPENDENCIES
+Python: {platform.python_version()}
+Qt(PySide6): {self.getQtVersion()}
+Selenium: {selenium_ver}
+
+PROJECT INFORMATION
+Website: https://www.autolibrary.kenanzhu.com
+Repository: https://www.github.com/KenanZhu/AutoLibrary
+
+AUTHOR
+Developer/Maintainer: KenanZhu
+Contact: nanoki_zh@163.com
+GitHub: https://www.github.com/KenanZhu
""" return about_text + def generateLicenseText( + self + ) -> str: + + return """ +MIT License +

Copyright © 2025 - 2026 KenanZhu

+

Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.

""" + def getOSInfo( self ): @@ -129,13 +169,23 @@ GitHub: 800 - 400 + 600 @@ -103,53 +103,6 @@ 0 - - - - - 56 - 0 - - - - - 56 - 16777215 - - - - QFrame::Shape::NoFrame - - - QFrame::Shadow::Plain - - - 0 - - - - - - - QFrame::Shadow::Plain - - - Qt::ScrollBarPolicy::ScrollBarAlwaysOff - - - Qt::ScrollBarPolicy::ScrollBarAlwaysOff - - - QTextEdit::LineWrapMode::NoWrap - - - true - - - true - - -