atlbase 0.1.0

ATL UIBase is a modular GTK4 + Libadwaita 1.6 user interface library that simplifies the development of modern graphical applications in Rust.
Documentation
//! Function show a spinner dialog, that run pkexec command
/**
* command_pkexec.rs
*
* (C) Copyright 2026 AtlantisOS Project
* by @NachtsternBuild
*
* License: GNU GENERAL PUBLIC LICENSE Version 3
*/

use crate::design::dialogs::dialogs_spinner::show_spinner_dialog;
use crate::design::dialogs::dialogs_spinner::IndicatorType;

/// Run pkexec command with spinner
pub fn command_pkexec_spinner(
    parent: &adw::ApplicationWindow,
    command: &str,
    title: &str,
    text: &str
) {
    let full_command = format!("pkexec {}", command);
    show_spinner_dialog(parent, title, text, vec![full_command], IndicatorType::Spinner);
}

/// Run pkexec commands with spinner
pub fn commands_pkexec_spinner(
    parent: &adw::ApplicationWindow,
    commands: &str,
    title: &str,
    text: &str
) {
    let full_command = format!("pkexec sh -c \"{}\"", commands);
    show_spinner_dialog(parent, title, text, vec![full_command], IndicatorType::Spinner);
}

/// Run pkexec command with progressbar
pub fn command_pkexec_progressbar(
    parent: &adw::ApplicationWindow,
    command: &str,
    title: &str,
    text: &str
) {
    let full_command = format!("pkexec {}", command);
    show_spinner_dialog(parent, title, text, vec![full_command], IndicatorType::ProgressBar);
}

/// Run pkexec commands with progressbar
pub fn commands_pkexec_progressbar(
    parent: &adw::ApplicationWindow,
    commands: &str,
    title: &str,
    text: &str
) {
    let full_command = format!("pkexec sh -c \"{}\"", commands);
    show_spinner_dialog(parent, title, text, vec![full_command], IndicatorType::ProgressBar);
}