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



commit 2fdcd18962b05c91c635c44c0b80e8851b02e5fe
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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/scanner.vala b/src/scanner.vala
index abe0668..ffef562 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -910,7 +910,7 @@ public class Scanner : Object
                     "FlatBed",
                     "Normal",
                     Sane.I18N ("Normal"),
-                    "Document Table" /* Epson scanners, eg. ET-3760 */ 
+                    "Document Table" /* Epson scanners, eg. ET-3760 */
                 };
 
                 string[] adf_sources =
@@ -1245,6 +1245,10 @@ public class Scanner : Object
             state = ScanState.GET_PARAMETERS;
         else if (status == Sane.Status.NO_DOCS)
             do_complete_document ();
+        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));
@@ -1636,7 +1640,7 @@ public class Scanner : Object
             thread.join ();
             thread = null;
         }
-        
+
         Sane.exit ();
         debug ("sane_exit ()");
     }


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