(self)
| 60 | self.setup_actions() |
| 61 | |
| 62 | def do_activate(self): |
| 63 | def on_translator_loading(_win, _pspec): |
| 64 | if self.window and not self.window.translator_loading: |
| 65 | # Remove signal handler |
| 66 | if self._signal_handler: |
| 67 | self.window.disconnect(self._signal_handler) |
| 68 | # Process CLI args |
| 69 | self.process_command_line() |
| 70 | |
| 71 | self.window = self.props.active_window # type: ignore |
| 72 | |
| 73 | if not self.window: |
| 74 | width, height = Settings.get().window_size |
| 75 | self.window = DialectWindow( |
| 76 | application=self, |
| 77 | # Translators: Do not translate the app name! |
| 78 | title=_("Dialect"), |
| 79 | default_height=height, |
| 80 | default_width=width, |
| 81 | ) |
| 82 | |
| 83 | # Decide when to process command line args |
| 84 | if self.window.translator_loading: |
| 85 | # Wait until translator is loaded |
| 86 | self._signal_handler = self.window.connect("notify::translator-loading", on_translator_loading) |
| 87 | else: |
| 88 | self.process_command_line() |
| 89 | |
| 90 | self.window.present() |
| 91 | |
| 92 | def do_command_line(self, command_line: Gio.ApplicationCommandLine): |
| 93 | options = command_line.get_options_dict() |
nothing calls this directly
no test coverage detected