Update native_dialog to 0.5.2

This commit is contained in:
Imbris 2021-02-07 00:48:57 -05:00
parent 6a193d388d
commit 357cb26e05
3 changed files with 26 additions and 25 deletions

34
Cargo.lock generated
View File

@ -1524,6 +1524,15 @@ dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff"
dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs-sys"
version = "0.3.5"
@ -3326,12 +3335,16 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
[[package]]
name = "native-dialog"
version = "0.4.3"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3587334d8bdcc3fd7338845341b150ff97f961cabdb7b420c194ff1bb7e5ee86"
checksum = "9f491dab19c26687b897fcb4ecaa984fc87a7dd5a21d69f48eab41e254116981"
dependencies = [
"osascript",
"serde",
"cocoa 0.24.0",
"dirs 3.0.1",
"objc",
"objc-foundation",
"objc_id",
"once_cell",
"thiserror",
"wfd",
"which",
@ -3842,17 +3855,6 @@ dependencies = [
"num-traits 0.2.14",
]
[[package]]
name = "osascript"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38731fa859ef679f1aec66ca9562165926b442f298467f76f5990f431efe87dc"
dependencies = [
"serde",
"serde_derive",
"serde_json",
]
[[package]]
name = "osmesa-sys"
version = "0.1.2"
@ -4950,7 +4952,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603"
dependencies = [
"dirs",
"dirs 2.0.2",
]
[[package]]

View File

@ -74,7 +74,7 @@ guillotiere = "0.6"
hashbrown = {version = "0.9", features = ["rayon", "serde", "nightly"]}
image = {version = "0.23.12", default-features = false, features = ["ico", "png"]}
lazy_static = "1.4.0"
native-dialog = { version = "0.4.2", default-features = false, optional = true }
native-dialog = { version = "0.5.2", optional = true }
num = "0.3.1"
ordered-float = { version = "2.0.1", default-features = false }
rand = "0.8"

View File

@ -109,18 +109,17 @@ fn main() {
#[cfg(feature = "native-dialog")]
{
use native_dialog::{Dialog, MessageAlert, MessageType};
use native_dialog::{MessageDialog, MessageType};
let mbox = move || {
MessageAlert {
title: "Voxygen has panicked",
MessageDialog::new()
.set_title("Voxygen has panicked")
//somehow `<` and `>` are invalid characters and cause the msg to get replaced
// by some generic text thus i replace them
text: &msg.replace('<', "[").replace('>', "]"),
typ: MessageType::Error,
}
.show()
.unwrap()
.set_text(&msg.replace('<', "[").replace('>', "]"))
.set_type(MessageType::Error)
.show_alert()
.unwrap()
};
// On windows we need to spawn a thread as the msg doesn't work otherwise