X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=miTask.icl;h=71b891165dbbb029ade74296b4b4750f3e7562ee;hb=a2b8b2a0de173f92092bf6cbbed23551e674ca3c;hp=dfdcd300a50e40c99b8f22abd88f56153929a942;hpb=1e4c58b59800c21747181bb0c437c6cc47c47dec;p=mTask.git diff --git a/miTask.icl b/miTask.icl index dfdcd30..71b8911 100644 --- a/miTask.icl +++ b/miTask.icl @@ -31,32 +31,28 @@ Start world = startEngine (mTaskManager >>* [OnAction (Action "Shutdown") (always $ shutDown)]) world mTaskManager :: Task () -mTaskManager = anyTask +mTaskManager = startupDevices >>| anyTask [ viewmTasks @! () - , whileUnchanged sdsStore viewShares + , whileUnchanged sdsStore manageShares , whileUnchanged deviceStore $ manageDevices process - ] <<@ ApplyLayout layout - where - layout = sequenceLayouts + ] <<@ ApplyLayout (sequenceLayouts [ arrangeWithSideBar 0 LeftSide 260 True , arrangeSplit Vertical True - ] - - viewmTasks = listmTasks + ]) + where + viewmTasks :: Task String + viewmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore >&^ \sh->whileUnchanged sh $ \mi->forever (case mi of Nothing = viewInformation "No task selected" [] () Just mTaskTask = get deviceStore >>= \devices->case devices of [] = viewInformation "No devices yet" [] () - ds = sendmTask mTaskTask ds @! ()) - where - listmTasks :: Task String - listmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore - - sendmTask mTaskId ds = fromJust ('DM'.get mTaskId allmTasks) -// >>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds -// -&&- enterInformation "Timeout, 0 for one-shot" []) -// >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice bc)] + ds = fromJust ('DM'.get mTaskTask allmTasks) + >>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds + -&&- enterInformation "Timeout" [] + ) >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice mTaskTask bc)] + @! () + ) process :: MTaskDevice (Shared Channels) -> Task () process device ch = forever (watch ch >>* [OnValue (