[simple-scan] Don't interrupt scanning if the device is busy.



commit 2e9ce3233bcbe52eaefbef8b742e2be9948c538a
Author: Bartosz Kosiorek <gang65 poczta onet pl>
Date:   Sat Apr 11 02:02:34 2020 +0200

    Don't interrupt scanning if the device is busy.
    
    After scan is finished, the scanner needs few of
    seconds to prepare for next scan. During that moment
    the device is in Sane.Status.DEVICE_BUSY state.
    Previously if the user press "Scan" button during that state,
    the message:
       "Unable to start scan" was be displayed.
    
    This patch fix that. After pressing Scan button in DEVICE_BUSY state,
    the application will keep trying start next scan.
    If the user would like to interrupt this loop, he could
    press "Stop" button.

 src/scanner.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/scanner.vala b/src/scanner.vala
index 0971ca7..44c6fa7 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -1287,6 +1287,10 @@ public class Scanner : Object
                     /* Error displayed when no documents at the start of scanning */
                     _("Document feeder empty"));
         }
+        else if (status == Sane.Status.DEVICE_BUSY)
+        {
+            /* If device is busy don't interrupt, but keep waiting for scanner */
+        }
         else
         {
             warning ("Unable to start device: %s", Sane.strstatus (status));


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