-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
New Battery health section #194
Conversation
@andirsun typically I'd say iterative is best here, but changing to a sidebar doesn't really make sense on its own without adding a second view… so in this case I think I'd be fine to do the sidebar and battery health stuff all in one PR. You could do any code cleanup/bug fixes you find along the way as iterative PRs against master, though. |
@cassidyjames How can I edit the Title of |
@andirsun they’re the same with SimpleSettingsPage, so it would probably be best to just use the full name “Built-in battery”. Alternatively you could use a SettingsPage and create the top of the view’s layout manually, but that seems unnecessary. |
@cassidyjames Revert change Done ! |
@JoseExposito Could you please test Again if
@JoseExposito Could you please test this again ? |
@JoseExposito And Could your test this again ? |
… into side-bar-view
… into side-bar-view
… into side-bar-view
… into side-bar-view
4 Months to review a PR. there is something wrong with it ? |
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.
Partial code review
update_time = upower_device.update_time; | ||
|
||
is_charging = state == State.FULLY_CHARGED || state == State.CHARGING; | ||
is_a_battery = device_type != Type.UNKNOWN && device_type != Type.LINE_POWER; |
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.
Lines 188 - 215 can be replaced by get {}
clauses on corresponding read-only properties.
e.g.
public bool has_history {
get {
return upower_device != null ? upower_device.has_history : false;
}
}
public double percentage { get; private set; } | ||
public bool is_charging { get; private set; } | ||
public bool is_a_battery { get; private set; } | ||
public bool has_history { get; private set; } | ||
public bool has_statistics { get; private set; } | ||
public bool is_rechargeable { get; private set; } | ||
public bool online { get; private set; } | ||
public bool power_supply { get; private set; } | ||
public double capacity { get; private set; } | ||
public double energy { get; private set; } | ||
public double energy_empty { get; private set; } | ||
public double energy_full { get; private set; } | ||
public double energy_full_design { get; private set; } | ||
public double energy_rate { get; private set; } | ||
public double luminosity { get; private set; } | ||
public double temperature { get; private set; } | ||
public double voltage { get; private set; } | ||
public int64 time_to_empty { get; private set; } | ||
public int64 time_to_full { get; private set; } | ||
public string model { get; private set; } | ||
public string native_path { get; private set; } | ||
public string serial { get; private set; } | ||
public string vendor { get; private set; } | ||
public uint64 update_time { get; private set; } | ||
public Type device_type { get; private set; } | ||
public Technology technology { get; private set; } | ||
public State state { get; private set; } |
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.
Use read-only properties with appropriate get {}
clauses - see example below.
This whole device class seems kinda bonkers to me. Shouldn't we use https://valadoc.org/gio-2.0/GLib.DBusProxy.html for this? For example, look at the UPower interfaces for the power indicator: |
fixes: #156
fixes: #178
I am going to put all current settings in Behavior page and create a new Battery Health info page as disccused with @cassidyjames here #156 (comment)
Preview:
Rechargeable devices
Non-rechargeable devices