If you can't suspend/hibernate or on a mobile device or VM then the battery
percentage is control is supposed to be shown.
The parent widgets are hidden though, so this doesn't work.
Always show the parents, as all branches show something here.
This was added in 6a65dcf693.
For sake of simplicity we were just releasing a state once we got a
callback, however during the handling of the callback itself we are
still technically under that scenario, so we should release a state only
after the callback is completed.
This is more relevant now since when converting errors to human readable
strings we check the state we are in, and so we need to ensure that this
state is preserved until this point.
In case the device got disconnected while enrolling we should not try
to stop or unclaim it, but indeed show an error related to the device
not being available.
To get this we only have to remove the enrolling and claimed states now
Use flags to track the dialog actions state so that we can:
1. Remove multiple flags to track specific states
2. Prevent starting again an action we're still waiting for completion
3. Handle global visual elements (such as the busy spinner) correctly
Specifically point 3. allows to ensure that when doing concurrent
actions such as prints listing and device claiming, we will stop the
spinner only once all the operations are over.
We were a bit too permissive in handling the AlreadyInUse error during
claim, as we assumed it was always us causing it instead of properly
handing the case a device was already claimed by another caller.
So to ensure this is the case we need to avoid multiple calls to claim
until we've finished one.
Unfortunately we can't rely on a cancellable here as we may end up
cancelling the request that succeeded and we'll only get an
AlreadyClaimed error without know if it was us succeeding.
Fixes: #1201
We unset the local device early when releasing it, so use the one we
get the callback instead of relying in the private instance that has
been already cleared.
This markup isn't needed since it's already added later in the function.
Also, it was ignored because of some dark magic with the comma operator
(which shouldn't have been there to begin with). That's why it wasn't
discovered earlier.
See https://en.cppreference.com/w/c/language/operator_other#Comma_operator
for some explanation on how the comma operator works.
Causes build errors linking against the builtin libhandy:
ninja: error: '/home/hadess/Projects/gnome-install/lib/libhandy-1.so', needed by 'panels/info-overview/gnome-control-center-print-renderer', missing and no known rule to make it
Rather than hiding the ‘Add User’ button when the panel is locked, show
it in an insensitive state. This gives the user a hint that in order to
add a new user, they will need to unlock the panel.
See: https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/26#note_705945
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Highlight that the panel needs to be unlocked in order to add new users.
Currently, while the panel is locked, it’s not at all obvious how to add
new users.
In particular, this helps improve the flow from the parental controls
application, which opens g-c-c to allow new users to be added.
See: https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/26#note_705945
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Calling gtk_css_provider_load_from_resource() twice will remove any
already loaded resource instead of adding the new CSS with the old. Load
each CSS individually instead.
Fixes: f1bcaf1fbc