mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 17:22:35 +00:00
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:
40
lib/application_manager/status.rb
Normal file
40
lib/application_manager/status.rb
Normal 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
|
||||
Reference in New Issue
Block a user