feat: batch and combine Word and PDF exports transactionally

This commit is contained in:
2026-10-29 21:37:30 +08:00
parent 7355cad156
commit 82f5f5a63a
8 changed files with 489 additions and 3 deletions
+3 -1
View File
@@ -93,7 +93,7 @@ class ExportController:
for name in ("top", "bottom", "left", "right"):
self.context.settings.setValue(f"pdf/{name}_margin_mm", getattr(margins, name))
def _start_export_job(self, title, callback, completed=None):
def _start_export_job(self, title, callback, completed=None, outcome=None):
job = ExportJob(callback)
progress = QProgressDialog(title, "取消", 0, 0, self.context.parent)
progress.setWindowTitle("导出文档")
@@ -115,6 +115,8 @@ class ExportController:
self.context.status("已取消导出,原有输出文件保持不变")
if completed:
completed()
if outcome:
outcome(result, error, job.cancel.is_set())
job.signals.finished.connect(finished)
progress.show()
QThreadPool.globalInstance().start(job)