Class

FwupdPluginProgress

Description [src]

final class FwupdPlugin.Progress : GObject.Object
  implements Fwupd.Codec {
  /* No available fields */
}

Objects can use fu_progress_set_percentage() if the absolute percentage is known. Percentages should always go up, not down.

Modules usually set the number of steps that are expected using fu_progress_set_steps() and then after each section is completed, the fu_progress_step_done() function should be called. This will automatically call fu_progress_set_percentage() with the correct values.

FuProgress allows sub-modules to be “chained up” to the parent module so that as the sub-module progresses, so does the parent. The child can be reused for each section, and chains can be deep.

To get a child object, you should use fu_progress_get_child(). and then use the result in any sub-process. You should ensure that the child is not re-used without calling fu_progress_step_done().

There are a few nice touches in this module, so that if a module only has one progress step, the child progress is used for parent updates.

static void _do_something(FuProgress *self) { // setup correct number of steps fu_progress_set_steps(self, 2);

  // run a sub function
  _do_something_else1(fu_progress_get_child(self));

  // this section done
  fu_progress_step_done(self);

  // run another sub function
  _do_something_else2(fu_progress_get_child(self));

  // this progress done (all complete)
  fu_progress_step_done(self);

}

See also: FuDevice.

Ancestors

Implements

Constructors

fu_progress_new
No description available.

since: 1.7.0

Instance methods

fu_progress_add_flag

Adds a flag.

since: 1.7.0

fu_progress_add_step

This sets the step weighting, which you will want to do if one action will take a bigger chunk of time than another.

since: 1.8.2

fu_progress_finished

Called when the step_now sub-task wants to finish early and still complete.

since: 1.7.0

fu_progress_get_child

Monitor a child and proxy back up to the parent with the correct percentage.

since: 1.7.0

fu_progress_get_duration

Get the duration of the step.

since: 1.8.2

fu_progress_get_id

Return the id of the progress, which is normally set by the caller.

since: 1.7.0

fu_progress_get_name

Return the nice name of the progress, which is normally set by the caller.

since: 1.8.2

fu_progress_get_percentage

Get the last set progress percentage.

since: 1.7.0

fu_progress_get_profile

Returns if the profile is enabled for this progress.

since: 1.8.2

fu_progress_get_status

Return the status of the progress, which is normally indirectly by fu_progress_add_step().

since: 1.7.0

fu_progress_get_steps

Gets the number of sub-tasks, i.e. how many times the fu_progress_step_done() function will be called in the loop.

since: 1.7.0

fu_progress_has_flag

Tests for a flag.

since: 1.7.0

fu_progress_remove_flag

Removes a flag.

since: 1.7.0

fu_progress_reset

Resets the FuProgress object to unset.

since: 1.7.0

fu_progress_set_id

Sets the id of the progress.

since: 1.7.0

fu_progress_set_name

Sets the nice name of the progress.

since: 1.8.2

fu_progress_set_percentage

Sets the progress percentage complete.

since: 1.7.0

fu_progress_set_percentage_full

Sets the progress completion using the raw progress values.

since: 1.7.0

fu_progress_set_profile

This enables profiling of FuProgress. This may be useful in development, but be warned; enabling profiling makes FuProgress very slow.

since: 1.7.0

fu_progress_set_status

Sets the status of the progress.

since: 1.7.0

fu_progress_set_steps

Sets the number of sub-tasks, i.e. how many times the fu_progress_step_done() function will be called in the loop.

since: 1.7.0

fu_progress_sleep

Sleeps, setting the device progress from 0..100% as time continues.

since: 1.7.0

fu_progress_step_done

Called when the step_now sub-task has finished.

since: 1.7.0

fu_progress_traceback

Create a traceback used for profiling startup.

since: 1.8.2

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Methods inherited from FwupdCodec (8)
fwupd_codec_add_string

Converts an object that implements FwupdCodec to a debug string, appending it to str.

fwupd_codec_from_json

Converts an object that implements FwupdCodec from a JSON object.

fwupd_codec_from_json_string

Converts an object that implements FwupdCodec from a JSON string.

fwupd_codec_from_variant

Converts an object that implements FwupdCodec from a GVariant value.

fwupd_codec_to_json

Converts an object that implements FwupdCodec to a JSON builder object.

fwupd_codec_to_json_string

Converts an object that implements FwupdCodec to a JSON string.

fwupd_codec_to_string

Converts an object that implements FwupdCodec to a debug string.

fwupd_codec_to_variant

Converts an object that implements FwupdCodec to a GVariant.

Signals

FwupdPlugin.Progress::percentage-changed

The ::percentage-changed signal is emitted when the tasks completion has changed.

since: 1.7.0

FwupdPlugin.Progress::status-changed

The ::status-changed signal is emitted when the task status has changed.

since: 1.7.0

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct FwupdPluginProgressClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.