From 273915dafd51c0ef7aa1ac3f74cb6192497b9b09 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 3 May 2026 15:35:46 +0200 Subject: feat: add typora_args config field for Wayland launch flags Allows passing extra CLI args (e.g. --ozone-platform=wayland) to Typora at launch without baking them into the binary path. Co-Authored-By: Claude Sonnet 4.6 --- ui/main_window.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ui/main_window.py') diff --git a/ui/main_window.py b/ui/main_window.py index cc3326f..b29ff57 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -89,6 +89,7 @@ class MainWindow(QMainWindow): self._translation_view = TranslationView( self.config.transart_script, self.config.typora_bin, + self.config.typora_args, parent=self, ) self._translation_view.push_master.connect(lambda: self._do_git_push("master")) @@ -208,7 +209,8 @@ class MainWindow(QMainWindow): self._stack.setCurrentIndex(self._page_detail) def _do_open_typora(self, article: Article): - subprocess.Popen([self.config.typora_bin, str(article.path)]) + _args = self.config.typora_args.split() if self.config.typora_args else [] + subprocess.Popen([self.config.typora_bin, *_args, str(article.path)]) def _do_open_frontmatter(self, article: Article): from ui.frontmatter_editor import FrontmatterEditor @@ -221,7 +223,8 @@ class MainWindow(QMainWindow): dlg = NewArticleDialog(Path(self.config.blog_repo), self) if dlg.exec() and dlg.created_path: self._refresh_articles() - subprocess.Popen([self.config.typora_bin, str(dlg.created_path)]) + _args = self.config.typora_args.split() if self.config.typora_args else [] + subprocess.Popen([self.config.typora_bin, *_args, str(dlg.created_path)]) def _do_translate(self, article: Article): self._translation_view.start_translation(article) -- cgit v1.2.3