feat(qconnect): add v2_qconnect_get/set_startup_mode commands
String-typed wire shape for predictable serde behavior across the Tauri invoke boundary. Validates against QconnectStartupMode::from_str. cc
This commit is contained in:
1 file changed
+15
-1
@@ -6,7 +6,8 @@
|
||||
|
||||
use qconnect_app::{
|
||||
evaluate_remote_queue_admission, resolve_handoff_intent, QConnectQueueState,
|
||||
QConnectRendererState, QueueCommandType, RendererReport, RendererReportType,
|
||||
QConnectRendererState, QconnectStartupMode, QueueCommandType, RendererReport,
|
||||
RendererReportType,
|
||||
};
|
||||
use tauri::{AppHandle, Emitter, Manager, State};
|
||||
use uuid::Uuid;
|
||||
@@ -843,6 +844,19 @@ pub async fn v2_qconnect_set_device_name(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn v2_qconnect_get_startup_mode() -> Result<String, RuntimeError> {
|
||||
Ok(super::startup::load_startup_mode().as_str().to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn v2_qconnect_set_startup_mode(mode: String) -> Result<(), RuntimeError> {
|
||||
let parsed = QconnectStartupMode::from_str(&mode)
|
||||
.ok_or_else(|| RuntimeError::Internal(format!("invalid startup mode: {mode}")))?;
|
||||
super::startup::save_startup_mode(parsed);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn v2_get_hostname() -> Result<String, RuntimeError> {
|
||||
Ok(resolve_system_hostname())
|
||||
|
||||
Reference in new issue
Block a user