-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial API proposal for manager #42
Changes from all commits
82ae12a
30e2dce
664b236
18b984b
a7d6035
1874876
2128880
fec2be2
23b9ac1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,29 +23,16 @@ | |
module DInstaller | ||
# This class represents the installer status | ||
class InstallerStatus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe having a class is too much. Is this expected to grow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idea: What about having something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I am not sure. I try to not touch this part :) Just change it from string to unsigned. |
||
class << self | ||
# Returns all the possible installer statuses | ||
# | ||
# @return [Array<InstallerStatus>] Installer status | ||
def all | ||
@all ||= constants | ||
.map { |c| InstallerStatus.const_get(c) } | ||
.select { |c| c.is_a?(InstallerStatus) } | ||
end | ||
end | ||
|
||
attr_reader :id, :name | ||
attr_reader :id | ||
|
||
def initialize(id, name) | ||
def initialize(id) | ||
@id = id | ||
@name = name | ||
end | ||
|
||
IDLE = new(0, "Idle") | ||
PROBING = new(1, "Probing") | ||
PARTITIONING = new(2, "Partitioning") | ||
INSTALLING = new(3, "Installing") | ||
FINISHED = new(4, "Finished") | ||
ERROR = new(5, "Error") | ||
ERROR = new(0) | ||
PROBING = new(1) | ||
PROBED = new(2) | ||
INSTALLING = new(3) | ||
INSTALLED = new(4) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a D-Bus client can poll the progress by reading the property, or listen for PropertiesChanged signals, right?
InstallationProgress has
@dbus_obj&.Progress(...args...)
. How is that related? Which class (interface) is@dbus_obj
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. I see that pattern often.
InstallationProgress will be dropped. Plan is to use Progress.new in dbus Manager object and assign callback to it that raise signal. And attach progress to data structure read from that progress.object.