add detection of installed tools in host environment

This commit is contained in:
2024-07-02 18:54:10 +02:00
parent 84dfa4e935
commit 4ba1e6c6ad
4 changed files with 60 additions and 3 deletions

View File

@@ -1,4 +1,7 @@
use crate::gtk::Align;
use crate::util::prerequisit::get_installed_terminals;
use crate::util::prerequisit::is_toolbox_installed;
use crate::util::toolbox::ToolbxContainer;
use relm4::adw::prelude::PreferencesGroupExt;
use relm4::factory::FactoryHashMap;
@@ -181,8 +184,9 @@ impl Component for App {
};
sender.spawn_oneshot_command(|| {
// TODO: actually check for compatibility
AppCommandMsg::PrerequisitsInstalled(true)
let terminals = get_installed_terminals().unwrap_or_default();
let toolbox_installed = is_toolbox_installed().unwrap_or(false);
AppCommandMsg::PrerequisitsInstalled(terminals.len() > 0 && toolbox_installed)
});
actions.add_action(shortcuts_action);