| use serde::{Deserialize, Serialize}; | |
| use crate::proxy::ProxyConfig; | |
| /// Application configuration | |
| pub struct AppConfig { | |
| pub language: String, | |
| pub theme: String, | |
| pub auto_refresh: bool, | |
| pub refresh_interval: i32, // minutes | |
| pub proxy: ProxyConfig, | |
| } | |
| impl AppConfig { | |
| pub fn new() -> Self { | |
| Self { | |
| language: "zh".to_string(), | |
| theme: "system".to_string(), | |
| auto_refresh: false, | |
| refresh_interval: 15, | |
| proxy: ProxyConfig::default(), | |
| } | |
| } | |
| } | |
| impl Default for AppConfig { | |
| fn default() -> Self { | |
| Self::new() | |
| } | |
| } | |