feat(EDID-Viewer): v0.1.0 入库 — Fluent EDID 查看器,目录对齐 DLPilot
- src/ 人写代码:main.py(Fluent 界面、Light/Dark/dark1/dark2/跟随系统主题、 关于按钮;主题三件套 = setTheme + QPalette/应用级 QSS + DWM 标题栏, 修复 Light 下窗口背景/页签/标题栏仍为系统深色的问题)、edid.py (EDID/CTA/HDMI/HDR 解析)、windows_edid.py(WMI 只读)、theme.py、 test_edid.py(9 项解析测试,含随机畸形数据无崩溃检查) - assets/ 图标与生成脚本;release/ 交付:EDID-Viewer.exe(onefile 63.7MB, 启动/图标/主题已验证)+ README,与 DLPilot/release 同约定 exe 直接入库 - 流水线对齐 DLPilot:src/build_exe.py(spec 由脚本生成不入库,剔除 PATH 上 Poppler/Conda 版本化 ICU,避免 QtCore 报 WinError 127)→ package_release.py(组装 EDID-Viewer-v*-win64.zip,zip 只上传 Gitea)→ publish_gitea.py(token 走 GITEA_TOKEN,自签证书 --insecure) - agent.md 更名 AGENTS.md(DLPilot 双文档约定:README 给人 / AGENTS.md 给 Agent);根 .gitignore 增加 EDID-viewer/release/*.zip - validation/ 保留 EDID 本机/合成样本与窗口截图、关于对话框自检脚本
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
"""Headless check for the About button and dialog: saves header and dialog PNGs."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtCore import QTimer
|
||||
from PySide6.QtGui import QFont
|
||||
from PySide6.QtWidgets import QApplication, QMessageBox
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
|
||||
import main as m
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def snap_dialog():
|
||||
boxes = [w for w in QApplication.topLevelWidgets() if isinstance(w, QMessageBox)]
|
||||
if not boxes:
|
||||
QTimer.singleShot(200, snap_dialog)
|
||||
return
|
||||
boxes[0].grab().save(str(OUT / "about-dialog.png"))
|
||||
boxes[0].close()
|
||||
|
||||
|
||||
def open_about(window):
|
||||
QTimer.singleShot(600, lambda: snap_dialog())
|
||||
window.show_about()
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
app.setApplicationName(m.APP_NAME)
|
||||
app.setFont(QFont("Microsoft YaHei UI", 10))
|
||||
theme_manager = m.ThemeManager(app)
|
||||
window = m.Window(theme_manager)
|
||||
window.show()
|
||||
|
||||
def grab_header():
|
||||
window.grab().save(str(OUT / "about-header.png"))
|
||||
open_about(window)
|
||||
|
||||
QTimer.singleShot(1500, grab_header)
|
||||
QTimer.singleShot(6000, app.quit)
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user