diff --git a/gtk/src/app/events/mod.rs b/gtk/src/app/events/mod.rs index cedc92c..684bb7d 100644 --- a/gtk/src/app/events/mod.rs +++ b/gtk/src/app/events/mod.rs @@ -6,6 +6,7 @@ use dbus_udisks2::{DiskDevice, Disks, UDisks2}; use md5::Md5; use sha1::Sha1; use sha2::Sha256; +use sha2::Sha512; use std::collections::HashMap; use std::io; use std::path::PathBuf; @@ -46,6 +47,7 @@ pub fn background_thread(events_tx: Sender, events_rx: Receiver hasher::(&path), "SHA256" => hasher::(&path), "SHA1" => hasher::(&path), + "SHA512" => hasher::(&path), _ => Err(io::Error::new( io::ErrorKind::InvalidInput, "hash kind not supported", diff --git a/gtk/src/app/signals/images.rs b/gtk/src/app/signals/images.rs index 10a90ad..cd70d89 100644 --- a/gtk/src/app/signals/images.rs +++ b/gtk/src/app/signals/images.rs @@ -52,9 +52,10 @@ fn set_hash_widget(state: &State, ui: &GtkUi) { let path = state.image_path.borrow(); let kind = match hash.active() { - Some(1) => "SHA256", - Some(2) => "SHA1", - Some(3) => "MD5", + Some(1) => "SHA512", + Some(2) => "SHA256", + Some(3) => "SHA1", + Some(4) => "MD5", _ => return, }; diff --git a/gtk/src/app/views/images.rs b/gtk/src/app/views/images.rs index 764a38d..1930117 100644 --- a/gtk/src/app/views/images.rs +++ b/gtk/src/app/views/images.rs @@ -56,6 +56,7 @@ impl ImageView { let hash = cascade! { ComboBoxText::new(); ..append_text(&fl!("none")); + ..append_text("SHA512"); ..append_text("SHA256"); ..append_text("SHA1"); ..append_text("MD5");