aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Main.hs5
-rw-r--r--Types/State.hs3
2 files changed, 7 insertions, 1 deletions
diff --git a/Main.hs b/Main.hs
index 8ca6351..7a60e79 100644
--- a/Main.hs
+++ b/Main.hs
@@ -35,7 +35,9 @@ drawUI st = [ui]
, hBorderWithLabel (str "[ Actions ]")
, vLimit 6 $ C.center $ actionsBox
]
- status = str "Ready to scan first page"
+ status = str $ case st^.stPageCount of
+ Just n -> "Scanned " ++ show n ++ " pages"
+ Nothing -> "Ready to scan first page"
settingsBox = defnList AlignRight Nothing
[ ("run OCRmyPDF", if st^.stOCR then "yes" else "no")
, ("colour data", show $ st^.stColour)
@@ -139,6 +141,7 @@ main = do
let paper = if papersize == "letter" then Letter else A4
initialState = St
{ _stScanningSession = Nothing
+ , _stPageCount = Nothing
, _stOCR = True
, _stColour = Greyscale
, _stPaper = paper
diff --git a/Types/State.hs b/Types/State.hs
index befba24..e37d7a8 100644
--- a/Types/State.hs
+++ b/Types/State.hs
@@ -38,6 +38,9 @@ data St =
St { _stScanningSession :: Maybe FilePath -- ^ if a session is in
-- progress, accmulate
-- scans in this dir
+ , _stPageCount :: Maybe Int -- ^ if a session is in
+ -- progress, the number of
+ -- pages scanned thus far
, _stOCR :: Bool -- ^ whether to use OCRmyPDF
, _stColour :: Colour
, _stPaper :: Paper -- ^ currently selected paper size