From 138c196e53752762b8e20a244fb2189460c5ca13 Mon Sep 17 00:00:00 2001 From: segfault Date: Mon, 23 Jul 2018 23:35:01 +0200 Subject: [PATCH] gtkplacessidebar: Improve error message when unlocking volume fails --- gtk/gtkplacessidebar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 17fee6d5f5..31b968d0f4 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -2416,7 +2416,10 @@ volume_mount_cb (GObject *source_object, error->code != G_IO_ERROR_ALREADY_MOUNTED) { name = g_volume_get_name (G_VOLUME (source_object)); - primary = g_strdup_printf (_("Unable to access “%s”"), name); + if (g_str_has_prefix (error->message, "Error unlocking")) + primary = g_strdup_printf (_("Error unlocking “%s”"), name); + else + primary = g_strdup_printf (_("Unable to access “%s”"), name); g_free (name); emit_show_error_message (sidebar, primary, error->message); g_free (primary);