diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index bcac44b..3d12ef3 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 5fa6c00..9010974 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,7 +1,9 @@ +#![windows_subsystem = "windows"] + use rodio::Source; -use std::vec; -use tauri::Manager; +use std::{fs, vec}; +use tauri::{Manager, State, WindowEvent}; mod editor_commands; mod squarewave; @@ -22,6 +24,20 @@ use crate::umpk80_commands::{ fn main() { tauri::Builder::default() + .enable_macos_default_menu(false) + .on_window_event(move |event| match event.event() { + WindowEvent::Destroyed => { + let mut am: State = event.window().state(); + + let path = { + let state = am.0.lock().unwrap(); + state.path().to_owned() + }; + + fs::remove_dir_all(path).unwrap(); + } + _ => { } + }) .manage(TempDirState::new()) .manage(Umpk80State::new()) .invoke_handler(tauri::generate_handler![ @@ -49,4 +65,4 @@ fn main() { ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); -} +} \ No newline at end of file diff --git a/src-tauri/src/translator_commands.rs b/src-tauri/src/translator_commands.rs index 27e1112..0339037 100644 --- a/src-tauri/src/translator_commands.rs +++ b/src-tauri/src/translator_commands.rs @@ -1,5 +1,5 @@ use std::path::Path; -use std::sync::{Arc, Mutex}; +use std::sync::{Arc, Mutex, MutexGuard}; use serde::{Deserialize, Serialize}; use tauri::State; diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2c7dfc1..a9b3968 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "UMPK-80-IDE", - "version": "0.1.0" + "version": "1.0.0" }, "tauri": { "allowlist": {