From: Mart Lubbers Date: Fri, 17 Feb 2017 15:08:45 +0000 (+0100) Subject: share representation started X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a1d6b27b5aa5cbb049abdba86c8c5af4e5c1040e;p=mTask.git share representation started --- diff --git a/miTask.icl b/miTask.icl index efff14d..11daaa9 100644 --- a/miTask.icl +++ b/miTask.icl @@ -8,6 +8,8 @@ import mTask from Text import class Text(startsWith,concat,split,join), instance Text String +import qualified Data.Map as DM + from Data.Func import $ import Data.Tuple import Data.List @@ -85,7 +87,17 @@ mTaskManager = anyTask ] viewShares :: Task () - viewShares = viewInformation () [] () + viewShares = forever ( + enterChoiceWithShared "Shares" [ChooseFromList sdsvw] sdsShare + >>* [OnValue $ withValue $ Just o updateShare] + >>* [OnAction (Action "Back") (const $ Just $ treturn ())] + ) + where + sdsvw (k, v) = concat ["SDS ", toString k, ": ", toString v] + updateShare (k, v) = (viewInformation "Key" [] k + ||- updateInformation "Value" [] v) + >>= \nv->upd + viewDevices :: [MTaskDevice] -> Task () viewDevices ds = anyTask [ @@ -103,6 +115,9 @@ mTaskManager = anyTask channels :: String -> Shared Channels channels s = sdsFocus s $ memoryStore "" $ Just ([], [], False) + sdsShare :: Shared [(Int, Int)] + sdsShare = sdsFocus "mTaskSDSs" $ memoryStore "" $ Just [(1, 1)] + addDevice :: (Shared [MTaskDevice]) -> Task () addDevice devices = enterInformation "Device type and name" [] >>= \(name, ty)->get randomInt @ ((+++) name o toString)