feat: batch and combine Word and PDF exports transactionally
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user