summaryrefslogtreecommitdiff
path: root/iced_builder/src/dialogs.rs
blob: 18e3c0d3d65499adb9229323824a29ce101eab09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use rfd::{MessageButtons, MessageDialog, MessageDialogResult, MessageLevel};

pub fn error_dialog(description: impl Into<String>) {
    MessageDialog::new()
        .set_level(MessageLevel::Error)
        .set_buttons(MessageButtons::Ok)
        .set_title("Oops! Something went wrong.")
        .set_description(description)
        .show();
}

pub fn unsaved_changes_dialog(description: impl Into<String>) -> MessageDialogResult {
    MessageDialog::new()
        .set_level(MessageLevel::Warning)
        .set_buttons(MessageButtons::OkCancel)
        .set_title("Unsaved changes")
        .set_description(description)
        .show()
}