[simple-scan] Display out of scanner memory message and instruction how to resolve it.



commit 288095deaeb28f0628559329631ba59d8dba206a
Author: Bartosz Kosiorek <gang65 poczta onet pl>
Date:   Wed Apr 15 16:42:12 2020 +0200

    Display out of scanner memory message and instruction how to resolve it.
    
    Fixes: #161

 src/app-window.vala |  2 +-
 src/scanner.vala    | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index e6c7470..78d304a 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -225,7 +225,7 @@ public class AppWindow : Gtk.ApplicationWindow
                                             Gtk.ButtonsType.NONE,
                                             "%s", error_title);
         dialog.add_button (_("_Close"), 0);
-        dialog.format_secondary_text ("%s", error_text);
+        dialog.format_secondary_markup  ("%s", error_text);
         dialog.run ();
         dialog.destroy ();
     }
diff --git a/src/scanner.vala b/src/scanner.vala
index 461fb5b..23a44fc 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -1286,6 +1286,16 @@ public class Scanner : Object
                     /* Error displayed when no documents at the start of scanning */
                     _("Document feeder empty"));
         }
+        else if (status == Sane.Status.NO_MEM)
+        {
+            fail_scan (status,
+                /* Out of memory error message with help instruction.
+                   Message written in Pango text markup language,
+                   A carriage return makes a line break, <tt> tag makes a monospace font */
+                _("Insufficient memory to perform scan.\n" +
+                  "Try to decrease <tt>Resolution</tt> or <tt>Page Size</tt> in <tt>Preferences</tt> menu. " 
+
+                  "For some scanners when scanning in high resolution, the scan size is restricted."));
+        }
         else if (status == Sane.Status.DEVICE_BUSY)
         {
             /* If device is busy don't interrupt, but keep waiting for scanner */


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