feat: add inputs clearing in environment/sandbox settings

closes 
This commit is contained in:
Observer KRypt0n_ 2023-04-17 11:49:32 +02:00
parent dc8377c94d
commit addb71305f
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 12 additions and 4 deletions

8
Cargo.lock generated
View file

@ -40,8 +40,8 @@ dependencies = [
[[package]]
name = "anime-game-core"
version = "1.7.0"
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.7.0#290cc5ff9399f68799e8e00fd3f78fa26d076296"
version = "1.7.1"
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.7.1#8978728ce5d94aec5c6aecfe470e45fc43d5b522"
dependencies = [
"anyhow",
"bzip2",
@ -87,8 +87,8 @@ dependencies = [
[[package]]
name = "anime-launcher-sdk"
version = "1.0.2"
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.2#979ca46f5b4ba8961b0effa4e35ba8f8069c9607"
version = "1.0.4"
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.4#5d4e541db4b9e56cf128243a8b19f675adcbc26d"
dependencies = [
"anime-game-core",
"anyhow",

View file

@ -172,6 +172,9 @@ impl SimpleAsyncComponent for EnvironmentApp {
let value = self.value_entry.text().trim().to_string();
if !name.is_empty() && !value.is_empty() {
self.name_entry.set_text("");
self.value_entry.set_text("");
config.game.environment.insert(name.clone(), value.clone());
Config::update(config);

View file

@ -329,6 +329,8 @@ impl SimpleAsyncComponent for SandboxApp {
let path = self.private_path_entry.text().trim().to_string();
if !path.is_empty() {
self.private_path_entry.set_text("");
config.sandbox.private.push(path.clone());
Config::update(config);
@ -358,6 +360,9 @@ impl SimpleAsyncComponent for SandboxApp {
let read_only = self.read_only_switch.state();
if !from.is_empty() && !to.is_empty() {
self.shared_path_from_entry.set_text("");
self.shared_path_to_entry.set_text("");
if read_only {
config.sandbox.mounts.read_only.insert(from.clone(), to.clone());
} else {