aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-02-25 21:33:30 -0700
committerSean Whitton <spwhitton@spwhitton.name>2017-02-25 21:33:43 -0700
commit6d0181002b841fee90d03dae0aa4759fdfcc46b5 (patch)
tree7423fb6be6d525ff909ca4008e9cb8f0af2a5e54
parent0f443804011224eace10058d8c1672d3623a3b8f (diff)
downloadsscan-6d0181002b841fee90d03dae0aa4759fdfcc46b5.tar.gz
list of actions
-rw-r--r--Main.hs19
1 files changed, 18 insertions, 1 deletions
diff --git a/Main.hs b/Main.hs
index ad0656d..5c2a673 100644
--- a/Main.hs
+++ b/Main.hs
@@ -19,6 +19,7 @@ import Brick.Widgets.Core
import Data.Text.Markup ((@@))
import Brick.Widgets.DefnList
+import Data.Maybe (isJust)
import Presets
import Types.Preset
import Types.State
@@ -47,7 +48,23 @@ drawUI st = [ui]
presetsBox = defnList AlignLeft
(Just $ V.withStyle V.currentAttr V.bold)
(map (\(Preset k desc _) -> ([k], desc)) presets)
- actionsBox = str "actions"
+ actionsBox = defnList AlignLeft
+ (Just $ V.withStyle V.currentAttr V.bold) $
+ (if st^.stOutFormat == PDF
+ then (if isJust $ st^.stScanningSession
+ then [ ("SPC", "scan next page")
+ , ("RET", "scan final page")
+ , ("q", "declare last page was final page")
+ ]
+ else [ ("SPC", "scan first page of multi-page document")
+ , ("RET", "scan single page document")
+ , ("q", "quit sscan")
+ ]
+ )
+ else [ ("SPC", "scan page")
+ , ("q", "quit sscan")
+ ]
+ )
handleHotKey :: St -> Char -> EventM () (Next St)
handleHotKey st 'q' = halt st