mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-25 19:55:41 +00:00
feat: make wivrn install box async component
This commit is contained in:
parent
6ff4bc2cd5
commit
9790844ee3
2 changed files with 14 additions and 8 deletions
|
@ -52,11 +52,12 @@ pub struct InstallWivrnBoxInit {
|
||||||
pub root_win: gtk::Window,
|
pub root_win: gtk::Window,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[relm4::component(pub)]
|
#[relm4::component(pub async)]
|
||||||
impl SimpleComponent for InstallWivrnBox {
|
impl AsyncComponent for InstallWivrnBox {
|
||||||
type Init = InstallWivrnBoxInit;
|
type Init = InstallWivrnBoxInit;
|
||||||
type Input = InstallWivrnBoxMsg;
|
type Input = InstallWivrnBoxMsg;
|
||||||
type Output = ();
|
type Output = ();
|
||||||
|
type CommandOutput = ();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
gtk::Box {
|
gtk::Box {
|
||||||
|
@ -121,7 +122,12 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>) {
|
async fn update(
|
||||||
|
&mut self,
|
||||||
|
message: Self::Input,
|
||||||
|
sender: AsyncComponentSender<Self>,
|
||||||
|
_root: &Self::Root,
|
||||||
|
) {
|
||||||
self.reset();
|
self.reset();
|
||||||
|
|
||||||
match message {
|
match message {
|
||||||
|
@ -218,11 +224,11 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init(
|
async fn init(
|
||||||
init: Self::Init,
|
init: Self::Init,
|
||||||
root: Self::Root,
|
root: Self::Root,
|
||||||
sender: ComponentSender<Self>,
|
sender: AsyncComponentSender<Self>,
|
||||||
) -> ComponentParts<Self> {
|
) -> AsyncComponentParts<Self> {
|
||||||
let model = Self {
|
let model = Self {
|
||||||
selected_profile: init.selected_profile,
|
selected_profile: init.selected_profile,
|
||||||
install_wivrn_status: InstallWivrnStatus::Done(None),
|
install_wivrn_status: InstallWivrnStatus::Done(None),
|
||||||
|
@ -234,7 +240,7 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
|
|
||||||
let widgets = view_output!();
|
let widgets = view_output!();
|
||||||
|
|
||||||
ComponentParts { model, widgets }
|
AsyncComponentParts { model, widgets }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub struct MainView {
|
||||||
#[tracker::do_not_track]
|
#[tracker::do_not_track]
|
||||||
profiles_dropdown: Option<gtk::DropDown>,
|
profiles_dropdown: Option<gtk::DropDown>,
|
||||||
#[tracker::do_not_track]
|
#[tracker::do_not_track]
|
||||||
install_wivrn_box: Controller<InstallWivrnBox>,
|
install_wivrn_box: AsyncController<InstallWivrnBox>,
|
||||||
#[tracker::do_not_track]
|
#[tracker::do_not_track]
|
||||||
steam_launch_options_box: Controller<SteamLaunchOptionsBox>,
|
steam_launch_options_box: Controller<SteamLaunchOptionsBox>,
|
||||||
#[tracker::do_not_track]
|
#[tracker::do_not_track]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue