mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-25 18:58:38 +00:00
feat: use stateless_action macro for wivrn install actions
This commit is contained in:
parent
c07d119541
commit
93f5df9776
1 changed files with 23 additions and 16 deletions
|
@ -11,6 +11,7 @@ use crate::{
|
||||||
downloader::download_file_sync,
|
downloader::download_file_sync,
|
||||||
paths::wivrn_apk_download_path,
|
paths::wivrn_apk_download_path,
|
||||||
profile::{Profile, XRServiceType},
|
profile::{Profile, XRServiceType},
|
||||||
|
stateless_action,
|
||||||
};
|
};
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk4::glib::clone;
|
use gtk4::glib::clone;
|
||||||
|
@ -246,26 +247,32 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
|
|
||||||
let mut actions = RelmActionGroup::<InstallWivrnActionGroup>::new();
|
let mut actions = RelmActionGroup::<InstallWivrnActionGroup>::new();
|
||||||
|
|
||||||
let apk_oculus_action = {
|
stateless_action!(
|
||||||
let oculus_sender = sender.clone();
|
actions,
|
||||||
RelmAction::<WivrnApkStandardAction>::new_stateless(move |_| {
|
WivrnApkStandardAction,
|
||||||
oculus_sender.input(Self::Input::InstallWivrnApk(
|
clone!(
|
||||||
|
#[strong]
|
||||||
|
sender,
|
||||||
|
move |_| {
|
||||||
|
sender.input(Self::Input::InstallWivrnApk(
|
||||||
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-standard-release.apk".into()
|
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-standard-release.apk".into()
|
||||||
));
|
));
|
||||||
})
|
}
|
||||||
};
|
)
|
||||||
|
);
|
||||||
let apk_pico_action = {
|
stateless_action!(
|
||||||
let pico_sender = sender.clone();
|
actions,
|
||||||
RelmAction::<WivrnApkPicoAction>::new_stateless(move |_| {
|
WivrnApkPicoAction,
|
||||||
pico_sender.input(Self::Input::InstallWivrnApk(
|
clone!(
|
||||||
|
#[strong]
|
||||||
|
sender,
|
||||||
|
move |_| {
|
||||||
|
sender.input(Self::Input::InstallWivrnApk(
|
||||||
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-pico-release.apk".into()
|
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-pico-release.apk".into()
|
||||||
));
|
));
|
||||||
})
|
}
|
||||||
};
|
)
|
||||||
|
);
|
||||||
actions.add_action(apk_oculus_action);
|
|
||||||
actions.add_action(apk_pico_action);
|
|
||||||
|
|
||||||
root.insert_action_group(
|
root.insert_action_group(
|
||||||
InstallWivrnActionGroup::NAME,
|
InstallWivrnActionGroup::NAME,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue