diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-03 15:35:46 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-03 15:35:46 +0200 |
| commit | 273915dafd51c0ef7aa1ac3f74cb6192497b9b09 (patch) | |
| tree | 8aa967c54f1088184cb2c32f531f3afbae4efc63 /ui/main_window.py | |
| parent | e28ebf9f0d2aaa9a6819f5a09cac05953080c1e9 (diff) | |
| download | publisher-273915dafd51c0ef7aa1ac3f74cb6192497b9b09.tar.gz publisher-273915dafd51c0ef7aa1ac3f74cb6192497b9b09.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'ui/main_window.py')
| -rw-r--r-- | ui/main_window.py | 7 |
1 files changed, 5 insertions, 2 deletions
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) |
