From 667e14abec011d0d915096b774daf8122382fcfd Mon Sep 17 00:00:00 2001
From: awwaawwa <8493196+awwaawwa@users.noreply.github.com>
Date: Thu, 20 Nov 2025 07:21:37 +0000
Subject: [PATCH] fix config save button
---
pdf2zh_next/gui.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pdf2zh_next/gui.py b/pdf2zh_next/gui.py
index 0f7120eb..af22cc81 100644
--- a/pdf2zh_next/gui.py
+++ b/pdf2zh_next/gui.py
@@ -31,6 +31,7 @@
)
from pdf2zh_next.config.translate_engine_model import TRANSLATION_ENGINE_METADATA
from pdf2zh_next.config.translate_engine_model import TRANSLATION_ENGINE_METADATA_MAP
+from pdf2zh_next.const import DEFAULT_CONFIG_DIR
from pdf2zh_next.const import DEFAULT_CONFIG_FILE
from pdf2zh_next.high_level import TranslationError
from pdf2zh_next.high_level import do_translate_async_stream
@@ -1231,7 +1232,14 @@ def save_config(
assets_dir = current_dir / "assets"
logo_path = assets_dir / "powered_by_siliconflow_light.png"
translation_file_path = current_dir / "gui_translation.yaml"
-config_fake_pdf_path = assets_dir / "config.fake.pdf"
+config_fake_pdf_path = DEFAULT_CONFIG_DIR / "config.fake.pdf"
+
+if not config_fake_pdf_path.exists():
+ with config_fake_pdf_path.open("w") as f:
+ f.write("This is a fake PDF file for configuration saving.")
+ f.flush()
+
+
tech_details_string = f"""
Technical details
- ⭐ Star at GitHub: PDFMathTranslate/PDFMathTranslate-next