mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-07 08:38:46 +00:00
fix: missing adb message dialog
This commit is contained in:
parent
5382ff92d2
commit
34385b9611
1 changed files with 11 additions and 9 deletions
|
@ -1,12 +1,14 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
adb::get_adb_install_runner,
|
adb::get_adb_install_runner,
|
||||||
|
depcheck::check_dependency,
|
||||||
|
dependencies::adb_dep::adb_dep,
|
||||||
downloader::download_file,
|
downloader::download_file,
|
||||||
paths::wivrn_apk_download_path,
|
paths::wivrn_apk_download_path,
|
||||||
profile::{Profile, XRServiceType},
|
profile::{Profile, XRServiceType},
|
||||||
runner::{Runner, RunnerStatus}, depcheck::check_dependency, dependencies::adb_dep::adb_dep,
|
runner::{Runner, RunnerStatus},
|
||||||
};
|
};
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use relm4::prelude::*;
|
use relm4::{prelude::*, adw::traits::MessageDialogExt};
|
||||||
use std::thread::JoinHandle;
|
use std::thread::JoinHandle;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||||
|
@ -174,8 +176,7 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
Self::Input::DownloadWivrn => {
|
Self::Input::DownloadWivrn => {
|
||||||
if !check_dependency(adb_dep()) {
|
if !check_dependency(adb_dep()) {
|
||||||
self.adb_missing_dialog.present();
|
self.adb_missing_dialog.present();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
self.set_install_wivrn_status(InstallWivrnStatus::InProgress);
|
self.set_install_wivrn_status(InstallWivrnStatus::InProgress);
|
||||||
self.download_thread = Some(download_file(
|
self.download_thread = Some(download_file(
|
||||||
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-oculus-release.apk".into(),
|
"https://github.com/Meumeu/WiVRn/releases/latest/download/WiVRn-oculus-release.apk".into(),
|
||||||
|
@ -200,11 +201,12 @@ impl SimpleComponent for InstallWivrnBox {
|
||||||
sender: ComponentSender<Self>,
|
sender: ComponentSender<Self>,
|
||||||
) -> ComponentParts<Self> {
|
) -> ComponentParts<Self> {
|
||||||
let adb_missing_dialog = adw::MessageDialog::builder()
|
let adb_missing_dialog = adw::MessageDialog::builder()
|
||||||
.modal(true)
|
.modal(true)
|
||||||
.title("ADB is not installed")
|
.heading("ADB is not installed")
|
||||||
.body("Please install ADB on your computer to install WiVRn on your Android headset")
|
.body("Please install ADB on your computer to install WiVRn on your Android headset")
|
||||||
.hide_on_close(true)
|
.hide_on_close(true)
|
||||||
.build();
|
.build();
|
||||||
|
adb_missing_dialog.add_response("ok", "_Ok");
|
||||||
|
|
||||||
let model = Self {
|
let model = Self {
|
||||||
selected_profile: init.selected_profile,
|
selected_profile: init.selected_profile,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue