(self)
| 14 | """Manages user configuration and settings""" |
| 15 | |
| 16 | def __init__(self): |
| 17 | # 使用绝对路径确保跨平台兼容性 |
| 18 | self.config_dir = Path(__file__).resolve().parent / "config" |
| 19 | self.config_file = self.config_dir / "settings.json" |
| 20 | self.settings = {} |
| 21 | |
| 22 | # Default settings |
| 23 | self.default_settings = { |
| 24 | "language": "zh_CN", |
| 25 | "first_run": True, |
| 26 | "window_geometry": "600x780", # 增加宽度从520到600 |
| 27 | "last_selected_ide": "VS Code", |
| 28 | "show_welcome": True, |
| 29 | "show_about_on_startup": True, |
| 30 | "theme": "default" |
| 31 | } |
| 32 | |
| 33 | # Ensure config directory exists |
| 34 | self._ensure_config_dir() |
| 35 | |
| 36 | # Load existing settings |
| 37 | self._load_settings() |
| 38 | |
| 39 | def _ensure_config_dir(self): |
| 40 | """Ensure config directory exists""" |
nothing calls this directly
no test coverage detected