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