Add help utilities and executable version metadata

This commit is contained in:
2026-06-29 16:01:23 +08:00
parent 4545092927
commit 81dcd0ccf2
6 changed files with 74 additions and 10 deletions
+3
View File
@@ -52,6 +52,9 @@ PDFReaderLite 是一个面向 Windows 的轻量 PDF 阅读与编辑工具,目
- 启动时恢复上次文件提示 - 启动时恢复上次文件提示
- 清空最近文件 - 清空最近文件
- 关于窗口 - 关于窗口
- 快捷键说明
- 打开日志目录
- exe 版本资源
- 图片签名 - 图片签名
- 深色模式 - 深色模式
- 常用快捷键 - 常用快捷键
+3 -3
View File
@@ -64,13 +64,13 @@ PDFReaderLite 是 Windows 平台的轻量 PDF 阅读与编辑工具。功能重
- 大文件性能优化 - 大文件性能优化
- 页面缓存(已完成基础缓存) - 页面缓存(已完成基础缓存)
- 后台渲染(已完成缩略图分批加载) - 后台渲染(已完成缩略图分批加载)
- 快捷键(已完成常用快捷键) - 快捷键(已完成常用快捷键与说明)
- 配置保存(已完成窗口状态、主题、最近文件) - 配置保存(已完成窗口状态、主题、最近文件)
- 异常恢复(已完成异常日志与上次文件恢复提示) - 异常恢复(已完成异常日志、日志目录入口与上次文件恢复提示)
- PyInstaller 打包(已完成) - PyInstaller 打包(已完成)
- 单文件 exe(已完成) - 单文件 exe(已完成)
- 程序图标(已完成) - 程序图标(已完成)
- 版本号(已完成) - 版本号(已完成应用版本与 exe 版本资源)
## 不纳入范围 ## 不纳入范围
+1
View File
@@ -39,5 +39,6 @@ exe = EXE(
target_arch=None, target_arch=None,
codesign_identity=None, codesign_identity=None,
entitlements_file=None, entitlements_file=None,
version=str(project_root / "packaging" / "version_info.txt"),
icon=str(project_root / "resources" / "icons" / "icon_software_multisize.ico"), icon=str(project_root / "resources" / "icons" / "icon_software_multisize.ico"),
) )
+30
View File
@@ -0,0 +1,30 @@
# UTF-8
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(0, 2, 1, 0),
prodvers=(0, 2, 1, 0),
mask=0x3f,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0, 0),
),
kids=[
StringFileInfo([
StringTable(
"080404b0",
[
StringStruct("CompanyName", "PDFReaderLite"),
StringStruct("FileDescription", "PDFReaderLite"),
StringStruct("FileVersion", "0.2.1"),
StringStruct("InternalName", "PDFReaderLite"),
StringStruct("OriginalFilename", "PDFReaderLite.exe"),
StringStruct("ProductName", "PDFReaderLite"),
StringStruct("ProductVersion", "0.2.1"),
],
)
]),
VarFileInfo([VarStruct("Translation", [2052, 1200])]),
],
)
+1 -1
View File
@@ -1 +1 @@
__version__ = "0.2.0" __version__ = "0.2.1"
+36 -6
View File
@@ -2,8 +2,8 @@ from __future__ import annotations
from pathlib import Path from pathlib import Path
from PySide6.QtCore import QSettings, QStandardPaths, Qt from PySide6.QtCore import QSettings, QStandardPaths, Qt, QUrl
from PySide6.QtGui import QAction, QIcon, QKeySequence, QPainter from PySide6.QtGui import QAction, QDesktopServices, QIcon, QKeySequence, QPainter
from PySide6.QtPrintSupport import QPrintDialog, QPrinter from PySide6.QtPrintSupport import QPrintDialog, QPrinter
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QCheckBox, QCheckBox,
@@ -760,7 +760,11 @@ class MainWindow(QMainWindow):
edit_menu.addAction(self.cover_action) edit_menu.addAction(self.cover_action)
help_menu = self.menuBar().addMenu("帮助") help_menu = self.menuBar().addMenu("帮助")
self.shortcuts_action = QAction("快捷键", self)
self.open_log_dir_action = QAction("打开日志目录", self)
self.about_action = QAction("关于", self) self.about_action = QAction("关于", self)
help_menu.addAction(self.shortcuts_action)
help_menu.addAction(self.open_log_dir_action)
help_menu.addAction(self.about_action) help_menu.addAction(self.about_action)
def _build_toolbar(self) -> None: def _build_toolbar(self) -> None:
@@ -810,6 +814,8 @@ class MainWindow(QMainWindow):
self.remove_password_action.triggered.connect(self.remove_password_file) self.remove_password_action.triggered.connect(self.remove_password_file)
self.print_action.triggered.connect(self.print_document) self.print_action.triggered.connect(self.print_document)
self.clear_recent_action.triggered.connect(self.clear_recent_files) self.clear_recent_action.triggered.connect(self.clear_recent_files)
self.shortcuts_action.triggered.connect(self.show_shortcuts)
self.open_log_dir_action.triggered.connect(self.open_log_dir)
self.about_action.triggered.connect(self.show_about) self.about_action.triggered.connect(self.show_about)
self.undo_action.triggered.connect(self.undo) self.undo_action.triggered.connect(self.undo)
self.redo_action.triggered.connect(self.redo) self.redo_action.triggered.connect(self.redo)
@@ -1105,17 +1111,41 @@ class MainWindow(QMainWindow):
if window_state: if window_state:
self.restoreState(window_state) self.restoreState(window_state)
def show_about(self) -> None: def log_dir(self) -> Path:
log_dir = Path( return Path(QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppDataLocation))
QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppDataLocation)
def open_log_dir(self) -> None:
log_dir = self.log_dir()
log_dir.mkdir(parents=True, exist_ok=True)
QDesktopServices.openUrl(QUrl.fromLocalFile(str(log_dir)))
def show_shortcuts(self) -> None:
QMessageBox.information(
self,
"快捷键",
"打开:Ctrl+O\n"
"保存:Ctrl+S\n"
"另存为:Ctrl+Shift+S\n"
"打印:Ctrl+P\n"
"撤销:Ctrl+Z\n"
"重做:Ctrl+Y\n"
"上一页:Page Up\n"
"下一页:Page Down\n"
"放大:Ctrl++\n"
"缩小:Ctrl+-\n"
"跳转页码:Ctrl+G\n"
"高亮:Ctrl+H\n"
"文档信息:Ctrl+I",
) )
def show_about(self) -> None:
QMessageBox.information( QMessageBox.information(
self, self,
"关于 PDFReaderLite", "关于 PDFReaderLite",
"PDFReaderLite\n\n" "PDFReaderLite\n\n"
f"版本:{__version__}\n" f"版本:{__version__}\n"
"定位:轻量 PDF 阅读与编辑工具\n\n" "定位:轻量 PDF 阅读与编辑工具\n\n"
f"日志目录:{log_dir}", f"日志目录:{self.log_dir()}",
) )
def _update_title(self) -> None: def _update_title(self) -> None: