build: updated development libraries versions

GTK 4.8 -> 4.12
Libadwaita 1.2 -> 1.3
Relm4 0.6.2 -> 0.7.0-beta.2
This commit is contained in:
Observer KRypt0n_ 2023-11-13 16:42:45 +02:00
parent 5e8db5b3a9
commit e6076ef4a5
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
25 changed files with 622 additions and 516 deletions

864
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -25,11 +25,11 @@ features = ["all", "genshin"]
# path = "../anime-launcher-sdk" # ! for dev purposes only # path = "../anime-launcher-sdk" # ! for dev purposes only
[dependencies] [dependencies]
relm4 = { version = "0.6.0", features = ["macros", "libadwaita"] } relm4 = { version = "0.7.0-beta.2", features = ["macros", "libadwaita"] }
gtk = { package = "gtk4", version = "0.6", features = ["v4_8"] } gtk = { package = "gtk4", version = "0.7.3", features = ["v4_12"] }
adw = { package = "libadwaita", version = "0.4", features = ["v1_2"] } adw = { package = "libadwaita", version = "0.5.3", features = ["v1_3"] }
rfd = { version = "0.12.0", features = ["xdg-portal"], default-features = false } rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false }
open = "5.0.0" open = "5.0.0"
whatadistro = "0.1.0" whatadistro = "0.1.0"
@ -45,4 +45,4 @@ tracing-subscriber = "0.3"
fluent-templates = "0.8" fluent-templates = "0.8"
unic-langid = "0.9" unic-langid = "0.9"
human-panic = "1.2.0" human-panic = "1.2.2"

View file

@ -19,14 +19,15 @@ ru-ru = Русский
de-de = Deutsch de-de = Deutsch
fr-fr = Français fr-fr = Français
es-es = Español es-es = Español
tr-tr = Türkçe pt-br = Português
it-it = Italiano it-it = Italiano
id-id = Indonesia tr-tr = Türkçe
zh-cn = 简体中文 pl-pl = Polski
ja-jp = 日本語
hu-hu = Magyar hu-hu = Magyar
sv-se = Svenska sv-se = Svenska
pt-br = Português
pl-pl = Polski
vi-vn = Tiếng Việt
nl-nl = Nederlands nl-nl = Nederlands
zh-cn = 简体中文
ja-jp = 日本語
ko-kr = 한국어
id-id = Indonesia
vi-vn = Tiếng Việt

View file

@ -113,7 +113,7 @@ impl SimpleComponent for AboutDialog {
connect_close_request[sender] => move |_| { connect_close_request[sender] => move |_| {
sender.input(AboutDialogMsg::Hide); sender.input(AboutDialogMsg::Hide);
gtk::Inhibit(false) gtk::glib::Propagation::Proceed
} }
} }
} }

View file

@ -1,8 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use super::ComponentsListMsg; use super::ComponentsListMsg;

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use super::ComponentGroupMsg; use super::ComponentGroupMsg;

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::anime_game_core::prelude::*; use anime_launcher_sdk::anime_game_core::prelude::*;

View file

@ -1,7 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use gtk::prelude::*; use gtk::prelude::*;
use adw::prelude::*; use adw::prelude::*;

View file

@ -1,8 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use crate::*; use crate::*;
@ -79,13 +77,16 @@ impl SimpleAsyncComponent for DefaultPathsApp {
adw::ActionRow { adw::ActionRow {
set_title: &tr!("launcher-folder"), set_title: &tr!("launcher-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.launcher.to_str().unwrap(), set_subtitle: model.launcher.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Launcher) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Launcher),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
}, },
@ -117,90 +118,114 @@ impl SimpleAsyncComponent for DefaultPathsApp {
adw::ActionRow { adw::ActionRow {
set_title: &tr!("runners-folder"), set_title: &tr!("runners-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.runners.to_str().unwrap(), set_subtitle: model.runners.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Runners) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Runners),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("dxvks-folder"), set_title: &tr!("dxvks-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.dxvks.to_str().unwrap(), set_subtitle: model.dxvks.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::DXVK) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::DXVK),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("wine-prefix-folder"), set_title: &tr!("wine-prefix-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.prefix.to_str().unwrap(), set_subtitle: model.prefix.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Prefix) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Prefix),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("global-game-installation-folder"), set_title: &tr!("global-game-installation-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.game_global.to_str().unwrap(), set_subtitle: model.game_global.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::GameGlobal) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::GameGlobal),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("chinese-game-installation-folder"), set_title: &tr!("chinese-game-installation-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.game_china.to_str().unwrap(), set_subtitle: model.game_china.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::GameChina) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::GameChina),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("fps-unlocker-folder"), set_title: &tr!("fps-unlocker-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.fps_unlocker.to_str().unwrap(), set_subtitle: model.fps_unlocker.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::FpsUnlocker) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::FpsUnlocker),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("components-index"), set_title: &tr!("components-index"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.components.to_str().unwrap(), set_subtitle: model.components.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Components) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Components),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
adw::ActionRow { adw::ActionRow {
set_title: &tr!("temp-folder"), set_title: &tr!("temp-folder"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true, set_activatable: true,
#[watch] #[watch]
set_subtitle: model.temp.to_str().unwrap(), set_subtitle: model.temp.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Temp) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Temp),
add_prefix = &gtk::Image {
set_icon_name: Some("folder-symbolic")
}
}, },
}, },

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::is_available; use anime_launcher_sdk::is_available;

View file

@ -1,8 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::anime_game_core::prelude::*; use anime_launcher_sdk::anime_game_core::prelude::*;
@ -163,11 +161,13 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
#[watch] #[watch]
set_subtitle: &model.downloading_wine_version, set_subtitle: &model.downloading_wine_version,
#[watch] add_prefix = &gtk::Image {
set_icon_name: match model.downloading_wine { #[watch]
Some(true) => Some("emblem-ok-symbolic"), set_icon_name: match model.downloading_wine {
Some(false) => None, // Some("process-working"), Some(true) => Some("emblem-ok-symbolic"),
None => None Some(false) => None, // Some("process-working"),
None => None
}
}, },
add_prefix = &gtk::Spinner { add_prefix = &gtk::Spinner {
@ -184,11 +184,13 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
#[watch] #[watch]
set_subtitle: &model.creating_prefix_path, set_subtitle: &model.creating_prefix_path,
#[watch] add_prefix = &gtk::Image {
set_icon_name: match model.creating_prefix { #[watch]
Some(true) => Some("emblem-ok-symbolic"), set_icon_name: match model.creating_prefix {
Some(false) => None, // Some("process-working"), Some(true) => Some("emblem-ok-symbolic"),
None => None Some(false) => None, // Some("process-working"),
None => None
}
}, },
add_prefix = &gtk::Spinner { add_prefix = &gtk::Spinner {
@ -205,11 +207,13 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
#[watch] #[watch]
set_subtitle: &model.downloading_dxvk_version, set_subtitle: &model.downloading_dxvk_version,
#[watch] add_prefix = &gtk::Image {
set_icon_name: match model.downloading_dxvk { #[watch]
Some(true) => Some("emblem-ok-symbolic"), set_icon_name: match model.downloading_dxvk {
Some(false) => None, // Some("process-working"), Some(true) => Some("emblem-ok-symbolic"),
None => None Some(false) => None, // Some("process-working"),
None => None
}
}, },
add_prefix = &gtk::Spinner { add_prefix = &gtk::Spinner {
@ -223,11 +227,13 @@ impl SimpleAsyncComponent for DownloadComponentsApp {
adw::ActionRow { adw::ActionRow {
set_title: &tr!("apply-dxvk"), set_title: &tr!("apply-dxvk"),
#[watch] add_prefix = &gtk::Image {
set_icon_name: match model.applying_dxvk { #[watch]
Some(true) => Some("emblem-ok-symbolic"), set_icon_name: match model.applying_dxvk {
Some(false) => None, // Some("process-working"), Some(true) => Some("emblem-ok-symbolic"),
None => None Some(false) => None, // Some("process-working"),
None => None
}
}, },
add_prefix = &gtk::Spinner { add_prefix = &gtk::Spinner {

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use crate::*; use crate::*;

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use gtk::prelude::*; use gtk::prelude::*;
use adw::prelude::*; use adw::prelude::*;

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::config::ConfigExt; use anime_launcher_sdk::config::ConfigExt;

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::is_available; use anime_launcher_sdk::is_available;

View file

@ -1,6 +1,5 @@
use relm4::{ use relm4::{
prelude::*, prelude::*,
component::*,
actions::*, actions::*,
MessageBroker MessageBroker
}; };
@ -611,7 +610,7 @@ impl SimpleComponent for App {
}); });
} }
gtk::Inhibit::default() gtk::glib::Propagation::Proceed
} }
} }
} }

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use gtk::prelude::*; use gtk::prelude::*;
use crate::tr; use crate::tr;

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::*; use relm4::factory::*;
use adw::prelude::*; use adw::prelude::*;
@ -20,7 +19,6 @@ impl AsyncFactoryComponent for Variable {
type Input = EnvironmentPageMsg; type Input = EnvironmentPageMsg;
type Output = EnvironmentPageMsg; type Output = EnvironmentPageMsg;
type CommandOutput = (); type CommandOutput = ();
type ParentInput = EnvironmentPageMsg;
type ParentWidget = adw::PreferencesGroup; type ParentWidget = adw::PreferencesGroup;
view! { view! {
@ -34,7 +32,8 @@ impl AsyncFactoryComponent for Variable {
set_valign: gtk::Align::Center, set_valign: gtk::Align::Center,
connect_clicked[sender, index] => move |_| { connect_clicked[sender, index] => move |_| {
sender.output(EnvironmentPageMsg::Remove(index.clone())); sender.output(EnvironmentPageMsg::Remove(index.clone()))
.unwrap();
} }
} }
} }
@ -50,10 +49,6 @@ impl AsyncFactoryComponent for Variable {
value: init.1 value: init.1
} }
} }
fn forward_to_parent(output: Self::Output) -> Option<Self::ParentInput> {
Some(output)
}
} }
pub struct EnvironmentPage { pub struct EnvironmentPage {
@ -164,7 +159,9 @@ impl SimpleAsyncComponent for EnvironmentPage {
tracing::info!("Initializing environment settings"); tracing::info!("Initializing environment settings");
let mut model = Self { let mut model = Self {
variables: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()), variables: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
name_entry: adw::EntryRow::new(), name_entry: adw::EntryRow::new(),
value_entry: adw::EntryRow::new() value_entry: adw::EntryRow::new()

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::*; use relm4::factory::*;
use adw::prelude::*; use adw::prelude::*;
@ -24,7 +23,6 @@ impl AsyncFactoryComponent for GameSession {
type Input = GamePageMsg; type Input = GamePageMsg;
type Output = GamePageMsg; type Output = GamePageMsg;
type CommandOutput = (); type CommandOutput = ();
type ParentInput = GamePageMsg;
type ParentWidget = adw::PreferencesGroup; type ParentWidget = adw::PreferencesGroup;
view! { view! {
@ -48,7 +46,8 @@ impl AsyncFactoryComponent for GameSession {
set_valign: gtk::Align::Center, set_valign: gtk::Align::Center,
connect_clicked[sender, index] => move |_| { connect_clicked[sender, index] => move |_| {
sender.output(GamePageMsg::UpdateSession(index.current_index())); sender.output(GamePageMsg::UpdateSession(index.current_index()))
.unwrap();
} }
}, },
@ -61,14 +60,16 @@ impl AsyncFactoryComponent for GameSession {
set_valign: gtk::Align::Center, set_valign: gtk::Align::Center,
connect_clicked[sender, index] => move |_| { connect_clicked[sender, index] => move |_| {
sender.output(GamePageMsg::RemoveSession(index.current_index())); sender.output(GamePageMsg::RemoveSession(index.current_index()))
.unwrap();
} }
}, },
set_activatable: true, set_activatable: true,
connect_activated[sender, index] => move |_| { connect_activated[sender, index] => move |_| {
sender.output(GamePageMsg::SetCurrent(index.current_index())); sender.output(GamePageMsg::SetCurrent(index.current_index()))
.unwrap();
} }
} }
} }
@ -80,10 +81,6 @@ impl AsyncFactoryComponent for GameSession {
) -> Self { ) -> Self {
init init
} }
fn forward_to_parent(output: Self::Output) -> Option<Self::ParentInput> {
Some(output)
}
} }
pub struct GamePage { pub struct GamePage {
@ -162,7 +159,9 @@ impl SimpleAsyncComponent for GamePage {
tracing::info!("Initializing game settings"); tracing::info!("Initializing game settings");
let mut model = Self { let mut model = Self {
sessions: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()), sessions: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
sessions_root_widget: gtk::CheckButton::new(), sessions_root_widget: gtk::CheckButton::new(),
session_name_entry: adw::EntryRow::new() session_name_entry: adw::EntryRow::new()

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::{ use relm4::factory::{
AsyncFactoryComponent, AsyncFactoryComponent,
@ -45,7 +44,6 @@ impl AsyncFactoryComponent for DiscordRpcIcon {
type Input = EnhancementsAppMsg; type Input = EnhancementsAppMsg;
type Output = EnhancementsAppMsg; type Output = EnhancementsAppMsg;
type CommandOutput = (); type CommandOutput = ();
type ParentInput = EnhancementsAppMsg;
type ParentWidget = adw::ExpanderRow; type ParentWidget = adw::ExpanderRow;
view! { view! {
@ -70,7 +68,8 @@ impl AsyncFactoryComponent for DiscordRpcIcon {
set_activatable: true, set_activatable: true,
connect_activated[sender, index] => move |_| { connect_activated[sender, index] => move |_| {
sender.output(EnhancementsAppMsg::SetDiscordRpcIcon(index.clone())); sender.output(EnhancementsAppMsg::SetDiscordRpcIcon(index.clone()))
.unwrap();
} }
} }
} }
@ -83,11 +82,6 @@ impl AsyncFactoryComponent for DiscordRpcIcon {
) -> Self { ) -> Self {
init init
} }
#[inline]
fn forward_to_parent(output: Self::Output) -> Option<Self::ParentInput> {
Some(output)
}
} }
pub struct EnhancementsApp { pub struct EnhancementsApp {
@ -102,7 +96,7 @@ pub struct EnhancementsApp {
#[derive(Debug)] #[derive(Debug)]
pub enum EnhancementsAppMsg { pub enum EnhancementsAppMsg {
SetGamescopeParent(adw::PreferencesWindow), SetGamescopeParent,
SetDiscordRpcIcon(DynamicIndex), SetDiscordRpcIcon(DynamicIndex),
@ -721,7 +715,10 @@ impl SimpleAsyncComponent for EnhancementsApp {
tracing::info!("Initializing enhancements settings"); tracing::info!("Initializing enhancements settings");
let mut model = Self { let mut model = Self {
discord_rpc_icons: AsyncFactoryVecDeque::new(adw::ExpanderRow::new(), sender.input_sender()), discord_rpc_icons: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
discord_rpc_root_check_button: gtk::CheckButton::new(), discord_rpc_root_check_button: gtk::CheckButton::new(),
gamescope: GamescopeApp::builder() gamescope: GamescopeApp::builder()
@ -792,6 +789,7 @@ impl SimpleAsyncComponent for EnhancementsApp {
model.discord_rpc_icons.guard().push_back(DiscordRpcIcon { model.discord_rpc_icons.guard().push_back(DiscordRpcIcon {
check_button, check_button,
name: icon.name.clone(), name: icon.name.clone(),
path: cache_file.clone() path: cache_file.clone()
}); });
@ -818,8 +816,8 @@ impl SimpleAsyncComponent for EnhancementsApp {
async fn update(&mut self, msg: Self::Input, sender: AsyncComponentSender<Self>) { async fn update(&mut self, msg: Self::Input, sender: AsyncComponentSender<Self>) {
match msg { match msg {
EnhancementsAppMsg::SetGamescopeParent(parent) => { EnhancementsAppMsg::SetGamescopeParent => unsafe {
self.gamescope.widget().set_transient_for(Some(&parent)); self.gamescope.widget().set_transient_for(super::main::PREFERENCES_WINDOW.as_ref());
} }
EnhancementsAppMsg::SetDiscordRpcIcon(index) => { EnhancementsAppMsg::SetDiscordRpcIcon(index) => {

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::*; use relm4::factory::*;
use adw::prelude::*; use adw::prelude::*;
@ -24,7 +23,6 @@ macro_rules! impl_directory {
type Input = SandboxPageMsg; type Input = SandboxPageMsg;
type Output = SandboxPageMsg; type Output = SandboxPageMsg;
type CommandOutput = (); type CommandOutput = ();
type ParentInput = SandboxPageMsg;
type ParentWidget = adw::PreferencesGroup; type ParentWidget = adw::PreferencesGroup;
view! { view! {
@ -41,7 +39,8 @@ macro_rules! impl_directory {
set_valign: gtk::Align::Center, set_valign: gtk::Align::Center,
connect_clicked[sender, index] => move |_| { connect_clicked[sender, index] => move |_| {
sender.output($msg(index.clone())); sender.output($msg(index.clone()))
.unwrap();
} }
} }
} }
@ -57,10 +56,6 @@ macro_rules! impl_directory {
to: init.1 to: init.1
} }
} }
fn forward_to_parent(output: Self::Output) -> Option<Self::ParentInput> {
Some(output)
}
} }
} }
} }
@ -335,9 +330,17 @@ impl SimpleAsyncComponent for SandboxPage {
tracing::info!("Initializing sandbox settings"); tracing::info!("Initializing sandbox settings");
let mut model = Self { let mut model = Self {
private_paths: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()), private_paths: AsyncFactoryVecDeque::builder()
shared_paths: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()), .launch_default()
symlink_paths: AsyncFactoryVecDeque::new(adw::PreferencesGroup::new(), sender.input_sender()), .forward(sender.input_sender(), std::convert::identity),
shared_paths: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
symlink_paths: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
private_path_entry: adw::EntryRow::new(), private_path_entry: adw::EntryRow::new(),

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use adw::prelude::*; use adw::prelude::*;
use anime_launcher_sdk::config::ConfigExt; use anime_launcher_sdk::config::ConfigExt;

View file

@ -1,6 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use gtk::prelude::*; use gtk::prelude::*;
use adw::prelude::*; use adw::prelude::*;

View file

@ -1,5 +1,5 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::{ use relm4::factory::{
AsyncFactoryVecDeque, AsyncFactoryVecDeque,
AsyncFactoryComponent, AsyncFactoryComponent,
@ -41,7 +41,6 @@ impl AsyncFactoryComponent for VoicePackageComponent {
type Input = GeneralAppMsg; type Input = GeneralAppMsg;
type Output = GeneralAppMsg; type Output = GeneralAppMsg;
type CommandOutput = (); type CommandOutput = ();
type ParentInput = GeneralAppMsg;
type ParentWidget = adw::ExpanderRow; type ParentWidget = adw::ExpanderRow;
view! { view! {
@ -97,11 +96,8 @@ impl AsyncFactoryComponent for VoicePackageComponent {
async fn update(&mut self, msg: Self::Input, sender: AsyncFactorySender<Self>) { async fn update(&mut self, msg: Self::Input, sender: AsyncFactorySender<Self>) {
self.installed = !self.installed; self.installed = !self.installed;
sender.output(msg); sender.output(msg)
} .unwrap();
fn forward_to_parent(output: Self::Output) -> Option<Self::ParentInput> {
Some(output)
} }
} }
@ -543,7 +539,9 @@ impl SimpleAsyncComponent for GeneralApp {
tracing::info!("Initializing general settings"); tracing::info!("Initializing general settings");
let mut model = Self { let mut model = Self {
voice_packages: AsyncFactoryVecDeque::new(adw::ExpanderRow::new(), sender.input_sender()), voice_packages: AsyncFactoryVecDeque::builder()
.launch_default()
.forward(sender.input_sender(), std::convert::identity),
migrate_installation: MigrateInstallationApp::builder() migrate_installation: MigrateInstallationApp::builder()
.launch(()) .launch(())
@ -655,7 +653,7 @@ impl SimpleAsyncComponent for GeneralApp {
self.migrate_installation.widget().set_transient_for(Some(window.widget())); self.migrate_installation.widget().set_transient_for(Some(window.widget()));
} }
self.migrate_installation.widget().show(); self.migrate_installation.widget().present();
} }
GeneralAppMsg::RepairGame => { GeneralAppMsg::RepairGame => {

View file

@ -1,5 +1,4 @@
use relm4::prelude::*; use relm4::prelude::*;
use relm4::component::*;
use gtk::prelude::*; use gtk::prelude::*;
use adw::prelude::*; use adw::prelude::*;
@ -64,7 +63,7 @@ impl SimpleAsyncComponent for PreferencesApp {
}); });
} }
gtk::Inhibit::default() gtk::glib::Propagation::Proceed
} }
} }
} }
@ -94,12 +93,10 @@ impl SimpleAsyncComponent for PreferencesApp {
PREFERENCES_WINDOW = Some(widgets.preferences_window.clone()); PREFERENCES_WINDOW = Some(widgets.preferences_window.clone());
} }
#[allow(unused_must_use)] { model.enhancements.emit(EnhancementsAppMsg::SetGamescopeParent);
model.enhancements.sender().send(EnhancementsAppMsg::SetGamescopeParent(widgets.preferences_window.clone()));
model.general.sender().send(GeneralAppMsg::UpdateDownloadedWine); model.general.emit(GeneralAppMsg::UpdateDownloadedWine);
model.general.sender().send(GeneralAppMsg::UpdateDownloadedDxvk); model.general.emit(GeneralAppMsg::UpdateDownloadedDxvk);
}
AsyncComponentParts { model, widgets } AsyncComponentParts { model, widgets }
} }
@ -108,9 +105,8 @@ impl SimpleAsyncComponent for PreferencesApp {
tracing::debug!("Called preferences window event: {:?}", msg); tracing::debug!("Called preferences window event: {:?}", msg);
match msg { match msg {
#[allow(unused_must_use)]
PreferencesAppMsg::SetGameDiff(diff) => { PreferencesAppMsg::SetGameDiff(diff) => {
self.general.sender().send(GeneralAppMsg::SetGameDiff(diff)); self.general.emit(GeneralAppMsg::SetGameDiff(diff));
} }
#[allow(unused_must_use)] #[allow(unused_must_use)]