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.
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>
It’s possible for `gdk_cursor_new_for_display()` to return `NULL`. It’s
OK to pass `NULL` to `gdk_window_set_cursor()`, but not OK to then unref
it.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
A duplicatend and translated string could be passed to gettext another
time. If that string can be translated, then a static string would be
returned rather than the const one, causing an invalid free.
Fixes: #1149
We already had the machanism to show/hide the button based on the number
of camera devices detected. We were just not checking for that at
startup.
Fixes#1087
When a retry event happens we need to wiggle the label, unfortunately we
can't just use translate operations via CSS so we need to simulate it using
padding.
Also we have to manually reset the retry class once the animation is done
otherwise gtk won't re-animate again once the class is added (in the same
paint cycle).
Implement the new designed interface for fingerprint enrollment, so that the
dialog is now based on a stack of views:
- A list of devices to choose (shown only if multiple are available)
- A gallery of enrolled prints available where manage them
- An enrollment progress view when enrolling a new finger
Move part of the logic into a new FingerprintManager (to manage gdbus proxies
generated via gdbus-codegen) that is created when configuring the current
user and that tracks the devices states, while move most of the UI into a new
CcFingerprintDialog that does all the operations in async way.
Due to fprintd lack of APIs, there are few features missing, compared to
the final design (none is a regression):
- Identify the finger when the enroll dialog is visible
- Delete a single fingerprint
- Highlight the finger when the sensor is touched during enrollment
- Add customized labels to fingerprints
- Devices hotpluging
However most of the code has been written considering these, and so they could
be easily implemented in future re-iterations once newer APIs are defined for
such bits.
Closes https://gitlab.gnome.org/Teams/Design/settings-mockups/-/issues/18
Add add an "updating" state to the fingerprint manager so that the UI can
adapt the widgets depending on it, as the dbus calls might be a bit slow at
times.
This is a wrapper to read the state of the fingerprint devices and to check
asynchronously whether we have them and if they have enrolled prints we can
use to log-in.
There are devices with more than 10 enroll stages we should handle, so
instead of hardcoding a grid of images, let's just build this dynamically
using a flowbox
Don't make the UI to block while deleting the saved prints (that might take
some time, especially for devices with internal storage) but just use a task
with a thread that:
- Mark the fingerprint row as unsenstive
- Calls the method to delete prints
- In the same thread, calls the method to fetch the updated informations
- Returns in set_fingerprint_row_cb where we update the UI again
Again this would be nicer to be done just using async calls but this is
something to do in some bigger refactor.
Don't load the fingerprint information all the times we update the view, but
load it during initialization only.
The fingerprint state in fact can only change because we requested it
through the dialog that we control already and that would update the
relevant widgets state anyways.
Also, given that the fingerprint settings are visible for the current user
anyway, we can track this only with a simple boolean, instead of using a set
of UIDs.
When opening the user panel we g-c-c performs lots of sync operations that
may cause a noticeable slowdown, especially when a fingerprint device is
available, in fact set_fingerprint_label() call leads to:
- DBus sync request of the system bus
- fprintd dbus-activation
+ This leads to sync opening of all the devices, that might also cause
a slowdown, depending on the devices drivers
- Dbus sync calls to the device to get the list of enrolled fingerprints
Only after we've a reply, we update the g-c-c UI and continue the execution.
The fingerprint dialog code would need some global refactor, but to fix this
without big changes, let's just use GTask that runs a thread in wich we do
all the sync operations, and once done we finally update the widget state.
The object was wrongly unreffed (as ActUserManager has the ownership) on
user switch, so add a reference instead when assigning it to our private
ref and unref it on dispose.
This patch provides an easy way to override default faces using
org.gnome.desktop.interface.avatar-directories settings configuration
that can be used in gnome-initial-setup too so downstream can override
default avatar faces without the need of a patch.
Fix https://gitlab.gnome.org/GNOME/gnome-control-center/issues/678
The add user button is shown only if the panel is unlocked, but
tooltips are also set for the case when the panel is not unlocked.
Let's move the tooltip text in the UI file directly and remove
the obsolete codes.
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
`dest_x` is not set if `gtk_widget_translate_coordinates()` fails, which
it can do before the widget is realised.
This fixes a valgrind warning, but doesn’t change any user-visible
behaviour as far as I can tell.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Changes made by GNOME/gnome-control-center!359 caused that the username
hint ("This will be used to name your home folder and can’t be changed.")
is not shown immediately after opening the "Add User" dialog. This change
was unwanted. Let's show the hint immediately after opening the dialog as
it was before.