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>
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.
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.
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.
Otherwise we might potentially be using the GtkSettings for the wrong
screen, which might make a difference if one screen has animations
enabled but another doesn’t.
(This is an edge case I spotted while reading the code, but not one that
I’ve experienced practically.)
Signed-off-by: Philip Withnall <withnall@endlessm.com>
On FreeBSD, the default full name of a user is 'User &'. The '&'
character included in the name is expected to be replaced with the login
name when it is displayed on the user interface. However, it seems that
AccountsService doesn't know it. It just returns 'User &' to the caller,
and it causes the markup to be broken in the user panel.
setlocale() is not threadsafe except when used only to query the locale
without changing it. Let's use uselocale() instead, which changes the
locale only on the calling thread. Much better.
In the User Accounts panel's carousel, longer real names
push the window geometry to super wide levels -- even with
the 255-char limitation in place.
Fix that by ellipsizing the real name label.
Changes from !373 causes crashes when "Add User" dialog is canceled.
Check return value and generate user avatar only if valid user is
returned to fix the crashes.
Switch from GtkBuilder to using GtkTemplate.
Rename .[ch] and .ui files to standard names.
Rename widget IDs to be more readable.
Drop widget IDs that are not used.
Move code into the .ui file that can be.
Connect signals in swapped form.
2018-10-25 11:28:53 +00:00
Renamed from panels/user-accounts/um-user-panel.c (Browse further)