[gnome-control-center] fingerprint-dialog: Handle the 'enroll-disconnected' error properly



commit d4745fdac115e5d8e5072e5f0e8dc5ac4255ae42
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Dec 11 14:59:02 2020 +0100

    fingerprint-dialog: Handle the 'enroll-disconnected' error properly
    
    In case the device got disconnected while enrolling we should not try
    to stop or unclaim it, but indeed show an error related to the device
    not being available.
    
    To get this we only have to remove the enrolling and claimed states now

 panels/user-accounts/cc-fingerprint-dialog.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/panels/user-accounts/cc-fingerprint-dialog.c b/panels/user-accounts/cc-fingerprint-dialog.c
index 109b8c7e0..5bdcc2b43 100644
--- a/panels/user-accounts/cc-fingerprint-dialog.c
+++ b/panels/user-accounts/cc-fingerprint-dialog.c
@@ -780,11 +780,19 @@ handle_enroll_signal (CcFingerprintDialog *self,
           const char *message;
 
           if (g_str_equal (result, "enroll-disconnected"))
-            message = _("Fingerprint device disconnected");
+            {
+              message = _("Fingerprint device disconnected");
+              remove_dialog_state (self, DIALOG_STATE_DEVICE_CLAIMED |
+                                         DIALOG_STATE_DEVICE_ENROLLING);
+            }
           else if (g_str_equal (result, "enroll-data-full"))
-            message = _("Fingerprint device storage is full");
+            {
+              message = _("Fingerprint device storage is full");
+            }
           else
-            message = _("Failed to enroll new fingerprint");
+            {
+              message = _("Failed to enroll new fingerprint");
+            }
 
           set_enroll_result_message (self, ENROLL_STATE_WARNING, message);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]