settings page, reveal in explorer
This commit is contained in:
@@ -229,6 +229,16 @@ pub struct ExportResult {
|
||||
pub size_bytes: u64,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn reveal_in_explorer(path: String) -> Result<(), String> {
|
||||
use std::process::Command;
|
||||
Command::new("explorer.exe")
|
||||
.arg(format!("/select,{path}"))
|
||||
.spawn()
|
||||
.map_err(|e| format!("opening explorer: {e}"))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn export(state: State<'_, AppState>, request: ExportRequest) -> Result<ExportResult, String> {
|
||||
let cfg = state.config.lock().expect("config mutex").clone();
|
||||
@@ -310,6 +320,7 @@ pub fn run() {
|
||||
start_capture,
|
||||
stop_capture,
|
||||
export,
|
||||
reveal_in_explorer,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running ByteSize")
|
||||
|
||||
Reference in New Issue
Block a user