Module UI/Progress

This module is undocumented. This is a list of its definitions.

beginTask :: ProgressMonitor -> String -> Integer -> <Proc> ()

Declares that the operation has started, with the name shown to the user and the total amount of work that will be reported through worked. Give -1 as the total when the amount of work is not known in advance. Call this exactly once, before any other call on the monitor.

beginTaskSM :: SubMonitor -> String -> Integer -> <Proc> ()

beginTask for a sub-monitor. A sub-monitor obtained from convertMonitor already knows its budget, so this is rarely needed.

checkCanceled :: IProgressMonitor a => a -> <Proc> ()

Throws an OperationCanceledException if cancellation has been requested through the given monitor, and does nothing otherwise. Call it at the points where the operation can safely stop; none of the reporting functions check the flag by themselves.

checkCanceledMsg :: IProgressMonitor a => a -> String -> <Proc> ()

Like checkCanceled, but the thrown OperationCanceledException carries the given message.

convertMonitor :: ProgressMonitor -> Integer -> <Proc> SubMonitor

Turns the given monitor into a sub-monitor with the given number of work units to distribute among nested operations. The returned sub-monitor does not have to be finished, but the caller is still responsible for calling done on the monitor that was converted.

createNullProgressMonitor :: () -> <Proc> ProgressMonitor

Creates a progress monitor that discards everything reported to it. Use it when an operation requires a monitor but its progress is not shown anywhere. It does remember cancellation, so setCanceled and isCanceled work.

done :: ProgressMonitor -> <Proc> ()

Declares that the operation has finished and releases the progress indication. Call this exactly once, also when the operation failed or was canceled.

This is the form of done_ to use from SCL: it reaches the same method through a static helper.

doneSM :: SubMonitor -> <Proc> ()

Finishes the sub-monitor, consuming whatever work units it has left. A sub-monitor obtained from newChild or split does not need this.

done_ :: ProgressMonitor -> <Proc> ()

Declares that the operation has finished and releases the progress indication. Call this exactly once, also when the operation failed or was canceled.

Prefer done, which performs the same call through a static helper. Importing this method directly is known to misbehave in SCL.

isCanceled :: ProgressMonitor -> <Proc> Boolean

Returns True if cancellation of the operation has been requested. This only reads the flag; stopping the operation is up to the operation itself.

isCanceledSM :: SubMonitor -> <Proc> Boolean

Returns True if cancellation has been requested. A sub-monitor reads the flag of the monitor it was converted from.

mBeginTask :: IProgressMonitor a => a -> String -> Integer -> <Proc> ()

Declares that the operation has started, with a name and a total amount of work. See beginTask.

mDone :: IProgressMonitor a => a -> <Proc> ()

Declares that the operation has finished. See done.

mIsCanceled :: IProgressMonitor a => a -> <Proc> Boolean

Returns True if cancellation has been requested. See isCanceled.

mSetCanceled :: IProgressMonitor a => a -> Boolean -> <Proc> ()

Requests cancellation, or withdraws the request when given False. See setCanceled.

mSetTaskName :: IProgressMonitor a => a -> String -> <Proc> ()

Sets the name of the main task shown to the user. See setTaskName.

mSubTask :: IProgressMonitor a => a -> String -> <Proc> ()

Sets the name of the subtask that is currently being performed. See subTask.

mWorked :: IProgressMonitor a => a -> Integer -> <Proc> ()

Reports that the given number of work units have been completed. See worked.

newChild :: SubMonitor -> Integer -> <Proc> ProgressMonitor

Creates a monitor for a nested operation, consuming the given number of the parent's remaining work units. The child does not have to be finished explicitly.

sclProgressMonitor :: (String -> Float -> <Proc> ()) -> (() -> <Proc> ()) -> (() -> <Proc> Boolean) -> (Boolean -> <Proc> ()) -> (String -> <Proc> ()) -> (String -> <Proc> ()) -> (Float -> <Proc> ()) -> <Proc> ProgressMonitor

Creates a progress monitor from the functions implementing it, given in the order beginTask, done, isCanceled, setCanceled, setTaskName, subTask and worked. The monitor also keeps a running sum of the work reported to it and the name of the latest subtask, which sclProgressMonitorWork and sclProgressMonitorSubTask return.

sclProgressMonitorSubTask :: SCLProgressMonitor -> <Proc> String

The name given in the latest subTask call, or the empty string if there has been none.

sclProgressMonitorWork :: SCLProgressMonitor -> <Proc> Float

The sum of the work units reported to the monitor through worked so far.

setCanceled :: ProgressMonitor -> Boolean -> <Proc> ()

Requests cancellation of the operation, or withdraws the request when given False.

setCanceledSM :: SubMonitor -> Boolean -> <Proc> ()

Requests cancellation, or withdraws the request when given False. A sub-monitor sets the flag of the monitor it was converted from.

setTaskName :: ProgressMonitor -> String -> <Proc> ()

Sets the name of the main task shown to the user, replacing the one given to beginTask.

setTaskNameSM :: SubMonitor -> String -> <Proc> ()

Sets the name of the main task shown to the user.

setWorkRemaining :: SubMonitor -> Integer -> <Proc> SubMonitor

Sets how many work units the sub-monitor still has to hand out, without consuming any of them, and returns the sub-monitor itself. Use it to redistribute the remaining budget once the amount of work left is known.

split :: SubMonitor -> Integer -> <Proc> ProgressMonitor

Like newChild, but also checks the cancellation flag and throws an OperationCanceledException if cancellation has been requested.

subTask :: ProgressMonitor -> String -> <Proc> ()

Sets the name of the subtask that is currently being performed.

subTaskSM :: SubMonitor -> String -> <Proc> ()

Sets the name of the subtask that is currently being performed.

worked :: ProgressMonitor -> Integer -> <Proc> ()

Reports that the given number of work units have been completed. The reported amounts accumulate and are meant to add up to the total given to beginTask.

workedSM :: SubMonitor -> Integer -> <Proc> ()

Reports that the given number of the sub-monitor's work units have been completed.