IN Validity
Tue Jan 8 17:11:22 WET 2008 Miguel Vilaca <jmvilaca@di.uminho.pt>
* IN Validity
Do the IN validity check on loading and saving.
{
hunk ./src/INChecks.hs 21
+ , iNCheck
+
hunk ./src/INChecksUI.hs 3
+ , iNCheck
hunk ./src/INChecksUI.hs 5
+ , checkValidINOnSave
hunk ./src/INChecksUI.hs 66
+-- | Run the \"valid IN\" check operation over current IN system on Save.
+checkValidINOnSave :: (Show g, Show n, Show e) => State g n e -> IO a -> IO ()
+checkValidINOnSave state action =
+ do w <- getNetworkFrame state
+ pDoc <- getDocument state
+ doc <- PD.getDocument pDoc
+ wxcBeginBusyCursor
+ let l = func doc
+ wxcEndBusyCursor
+ if Map.null l
+ then ignoreResult action
+ else do logMessage $ badMsg ++ ": \n" ++ showError l
+ go <- proceedDialog w (checkName ++ ": Failed") (badMsg ++ ".\nSee report in the bottom area.\n\nDo you really want to proceed?")
+ if go then ignoreResult action else return ()
+ where (checkName, _, okMsg, badMsg, func) = iNCheck
+
hunk ./src/NetworkUI.hs 231
+ >> singleCheckOverIN iNCheck state
hunk ./src/NetworkUI.hs 235
- , on command := safetyNet theFrame $ PD.save pDoc
+ , on command := safetyNet theFrame $ checkValidINOnSave state $ PD.save pDoc
hunk ./src/NetworkUI.hs 239
- , on command := safetyNet theFrame $ PD.saveAs pDoc
+ , on command := safetyNet theFrame $ checkValidINOnSave state $ PD.saveAs pDoc
hunk ./src/NetworkUI.hs 548
- , on closing := safetyNet theFrame $ exit state
+ , on closing := safetyNet theFrame $ checkValidINOnSave state $ exit state
}