Commit Graph

9 Commits

Author SHA1 Message Date
Gaël PORTAY
41cbf8aa18 progress: Inherit status from parent 2022-05-27 11:19:51 -04:00
Richard Hughes
04f00e8a17 trivial: Never return the invalid value from fu_progress_get_percentage() 2022-03-30 18:42:01 +01:00
Richard Hughes
5817ef3b4f Emit 0% in FuProgress to show the child has started
This prevents showing the 'old' percentage until the first sub-task has
completed for some device firmware updates.
2022-03-29 20:04:26 +01:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
91dc36cba7 trivial: Don't reset the status when calling fu_progress_finished() 2021-11-27 07:22:50 +00:00
Richard Hughes
fca20c0722 trivial: Fix the progress status when required
When the child has completed we rely on the next fu_progress_step_done()
call to set the status value back to the parent-defined value. In the
case where there is a delay until the next step is done (e.g. waiting
for hardware to re-enumerate) the child status persisted incorrectly.
2021-11-15 14:59:37 +00:00
Richard Hughes
f302bbcb03 trivial: Fix a potential division by zero
Spotted by Coverity.
2021-09-24 19:03:52 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00