release: prepare 0.4.0 installer and finalize content protection checks
This commit is contained in:
@@ -75,17 +75,18 @@ class BatchExportDialog(QDialog):
|
||||
if settings is None: return
|
||||
suffix = self.format.currentData()
|
||||
if self.combined.isChecked():
|
||||
filename, _ = QFileDialog.getSaveFileName(self, "合并导出", str(self.window.project_root / f"合并文档.{suffix}"), f"{suffix.upper()} (*.{suffix})")
|
||||
filename, _ = QFileDialog.getSaveFileName(self, "合并导出", str(self.window.project_root / f"合并文档.{suffix}"),
|
||||
f"{suffix.upper()} (*.{suffix})", options=QFileDialog.Option.DontConfirmOverwrite)
|
||||
if not filename: return
|
||||
destinations = [Path(filename).with_suffix('.' + suffix)]
|
||||
else:
|
||||
folder = QFileDialog.getExistingDirectory(self, "选择批量导出文件夹")
|
||||
if not folder: return
|
||||
destinations = [Path(folder) / f"{index:03d}-{path.stem}.{suffix}" for index, path in enumerate(paths, 1)]
|
||||
existing = [p.name for p in destinations if p.exists()]
|
||||
if existing and QMessageBox.question(self, "替换已有导出文件?", '\n'.join(existing),
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, QMessageBox.StandardButton.No) != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
existing = [str(p) for p in destinations if p.exists()]
|
||||
if existing and QMessageBox.question(self, "替换已有导出文件?", '\n'.join(existing),
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, QMessageBox.StandardButton.No) != QMessageBox.StandardButton.Yes:
|
||||
return
|
||||
try:
|
||||
buffers = self.window._editor_sources()
|
||||
documents = [BatchDocument(path, buffers[path] if path in buffers else path.read_text(encoding='utf-8-sig')) for path in paths]
|
||||
|
||||
Reference in New Issue
Block a user