summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2019-06-25 22:06:02 +0200
committersegfault <segfault@riseup.net>2019-06-25 22:06:02 +0200
commitcad14bcb0e308e395a13b5eb88e671149b615086 (patch)
tree2865275a5ee5572eee1dfcbaa8b85fb8af87b31a
parentf1be88cf1e19eb5294d65df9bd6440822d8b0b4b (diff)
parentef78838b1a9f933e2fe939216ce9ded2b9709cdc (diff)
Merge branch 'stable' into develdevel
-rw-r--r--config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py17
-rw-r--r--config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py3
2 files changed, 15 insertions, 5 deletions
diff --git a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py
index af63159..417bc79 100644
--- a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py
+++ b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py
@@ -270,9 +270,8 @@ class Volume(object):
None) # cancellable
unmounted_at_least_once = True
except GLib.Error as e:
- if "org.freedesktop.UDisks2.Error.NotMounted" in e.message:
- if not unmounted_at_least_once:
- logger.warning("Failed to unmount volume %s: %s", self.device_file, e.message)
+ # Ignore "not mounted" error if the volume was already unmounted
+ if "org.freedesktop.UDisks2.Error.NotMounted" in e.message and unmounted_at_least_once:
return
raise
@@ -322,8 +321,16 @@ class Volume(object):
loop.call_set_autoclear_sync(True,
GLib.Variant('a{sv}', {}), # options
None) # cancellable
- self.unmount()
- self.backing_volume.lock()
+ try:
+ self.unmount()
+ self.backing_volume.lock()
+ except GLib.Error as e:
+ # Translators: Don't translate {volume_name} or {error_message},
+ # they are placeholder and will be replaced.
+ body = _("Couldn't lock volume {volume_name}:\n{error_message}".format(volume_name=self.name,
+ error_message=e.message))
+ self.manager.show_warning(_("Error locking volume"), body)
+ return
def on_unlock_button_clicked(self, button):
logger.debug("in on_unlock_button_clicked")
diff --git a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py
index 8e39882..5a1e3e3 100644
--- a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py
+++ b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_manager.py
@@ -255,6 +255,9 @@ class VolumeManager(object):
Gtk.ButtonsType.CLOSE,
title)
dialog.format_secondary_markup(body)
+ # Make the body selectable to allow users to easily copy/paste the error message
+ dialog.get_message_area().get_children()[-1].set_selectable(True)
+
dialog.run()
dialog.close()