Added ApplicationManager::Status, DownloadManager now displays data from Status, added improved progress information to DownloadManager via Task updating its Status object

This commit is contained in:
2021-11-26 12:17:26 -06:00
parent 935aed1a7a
commit 6c18e16357
10 changed files with 220 additions and 81 deletions

View File

@@ -0,0 +1,40 @@
class W3DHub
class ApplicationManager
class Status
attr_reader :application, :channel, :step, :operations, :data
attr_accessor :label, :value, :progress
def initialize(application:, channel:, label: "", value: "", progress: 0.0, step: :pending, operations: {}, &callback)
@application = application
@channel = channel
@label = label
@value = value
@progress = progress
@step = step
@operations = operations
@callback = callback
@data = {}
end
def step=(sym)
@step = sym
@callback&.call(self)
@step
end
class Operation
attr_accessor :label, :value, :progress
def initialize(label:, value:, progress:)
@label = label
@value = value
@progress = progress
end
end
end
end
end