Handle folder browse button.
(self, widget)
| 429 | self._model_paths = {m[0]: m[1] for m in models} |
| 430 | |
| 431 | def _on_browse_folder(self, widget): |
| 432 | """Handle folder browse button.""" |
| 433 | import platform |
| 434 | folder_path = self.launcher.models_dir |
| 435 | |
| 436 | if folder_path and not os.path.exists(folder_path): |
| 437 | self._show_status("Models folder does not exist", "error") |
| 438 | return |
| 439 | |
| 440 | if not folder_path: |
| 441 | self._show_status("No models folder set", "error") |
| 442 | return |
| 443 | |
| 444 | try: |
| 445 | if platform.system() == "Windows": |
| 446 | os.startfile(folder_path) |
| 447 | elif platform.system() == "Darwin": |
| 448 | subprocess.run(["open", folder_path], check=True) |
| 449 | else: |
| 450 | subprocess.run(["xdg-open", folder_path], check=True) |
| 451 | except Exception as e: |
| 452 | self._show_status(f"Failed to open folder: {e}", "error") |
| 453 | |
| 454 | def _on_launch_clicked(self, button): |
| 455 | """Handle launch button click.""" |
nothing calls this directly
no test coverage detected