use adw::prelude::*;
use gtk4::Widget;
use crate::design::dialogs::dialog::show_alert_dialog;
use crate::gettext;
pub fn show_info_dialog(
parent: &impl IsA<Widget>,
body: &str
) {
show_alert_dialog(
parent,
&gettext!("Information"),
body,
&gettext!("OK")
);
}
pub fn show_info_button_dialog(
parent: &impl IsA<Widget>,
body: &str,
button_label: &str
) {
show_alert_dialog(
parent,
&gettext!("Information"),
body,
button_label
);
}
pub fn show_dialog_title(
parent: &impl IsA<Widget>,
title: &str,
body: &str
) {
show_alert_dialog(
parent,
title,
body,
&gettext!("OK")
);
}
pub fn show_error_dialog(
parent: &impl IsA<Widget>,
body: &str
) {
show_alert_dialog(
parent,
&gettext!("Error"),
body,
&gettext!("OK")
);
}
pub fn show_error_button_dialog(
parent: &impl IsA<Widget>,
body: &str,
button_label: &str
) {
show_alert_dialog(
parent,
&gettext!("Error"),
body,
button_label
);
}
pub fn show_error_title_dialog(
parent: &impl IsA<Widget>,
title: &str,
body: &str
) {
let formatted_title = format!("{}: {}", gettext!("Error"), title);
show_alert_dialog(
parent,
&formatted_title,
body,
&gettext!("OK")
);
}
pub fn show_error_title_button_dialog(
parent: &impl IsA<Widget>,
title: &str,
body: &str,
button_label: &str
) {
let formatted_title = format!("{}: {}", gettext!("Error"), title);
show_alert_dialog(
parent,
&formatted_title,
body,
button_label
);
}