diff --git a/Cargo.lock b/Cargo.lock index 512b138..92cb0dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,8 +87,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.0.5" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.5#3505a2ef55fc89fb09d7a75849b6ce38c713973a" +version = "1.0.6" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.0.6#2a8272c1afdd006925c150ac480a82be645f4b52" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 452d0e2..9247270 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ glib-build-tools = "0.17" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.0.5" +tag = "1.0.6" features = ["all", "genshin"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/assets/locales/de/errors.ftl b/assets/locales/de/errors.ftl index 7644b57..89ae284 100644 --- a/assets/locales/de/errors.ftl +++ b/assets/locales/de/errors.ftl @@ -37,6 +37,11 @@ dxvk-unpack-error = Entpacken von DXVK fehlgeschlagen dxvk-apply-error = DXVK konnte nicht angewendet werden downloaded-wine-list-failed = Auflistung der heruntergeladenen Wine versionen fehlgeschlagen + patch-sync-failed = Synchronisierung des Patch-Ordners fehlgeschlagen patch-state-check-failed = Status des Patchordners konnte nicht überprüft werden game-patching-error = Spiel konnte nicht gepatcht werden + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/de/sandbox.ftl b/assets/locales/de/sandbox.ftl index 4d09ae6..de61f49 100644 --- a/assets/locales/de/sandbox.ftl +++ b/assets/locales/de/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Hide home directory hide-home-directory-description = Isolate your /home, /var/home/$USER, and $HOME folders from the game hostname = Hostname +additional-arguments = Additional arguments private-directories = Private directories private-directories-description = These folders will be replaced by an empty virtual filesystem (tmpfs), and their original content will not be available to sandboxed game @@ -22,3 +23,6 @@ new-path = New path read-only = Read-only read-only-description = Forbid game to write any data to this directory + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/assets/locales/en/errors.ftl b/assets/locales/en/errors.ftl index 8271f84..f790d04 100644 --- a/assets/locales/en/errors.ftl +++ b/assets/locales/en/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = Failed to list downloaded wine versions patch-sync-failed = Failed to sync patch folder patch-state-check-failed = Failed to check patch folder state game-patching-error = Failed to patch game + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/en/sandbox.ftl b/assets/locales/en/sandbox.ftl index 4d09ae6..de61f49 100644 --- a/assets/locales/en/sandbox.ftl +++ b/assets/locales/en/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Hide home directory hide-home-directory-description = Isolate your /home, /var/home/$USER, and $HOME folders from the game hostname = Hostname +additional-arguments = Additional arguments private-directories = Private directories private-directories-description = These folders will be replaced by an empty virtual filesystem (tmpfs), and their original content will not be available to sandboxed game @@ -22,3 +23,6 @@ new-path = New path read-only = Read-only read-only-description = Forbid game to write any data to this directory + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/assets/locales/es/errors.ftl b/assets/locales/es/errors.ftl index 97a76a8..a8369ba 100755 --- a/assets/locales/es/errors.ftl +++ b/assets/locales/es/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = Fallo al listar versiones descargadas de Wine patch-sync-failed = Fallo al sincronizar carpeta del parche patch-state-check-failed = Fallo al comprobar estado de carpeta del parche game-patching-error = Fallo al parchear el juego + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/es/sandbox.ftl b/assets/locales/es/sandbox.ftl index af5cb73..e6a241e 100644 --- a/assets/locales/es/sandbox.ftl +++ b/assets/locales/es/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Esconder el directorio home hide-home-directory-description = Aisla las carpetas /home, /var/home/$USER, y $HOME del juego hostname = Nombre del host +additional-arguments = Additional arguments private-directories = Directorios privados private-directories-description = Estas carpetas serán reemplazadas por un sistema de archivos virtual (tmpfs) vacío, y su contenido real no será accesible al juego aislado @@ -22,3 +23,6 @@ new-path = Nueva ruta read-only = Sólo lectura read-only-description = Le prohibe al juego escribir datos en este directorio + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/assets/locales/fr/errors.ftl b/assets/locales/fr/errors.ftl index a1fda2e..0e4ac5d 100644 --- a/assets/locales/fr/errors.ftl +++ b/assets/locales/fr/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = Impossible de lister les versions de wine téléch patch-sync-failed = Impossible de synchroniser le patch patch-state-check-failed = Impossible de déterminer l'état du patch game-patching-error = Le patch du jeu a échoué + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/fr/sandbox.ftl b/assets/locales/fr/sandbox.ftl index 4d09ae6..de61f49 100644 --- a/assets/locales/fr/sandbox.ftl +++ b/assets/locales/fr/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Hide home directory hide-home-directory-description = Isolate your /home, /var/home/$USER, and $HOME folders from the game hostname = Hostname +additional-arguments = Additional arguments private-directories = Private directories private-directories-description = These folders will be replaced by an empty virtual filesystem (tmpfs), and their original content will not be available to sandboxed game @@ -22,3 +23,6 @@ new-path = New path read-only = Read-only read-only-description = Forbid game to write any data to this directory + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/assets/locales/ru/errors.ftl b/assets/locales/ru/errors.ftl index bc6731a..7f144ca 100644 --- a/assets/locales/ru/errors.ftl +++ b/assets/locales/ru/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = Не удалось получить список patch-sync-failed = Ошибка синхронизации папки патча patch-state-check-failed = Ошибка проверки статуса папки патча game-patching-error = Не удалось установить патч игры + +# Sandbox + +documentation-url-open-failed = Не удалось открыть ссылку с документацией diff --git a/assets/locales/ru/sandbox.ftl b/assets/locales/ru/sandbox.ftl index a0ab2be..33151d3 100644 --- a/assets/locales/ru/sandbox.ftl +++ b/assets/locales/ru/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Скрыть домашнюю директорию hide-home-directory-description = Изолировать ваши директории /home, /var/home/$USER, и $HOME от игры hostname = Имя хоста +additional-arguments = Дополнительные аргументы private-directories = Приватные директории private-directories-description = Эти папки будут заменены пустой виртуальной файловой системой (tmpfs) и их изначальное содержимое не будет доступно игре @@ -22,3 +23,6 @@ new-path = Путь в песочнице read-only = Только для чтения read-only-description = Запретить игре изменять содержимое этой директории + +symlinks = Ссылки +symlinks-description = Добавить ссылку на оригинальный файл или папку в вашу песочницу diff --git a/assets/locales/tr/errors.ftl b/assets/locales/tr/errors.ftl index de9bf31..6a66ead 100644 --- a/assets/locales/tr/errors.ftl +++ b/assets/locales/tr/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = İndirilmiş Wine versiyonlarını listeleme başa patch-sync-failed = Yama dosyalarını senkronize etme başarısız oldu patch-state-check-failed = Yama dosyalarının durumunu kontrol etme başarısız oldu game-patching-error = Yamayı uygulamada sorun çıktı + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/tr/sandbox.ftl b/assets/locales/tr/sandbox.ftl index 4d09ae6..de61f49 100644 --- a/assets/locales/tr/sandbox.ftl +++ b/assets/locales/tr/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = Hide home directory hide-home-directory-description = Isolate your /home, /var/home/$USER, and $HOME folders from the game hostname = Hostname +additional-arguments = Additional arguments private-directories = Private directories private-directories-description = These folders will be replaced by an empty virtual filesystem (tmpfs), and their original content will not be available to sandboxed game @@ -22,3 +23,6 @@ new-path = New path read-only = Read-only read-only-description = Forbid game to write any data to this directory + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/assets/locales/zh-cn/errors.ftl b/assets/locales/zh-cn/errors.ftl index 448f22b..4026f9b 100644 --- a/assets/locales/zh-cn/errors.ftl +++ b/assets/locales/zh-cn/errors.ftl @@ -41,3 +41,7 @@ downloaded-wine-list-failed = 列举 Wine 版本失败 patch-sync-failed = 同步补丁文件夹失败 patch-state-check-failed = 检查补丁文件夹失败 game-patching-error = 应用游戏补丁失败 + +# Sandbox + +documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/zh-cn/sandbox.ftl b/assets/locales/zh-cn/sandbox.ftl index 57f20e5..11a9617 100644 --- a/assets/locales/zh-cn/sandbox.ftl +++ b/assets/locales/zh-cn/sandbox.ftl @@ -8,6 +8,7 @@ hide-home-directory = 隐藏家目录 hide-home-directory-description = 将 /home、 /var/home/$USER 和 $HOME 目录与游戏隔离 hostname = 主机名 +additional-arguments = Additional arguments private-directories = 隐私目录 private-directories-description = 这些目录将会被空的虚拟文件系统(tmpfs)替代,其中的原始内容不可被沙盒中的游戏访问 @@ -22,3 +23,6 @@ new-path = 新路径 read-only = 只读 read-only-description = 禁止游戏向此目录写入任何数据 + +symlinks = Symlinks +symlinks-description = Symlink original path to the new one inside of your sandbox diff --git a/src/ui/preferences/main.rs b/src/ui/preferences/main.rs index 545ef80..7665219 100644 --- a/src/ui/preferences/main.rs +++ b/src/ui/preferences/main.rs @@ -103,7 +103,7 @@ impl SimpleAsyncComponent for PreferencesApp { sandbox: SandboxApp::builder() .launch(()) - .detach(), + .forward(sender.input_sender(), std::convert::identity), environment: EnvironmentApp::builder() .launch(()) diff --git a/src/ui/preferences/sandbox.rs b/src/ui/preferences/sandbox.rs index a223c59..8283b23 100644 --- a/src/ui/preferences/sandbox.rs +++ b/src/ui/preferences/sandbox.rs @@ -6,6 +6,7 @@ use adw::prelude::*; use anime_launcher_sdk::is_available; +use super::main::PreferencesAppMsg; use crate::i18n::tr; use crate::*; @@ -103,7 +104,7 @@ pub enum SandboxAppMsg { impl SimpleAsyncComponent for SandboxApp { type Init = (); type Input = SandboxAppMsg; - type Output = (); + type Output = PreferencesAppMsg; view! { adw::PreferencesPage { @@ -178,7 +179,7 @@ impl SimpleAsyncComponent for SandboxApp { }, adw::EntryRow { - set_title: "Additional arguments", + set_title: &tr("additional-arguments"), set_text: CONFIG.sandbox.args.as_ref().unwrap_or(&String::new()).trim(), connect_changed => |entry| { @@ -193,6 +194,20 @@ impl SimpleAsyncComponent for SandboxApp { Config::update(config); } + }, + + add_suffix = >k::Button { + set_valign: gtk::Align::Center, + set_icon_name: "dialog-information-symbolic", + + connect_clicked[sender] => move |_| { + if let Err(err) = open::that("https://man.archlinux.org/man/bwrap.1") { + sender.output(PreferencesAppMsg::Toast { + title: tr("documentation-url-open-failed"), + description: Some(err.to_string()) + }).unwrap(); + } + } } } }, @@ -259,8 +274,8 @@ impl SimpleAsyncComponent for SandboxApp { add = shared_paths -> adw::PreferencesGroup {}, add = &adw::PreferencesGroup { - set_title: "Symlinks", - set_description: Some("Symlink original path inside of your sandbox"), + set_title: &tr("symlinks"), + set_description: Some(&tr("symlinks-description")), #[local_ref] symlink_path_from_entry -> adw::EntryRow { @@ -293,7 +308,7 @@ impl SimpleAsyncComponent for SandboxApp { root: Self::Root, sender: AsyncComponentSender, ) -> AsyncComponentParts { - tracing::info!("Initializing environment settings"); + tracing::info!("Initializing sandbox settings"); let mut model = Self { private_paths: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()),