show non-fatal setup errors on home screen instead of in popup
This commit is contained in:
@@ -22,6 +22,7 @@ use serde::{Serialize, Serializer, ser::SerializeMap};
|
||||
|
||||
pub trait ErrorPopup {
|
||||
fn error_popup(self, title: &str);
|
||||
fn error_popup_nowait(self, title: &str);
|
||||
}
|
||||
|
||||
impl<E: std::fmt::Display> ErrorPopup for Result<(), E> {
|
||||
@@ -35,6 +36,14 @@ impl<E: std::fmt::Display> ErrorPopup for Result<(), E> {
|
||||
rx.recv().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn error_popup_nowait(self, title: &str) {
|
||||
if let Err(e) = self {
|
||||
MessageDialogBuilder::new(title, format!("{e}"))
|
||||
.kind(MessageDialogKind::Error)
|
||||
.show(|_| {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user