feat: can disable depenendency checks for specific profiles

This commit is contained in:
Gabriele Musco 2024-07-30 14:14:48 +02:00
commit 5368c73be0
3 changed files with 14 additions and 2 deletions

View file

@ -236,6 +236,8 @@ pub struct Profile {
#[serde(default = "String::default")]
pub xrservice_launch_options: String,
pub autostart_command: Option<String>,
#[serde(default)]
pub skip_dependency_check: bool,
}
impl Display for Profile {
@ -291,6 +293,7 @@ impl Default for Profile {
xrservice_launch_options: String::default(),
uuid,
autostart_command: None,
skip_dependency_check: false,
}
}
}

View file

@ -469,7 +469,8 @@ impl SimpleComponent for App {
// no listed deps for opencomp
}
jobs.extend(get_build_opencomposite_jobs(&profile, clean_build));
if !(self.skip_depcheck || missing_deps.is_empty()) {
if !(self.skip_depcheck || profile.skip_dependency_check || missing_deps.is_empty())
{
missing_deps.sort_unstable();
missing_deps.dedup(); // dedup only works if sorted, hence the above
let distro = LinuxDistro::get();

View file

@ -124,7 +124,15 @@ impl SimpleComponent for ProfileEditor {
prof.borrow_mut().autostart_command =
if txt.is_empty() {None} else {Some(txt)};
})
)
),
add: &switch_row("Dependency Check",
Some("Warning: disabling dependency checks may result in build failures"),
!model.profile.borrow().skip_dependency_check,
clone!(#[strong] prof, move |_, state| {
prof.borrow_mut().skip_dependency_check = !state;
gtk::glib::Propagation::Proceed
})
),
},
add: xrservicegrp = &adw::PreferencesGroup {
set_title: "XR Service",