mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-26 12:15:42 +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,
|
||||
}
|
||||
|
||||
#[relm4::component(pub)]
|
||||
impl SimpleComponent for InstallWivrnBox {
|
||||
#[relm4::component(pub async)]
|
||||
impl AsyncComponent for InstallWivrnBox {
|
||||
type Init = InstallWivrnBoxInit;
|
||||
type Input = InstallWivrnBoxMsg;
|
||||
type Output = ();
|
||||
type CommandOutput = ();
|
||||
|
||||
view! {
|
||||
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();
|
||||
|
||||
match message {
|
||||
|
@ -218,11 +224,11 @@ impl SimpleComponent for InstallWivrnBox {
|
|||
}
|
||||
}
|
||||
|
||||
fn init(
|
||||
async fn init(
|
||||
init: Self::Init,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
sender: AsyncComponentSender<Self>,
|
||||
) -> AsyncComponentParts<Self> {
|
||||
let model = Self {
|
||||
selected_profile: init.selected_profile,
|
||||
install_wivrn_status: InstallWivrnStatus::Done(None),
|
||||
|
@ -234,7 +240,7 @@ impl SimpleComponent for InstallWivrnBox {
|
|||
|
||||
let widgets = view_output!();
|
||||
|
||||
ComponentParts { model, widgets }
|
||||
AsyncComponentParts { model, widgets }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ pub struct MainView {
|
|||
#[tracker::do_not_track]
|
||||
profiles_dropdown: Option<gtk::DropDown>,
|
||||
#[tracker::do_not_track]
|
||||
install_wivrn_box: Controller<InstallWivrnBox>,
|
||||
install_wivrn_box: AsyncController<InstallWivrnBox>,
|
||||
#[tracker::do_not_track]
|
||||
steam_launch_options_box: Controller<SteamLaunchOptionsBox>,
|
||||
#[tracker::do_not_track]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue