summaryrefslogtreecommitdiff
path: root/ui/status/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/status/status.go')
-rw-r--r--ui/status/status.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/status/status.go b/ui/status/status.go
index f3e58b660..da78994ef 100644
--- a/ui/status/status.go
+++ b/ui/status/status.go
@@ -19,6 +19,7 @@ package status
import (
"sync"
+ "time"
)
// Action describes an action taken (or as Ninja calls them, Edges).
@@ -107,6 +108,8 @@ type Counts struct {
// FinishedActions are the number of actions that have been finished
// with FinishAction.
FinishedActions int
+
+ EstimatedTime time.Time
}
// ToolStatus is the interface used by tools to report on their Actions, and to
@@ -118,6 +121,7 @@ type ToolStatus interface {
// This call be will ignored if it sets a number that is less than the
// current number of started actions.
SetTotalActions(total int)
+ SetEstimatedTime(estimatedTime time.Time)
// StartAction specifies that the associated action has been started by
// the tool.
@@ -267,6 +271,13 @@ func (s *Status) updateTotalActions(diff int) {
s.counts.TotalActions += diff
}
+func (s *Status) SetEstimatedTime(estimatedTime time.Time) {
+ s.lock.Lock()
+ defer s.lock.Unlock()
+
+ s.counts.EstimatedTime = estimatedTime
+}
+
func (s *Status) startAction(action *Action) {
s.lock.Lock()
defer s.lock.Unlock()
@@ -329,6 +340,10 @@ func (d *toolStatus) SetTotalActions(total int) {
}
}
+func (d *toolStatus) SetEstimatedTime(estimatedTime time.Time) {
+ d.status.SetEstimatedTime(estimatedTime)
+}
+
func (d *toolStatus) StartAction(action *Action) {
totalDiff := 0