import Utils.SDS
import iTasks
+from Data.Func import $
+
+manageShares :: [MTaskShare] -> Task ()
+manageShares shares = forever (enterChoice "Choose share to update" [ChooseFromGrid id] shares
+ >&^ \st->whileUnchanged st $ \msh->case msh of
+ Nothing = viewShares shares @! zero
+ Just sh = viewSharedInformation "View value" [] (getSDSStore sh)
+ >>= \_->return sh
+ ) @! ()
viewShares :: [MTaskShare] -> Task ()
-viewShares st = anyTask (map viewer st)
+viewShares sh = anyTask (map viewShare sh) <<@ ArrangeHorizontal @! ()
-viewer :: MTaskShare -> Task ()
-viewer m = viewSharedInformation "" [] (getSDSStore m)
+viewShare :: MTaskShare -> Task ()
+viewShare m = viewSharedInformation "" [] (getSDSStore m)
<<@ Title ("SDS: " +++ toString m.identifier) @! ()
+
+instance zero MTaskShare where
+ zero = {initValue=0,withTask="",identifier=0,realShare=""}
+
mTaskManager :: Task ()
mTaskManager = anyTask
[ viewmTasks @! ()
- , whileUnchanged sdsStore viewShares
+ , whileUnchanged sdsStore manageShares
, whileUnchanged deviceStore $ manageDevices process
] <<@ ApplyLayout (sequenceLayouts
[ arrangeWithSideBar 0 LeftSide 260 True