Save configuration to file.
(self)
| 143 | return DEFAULT_CONFIG.copy() |
| 144 | |
| 145 | def _save_config(self): |
| 146 | """Save configuration to file.""" |
| 147 | try: |
| 148 | config = { |
| 149 | "fastapi_port": int(self.fastapi_port.get() or 2048), |
| 150 | "stream_port": int(self.stream_port.get() or 3120), |
| 151 | "proxy_address": self.proxy_address.get(), |
| 152 | "proxy_enabled": self.proxy_enabled.get(), |
| 153 | "last_account": self.selected_account.get(), |
| 154 | "appearance_mode": get_appearance_mode(), |
| 155 | "minimize_to_tray": True, |
| 156 | "language": get_language(), |
| 157 | } |
| 158 | with open(CONFIG_FILE, "w", encoding="utf-8") as f: |
| 159 | json.dump(config, f, indent=2, ensure_ascii=False) |
| 160 | except Exception as e: |
| 161 | self._log(get_text("log_config_save_error", error=str(e))) |
| 162 | |
| 163 | def _bind_shortcuts(self): |
| 164 | """Bind keyboard shortcuts.""" |
no test coverage detected