Chores customize install #23
@@ -55,7 +55,7 @@ pub struct StartRecordingArgs {
|
||||
// `settings.json` per `docs/03-data-model.md`; meeting rows/files go through
|
||||
// `AppState.store` (Phase 2, `storage::SqliteStore`).
|
||||
|
||||
fn default_settings() -> Settings {
|
||||
pub(crate) fn default_settings() -> Settings {
|
||||
Settings {
|
||||
theme: "system".into(),
|
||||
storage_root: wa_root().display().to_string(),
|
||||
@@ -87,6 +87,7 @@ fn default_settings() -> Settings {
|
||||
mcp_port: 4849,
|
||||
mcp_expose: "none".into(),
|
||||
mcp_expose_recordings: false,
|
||||
auto_start: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ pub(crate) fn load_settings() -> Settings {
|
||||
.unwrap_or_else(default_settings)
|
||||
}
|
||||
|
||||
fn save_settings(settings: &Settings) -> Result<(), WaError> {
|
||||
pub(crate) fn save_settings(settings: &Settings) -> Result<(), WaError> {
|
||||
let path = settings_path();
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent).map_err(|e| WaError::new("settings", e.to_string()))?;
|
||||
@@ -1444,6 +1445,26 @@ pub async fn set_preferred_backend(args: SetPreferredBackendArgs) -> WaResult<()
|
||||
save_settings(&settings)
|
||||
}
|
||||
|
||||
/// Enable/disable launch-at-login (NFR-RES-4). Writes a per-user `HKCU\...\Run`
|
||||
/// entry via `tauri-plugin-autostart` (no admin) and persists the choice so the
|
||||
/// startup reconcile in `lib.rs` keeps the OS entry in sync after a reinstall.
|
||||
/// Opt-in only: nothing calls this unless the user toggles it (or an enterprise
|
||||
/// deploy file set `auto_start=true`).
|
||||
#[tauri::command]
|
||||
pub async fn set_auto_start(app: AppHandle, enabled: bool) -> WaResult<()> {
|
||||
use tauri_plugin_autostart::ManagerExt;
|
||||
let manager = app.autolaunch();
|
||||
let res = if enabled {
|
||||
manager.enable()
|
||||
} else {
|
||||
manager.disable()
|
||||
};
|
||||
res.map_err(|e| WaError::new("autostart", e.to_string()))?;
|
||||
let mut settings = load_settings();
|
||||
settings.auto_start = enabled;
|
||||
save_settings(&settings)
|
||||
}
|
||||
|
||||
/// True when the NPU ONNX Whisper model is downloaded (false on non-NPU builds).
|
||||
fn npu_model_installed() -> bool {
|
||||
#[cfg(feature = "npu")]
|
||||
|
||||
Reference in New Issue
Block a user