Added detection for a system without Podman or Docker
+Translation Updates
diff --git a/src/main.rs b/src/main.rs index fa9747c..0dcf810 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,7 @@ use utils::{ get_download_dir_path, get_my_deb_boxes, get_my_rpm_boxes, get_rpm_distros, get_supported_terminals, get_supported_terminals_list, get_terminal_and_separator_arg, has_distrobox_installed, has_file_extension, has_home_or_host_access, has_host_access, - set_up_localisation, + has_podman_or_docker_installed, set_up_localisation, }; const APP_ID: &str = "io.github.dvlv.boxbuddyrs"; @@ -100,7 +100,11 @@ fn make_window(app: &Application) -> ApplicationWindow { window.set_child(Some(&toast_overlay)); if has_distrobox_installed() { - load_boxes(&scroll_area, &window, Some(0)); + if has_podman_or_docker_installed() { + load_boxes(&scroll_area, &window, Some(0)); + } else { + render_podman_not_installed(&scroll_area); + } } else { render_not_installed(&scroll_area); } @@ -285,6 +289,21 @@ fn render_not_installed(scroll_area: >k::Box) { scroll_area.append(¬_installed_lbl_two); } +fn render_podman_not_installed(scroll_area: >k::Box) { + // TRANSLATORS: Error message + let not_installed_lbl = gtk::Label::new(Some(&gettext("Podman / Docker not found!"))); + not_installed_lbl.add_css_class("title-1"); + + // TRANSLATORS: Error message + let not_installed_lbl_two = gtk::Label::new(Some(&gettext( + "Could not find podman or docker, please install one of them!", + ))); + not_installed_lbl_two.add_css_class("title-2"); + + scroll_area.append(¬_installed_lbl); + scroll_area.append(¬_installed_lbl_two); +} + fn load_boxes(scroll_area: >k::Box, window: &ApplicationWindow, active_page: Option