diff --git a/src/device_prober.rs b/src/device_prober.rs index 4e67d77..092b894 100644 --- a/src/device_prober.rs +++ b/src/device_prober.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use crate::{ profile::Profile, profiles::{ - lighthouse::lighthouse_profile, valve_index::valve_index_profile, wivrn::wivrn_profile, + lighthouse::lighthouse_profile, wivrn::wivrn_profile, }, }; diff --git a/src/main.rs b/src/main.rs index 64d33d2..b259a1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,13 +40,19 @@ fn restore_steam_xr_files() { let active_runtime = get_current_active_runtime(); let openvrpaths = get_current_openvrpaths(); if active_runtime.is_some() { - if file_builders::active_runtime_json::is_steam(&active_runtime.unwrap()) { - set_current_active_runtime_to_steam(); + if !file_builders::active_runtime_json::is_steam(&active_runtime.unwrap()) { + match set_current_active_runtime_to_steam() { + Ok(_) => {} + Err(_) => println!("Warning: failed to restore active runtime to steam!"), + }; } } if openvrpaths.is_some() { - if file_builders::openvrpaths_vrpath::is_steam(&openvrpaths.unwrap()) { - set_current_openvrpaths_to_steam(); + if !file_builders::openvrpaths_vrpath::is_steam(&openvrpaths.unwrap()) { + match set_current_openvrpaths_to_steam() { + Ok(_) => {} + Err(_) => println!("Warning: failed to restore openvrpaths to steam!"), + }; } } } diff --git a/src/ui/about_dialog.rs b/src/ui/about_dialog.rs index 1945279..da8ffb0 100644 --- a/src/ui/about_dialog.rs +++ b/src/ui/about_dialog.rs @@ -27,9 +27,9 @@ impl SimpleComponent for AboutDialog { } fn init( - init: Self::Init, + _init: Self::Init, root: &Self::Root, - sender: relm4::ComponentSender, + _sender: relm4::ComponentSender, ) -> relm4::ComponentParts { let model = AboutDialog {}; let widgets = root.clone(); diff --git a/src/ui/app.rs b/src/ui/app.rs index 5099bde..e175122 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -257,7 +257,7 @@ impl SimpleComponent for App { } } - fn shutdown(&mut self, widgets: &mut Self::Widgets, output: relm4::Sender) { + fn shutdown(&mut self, _widgets: &mut Self::Widgets, _output: relm4::Sender) { if self.xrservice_runner.is_some() { if self.xrservice_runner.as_mut().unwrap().status() == RunnerStatus::Running { self.xrservice_runner.as_mut().unwrap().terminate(); diff --git a/src/ui/build_window.rs b/src/ui/build_window.rs index 43719a7..50c06bb 100644 --- a/src/ui/build_window.rs +++ b/src/ui/build_window.rs @@ -181,9 +181,9 @@ impl SimpleComponent for BuildWindow { } fn init( - init: Self::Init, + _init: Self::Init, root: &Self::Root, - sender: ComponentSender, + _sender: ComponentSender, ) -> ComponentParts { let mut model = Self { tracker: 0, diff --git a/src/ui/devices_box.rs b/src/ui/devices_box.rs index 2ae940c..105f00c 100644 --- a/src/ui/devices_box.rs +++ b/src/ui/devices_box.rs @@ -226,7 +226,7 @@ impl SimpleComponent for DevicesBox { } } - fn update(&mut self, message: Self::Input, sender: ComponentSender) { + fn update(&mut self, message: Self::Input, _sender: ComponentSender) { self.reset(); match message { @@ -237,9 +237,9 @@ impl SimpleComponent for DevicesBox { } fn init( - init: Self::Init, + _init: Self::Init, root: &Self::Root, - sender: ComponentSender, + _sender: ComponentSender, ) -> ComponentParts { let model = Self { tracker: 0, diff --git a/src/ui/factories/env_var_row_factory.rs b/src/ui/factories/env_var_row_factory.rs index 62b4ae7..0104a25 100644 --- a/src/ui/factories/env_var_row_factory.rs +++ b/src/ui/factories/env_var_row_factory.rs @@ -1,6 +1,5 @@ use crate::ui::profile_editor::ProfileEditorMsg; use adw::prelude::*; -use gtk::prelude::*; use relm4::prelude::*; #[derive(Debug)] @@ -77,7 +76,7 @@ impl FactoryComponent for EnvVarModel { }) } - fn init_model(init: Self::Init, index: &Self::Index, sender: FactorySender) -> Self { + fn init_model(init: Self::Init, _index: &Self::Index, _sender: FactorySender) -> Self { Self { name: init.name, value: init.value, diff --git a/src/ui/main_view.rs b/src/ui/main_view.rs index 30550e5..065a4cc 100644 --- a/src/ui/main_view.rs +++ b/src/ui/main_view.rs @@ -324,7 +324,7 @@ impl SimpleComponent for MainView { set_margin_end: 12, set_halign: gtk::Align::Start, connect_clicked[sender] => move |_| { - sender.output(Self::Output::OpenLibsurviveSetup); + sender.output(Self::Output::OpenLibsurviveSetup).expect("Sender outut failed"); } }, }, @@ -409,10 +409,10 @@ impl SimpleComponent for MainView { .emit(InstallWivrnBoxMsg::ClockTicking); } Self::Input::StartStopClicked => { - sender.output(Self::Output::DoStartStopXRService); + sender.output(Self::Output::DoStartStopXRService).expect("Sender output failed"); } Self::Input::RestartXRService => { - sender.output(Self::Output::RestartXRService); + sender.output(Self::Output::RestartXRService).expect("Sender output failed"); } Self::Input::XRServiceActiveChanged(active, profile) => { self.set_xrservice_active(active); @@ -475,7 +475,7 @@ impl SimpleComponent for MainView { Self::Input::ProfileSelected(position) => { sender.output(MainViewOutMsg::ProfileSelected( self.profiles.get(position as usize).unwrap().clone(), - )); + )).expect("Sender output failed"); } Self::Input::EditProfile => { if self.selected_profile.editable { @@ -500,7 +500,7 @@ impl SimpleComponent for MainView { self.profile_delete_confirm_dialog.present(); } Self::Input::SaveProfile(prof) => { - sender.output(Self::Output::SaveProfile(prof)); + sender.output(Self::Output::SaveProfile(prof)).expect("Sender output failed"); } Self::Input::DuplicateProfile => { if self.selected_profile.can_be_built { @@ -570,7 +570,7 @@ impl SimpleComponent for MainView { let pdc_sender = sender.clone(); profile_delete_confirm_dialog.connect_response(None, move |_, res| { if res == "yes" { - pdc_sender.output(Self::Output::DeleteProfile); + pdc_sender.output(Self::Output::DeleteProfile).expect("Sender output failed"); } }); } diff --git a/src/ui/profile_editor.rs b/src/ui/profile_editor.rs index f2e8df3..e7bd4a1 100644 --- a/src/ui/profile_editor.rs +++ b/src/ui/profile_editor.rs @@ -294,7 +294,7 @@ impl SimpleComponent for ProfileEditor { Self::Input::SaveProfile => { let prof = self.profile.borrow(); if prof.validate() { - sender.output(ProfileEditorOutMsg::SaveProfile(prof.clone())); + sender.output(ProfileEditorOutMsg::SaveProfile(prof.clone())).expect("Sender output failed"); self.win.as_ref().unwrap().close(); } else { self.win.as_ref().unwrap().add_toast( diff --git a/src/ui/steam_launch_options_box.rs b/src/ui/steam_launch_options_box.rs index bc284f2..84d39f6 100644 --- a/src/ui/steam_launch_options_box.rs +++ b/src/ui/steam_launch_options_box.rs @@ -98,7 +98,7 @@ impl SimpleComponent for SteamLaunchOptionsBox { } } - fn update(&mut self, message: Self::Input, sender: ComponentSender) { + fn update(&mut self, message: Self::Input, _sender: ComponentSender) { self.reset(); match message { @@ -118,7 +118,7 @@ impl SimpleComponent for SteamLaunchOptionsBox { } fn init( - init: Self::Init, + _init: Self::Init, root: &Self::Root, sender: ComponentSender, ) -> ComponentParts { diff --git a/src/ui/wivrn_conf_editor.rs b/src/ui/wivrn_conf_editor.rs index cd8f7c5..4b4b718 100644 --- a/src/ui/wivrn_conf_editor.rs +++ b/src/ui/wivrn_conf_editor.rs @@ -1,7 +1,6 @@ use crate::file_builders::wivrn_config::{dump_wivrn_config, get_wivrn_config, WivrnConfig, Encoder}; use adw::prelude::*; -use gtk::prelude::*; -use relm4::{factory::FactoryVecDeque, prelude::*}; +use relm4::prelude::*; #[tracker::track] pub struct WivrnConfEditor { @@ -114,7 +113,7 @@ impl SimpleComponent for WivrnConfEditor { } } - fn update(&mut self, message: Self::Input, sender: ComponentSender) { + fn update(&mut self, message: Self::Input, _sender: ComponentSender) { self.reset(); match message {