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.
Goal of this commit is to not overwhelm UI when a lot of printers is added
to CUPS. You can reproduce this situation when you add e.g. 30 printers using
lpadmin. Th UI stops to respond for some time.
To do so, the printer entries are not deleted every time there is a request
for updating of the list of printers but only new printer entries are added
and printer entries of deleted printers are removed. Other printer
entries are just updated by new method pp_printer_entry_update().
Which, by the way, is almost whole taken from pp_printer_entry_new().
This needed to add sort function for the list of printer entries. It sorts
printers according to their names not taking case into account.
In the similar manner, the filter function was extended to not show printers
which are being deleted. This needs a list of names of deleted printers
which we keep until they are really deleted.
One important thing here is the "reference" object which points to the panel
itself via its "self" key. We pass this object to the pp_printer_delete_async()'s
callback so it knows whether it can remove the printer's name from the list
of deleted printers (once the panel is being destroyed it clears the key itself).
malcontent[1] is parental(or admin) controlled interface which
can restrict a application's visibility and interactivity for a
standard user. Hence, if the current uid has any restrictions
on its installed applications, filter them out from the applications
panel.
Make the malcontent support enable or disable by setting it up as
a build-time meson option.
[1]: https://gitlab.freedesktop.org/pwithnall/malcontent/
Remove GSource used for real deletion of a printer when
the "Undo" notification was dismissed.
Also set the timout id of the notitification to 0 when triggered.
Replace cancel_notification_timeout() with one line.
The issue fixed here could be reproduced this way:
1) Open Printers panel
2) Remove a printer
3) Press back button to go to overview
4) Wait 10 seconds
5) Return to the printers panel
6) Close gnome-control-center
Result:
Critical warning on removal of non-existing GSource
Callback for handling of "notification-dismiss-button" got its
parameters swapped. This resulted in crash when user closed
notification about deleted printer.
This commit converts the on_notification_dismissed() function
to accept swapped arguments as was probably intended.
In the screen lock tab we add a "Forbid new USB devices" entry with a
switch to enable or disable said protection.
The actual USB protection is handled by gnome-settings-daemon and
USBGuard.
We use the "Available" property of gnome-settings-daemon to check
if we are able to offer the USB protection (i.e. USBGuard is
installed with the minimum required version ecc..).
If the host doesn't met the requirements we hide the USB
protetion row entirely.
Given the fact that the always on protection benefits are very slim we
decided to give just an on/off switch that by default controls the
"with lock screen" protection level.
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.
When the search field in the "Add Printer" dialog is edited, no
authentication with a remote SMB server should be attempted. The server
should just be added to the list and marked with "Server requires
authentication". The user can then authenticate the server by clicking
on it.
The behavior described above is probably the intended one when the code
was written, since there is no closure registered for the
"authentication-required" signal in the function this commit modifies.
This commit should simply restore the intended behavior.
Resolves: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/755
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.
The Screen Sharing dialog used to have a switch, which was changed to a
checkbox in 8b68961431
However, unlike switches, checkboxes are expected to have clicable labels
Let's set the label properly, instead of doing it the switch way.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/565
Print e.g. "2 minutes" instead of "2 minutes 0 seconds". Also, update
the path in Totem from which this was copied. The MR to make the same
change in Totem is here:
https://gitlab.gnome.org/GNOME/totem/merge_requests/134