Commit graph

724 commits

Author SHA1 Message Date
Markus Göllnitz
98f7a40d24 multiple panels: show start title buttons in header bar
The start title buttons of the main window should be displayed if and
only if the end title buttons are. Only the left-most header bar should have
the start title button set and only right-most header bar the end title buttons.

Therefore, the title buttons property should be bound to the leaflet state:
When unfolded the start title buttons of the sidebar's header bar are
the only ones visible then, and not a second pair in the panel's header bar.
Likewise, in a folded state of the leaflet, the panel's header bar displays
all availble title buttons – start and end – as the panel is the only widget
displaying a header bar.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2023-03-16 13:18:37 +00:00
Nelson Benítez León
0cb4706b88 user-accounts: restore default cursor in CcCropArea dialog
The CcCropArea dialog fails to update cursor to 'default'
one when leaving the CcCropArea into the GtkHeaderBar.

Fix that by setting 'default' cursor in the "leave" event
of CcCropArea.

Closes #2359
2023-02-20 10:56:38 +00:00
Nelson Benítez León
d57e152f57 user-accounts: close CcAvatarChooser before showing GtkFileChooser
so that the first click on the FileChooser is not used to just
close the CcAvatarChooser dialog.

Close issue #2315
2023-02-20 09:04:19 +00:00
Nelson Benítez León
3fcf9aa7f1 user-accounts: disallow commas in real name
Because real name is stored in the GECOS field of
/etc/passwd, which is delimited by commas that
cannot be escaped, the user's full name must not
contain a comma. More info at:
https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/83

Closes #888
2023-02-20 08:55:10 +00:00
Nelson Benítez León
947bb48985 users-account: fix CcCropArea dialog transient parent
the transient parent for the dialog was wrongly set to
its own window, causing following g_critical message:
Gtk-CRITICAL **: gtk_window_set_transient_for: assertion 'parent == NULL || GTK_IS_WINDOW (parent)' failed
2023-02-18 22:20:35 -04:00
Ray Strode
8a98497fb0 user-accounts: Don't access user before it's loaded
libaccountsservice documents that it is undefined to access an
ActUser object's properties before the 'is-loaded' property is
set to try.

Control-center unfortunately sometimes accesses objects that
aren't fully loaded, leading to log spew and memory corruption.

This commit fixes the problem by setting up a signal handler
to listen for the is-loaded notification when necessary.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2348
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2349
2023-02-17 09:45:18 +00:00
Nelson Benítez León
d1e64d0f13 user-accounts: Initialize CcAvatarChooser a bit earlier
Fixes following warning when activating Users panel:
user-accounts-cc-panel-WARNING **: Error retrieving app filter for user (null): User 4294967295 does not exist

Initialize CcAvatarChooser a bit earlier so it does
not get used by show_user() before creation.

Fixes #2219
2023-02-11 23:10:30 -04:00
Jake Dane
37a579b6b0 Replace "application" with "app"
This is part of an initiative to use "app" instead of "applications",
see: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123

Redo of !1539 that was closed by a ghosting user.

Replaces "application" with "app" in user facing strings in these
panels:

- applications
- camera, location, microphone
- default-apps
- multitasking
- notifications
- removable-media
- search
- usage
- user-accounts

Fixes: #2208.
2023-01-23 11:10:28 +00:00
Hari Rana
b1c14df48b user: Remove duplicate group property 2023-01-23 11:03:50 +00:00
Felipe Borges
294156c0f9 Drop most uses of deprecated gtk_style_context_add/remove_class
GtkStyleContext will be deprecated in gtk 4.10.
https://docs.gtk.org/gtk4/class.StyleContext.html

This preserves code blocks where additional GtkStyleContext operations
were used, such as gtk_style_context_save/restore.
2023-01-05 18:55:51 +00:00
Benjamin Berg
648ee20bdf avatar-chooser: Return a proper widget if images cannot be loaded
GTK assumes that a widget will be created for a flow box item. So always
return one instead of falling back to returning NULL. This can primarily
happen if an image loader is missing.
2022-12-06 18:11:45 +00:00
Mohammed Sadiq
150fc13a84 user-accounts: Reduce avatar size in "Other users"
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1498#note_1600864
2022-11-28 11:00:04 +00:00
Mohammed Sadiq
45656c4212 user-accounts: Fix account list styling
Fixes #1926
2022-11-28 11:00:04 +00:00
Mohammed Sadiq
f0f2865449 user: add-user-dialog: Use CcListRow for row with go-next icon 2022-11-25 20:52:28 +05:30
Mohammed Sadiq
14f2d0e6ef user: Use CcListRow where appropriate 2022-11-25 20:37:49 +05:30
Felipe Borges
b957dedd40 user-accounts: Style password entries as invalid only after interaction
Let's set the "error" style for unmatching passwords only after the
user interacts with the entries.

Fixes #2168
2022-11-23 12:36:45 +01:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Andy Chi
e0f22a04bb user-account: Return duplicate notification when the finger is exist 2022-10-20 10:09:04 +00:00
Felipe Borges
6b076a7765 user-accounts: Disconnect fingerprint reading devices when closing dialog
Otherwise when users close and reopen the window they will face a
“Failed to claim fingerprint device Synoptics Sensors: the device is
already claimed by another process” error message.

Fixes #1983
2022-09-22 14:32:33 +02:00
Mohammed Sadiq
38d62974b6 user-panel: Fix possible invalid free
The selected_user variable is unref on dispose(), and show_user()
is likely executed with self->selected_user already set to user,
but it's inconsistent, and so to be on the safer side, use
g_set_object()
2022-08-17 08:21:34 +00:00
Mohammed Sadiq
08b1f05a2a user-accounts: Fix a typo in property name 2022-08-15 07:55:36 +00:00
Nils Lück
3194a1890f Migrate CcPasswordDialog from AdwPreferencesWindow to AdwWindow 2022-08-12 01:24:10 +00:00
Felipe Borges
c2145cacf4 user-accounts: Use "title" styling for login history dialog header
See https://docs.gtk.org/gtk4/class.HeaderBar.html#gtkheaderbar-as-gtkbuildable

Fixes #1958
2022-08-03 11:16:26 +00:00
Mpho Jele
dea4ce1d48 user-accounts: Remove status icons from password entries
Adding the 'error' css class to icons visually indicates that
there's an issue with the input. This is the same purpose served
by the status icons. Another reason to remove the status icons
is that with the error class added to entries the entries dim
except for the status icons.
2022-08-03 09:58:41 +00:00
Mpho Jele
33a445f12e user-accounts: Make password dialog use libadwaita password entries 2022-08-03 09:58:41 +00:00
Felipe Borges
c381c633af user-accounts: Show "automatic login" option when locked
It should be made insensitive when the panel is locked, and sensitive
when locked.

We only hide this row for non-local users, where this setting doesn't
make much sense.

Fixes #1944
2022-08-03 09:39:59 +00:00
Mpho Jele
272b73795d user-accounts: Make back button switch to current user or panels list
When the window AdwLeaflet is folded the back button should either
switch to the panels list if the selected user is the current user
or switch to the current user if the selected user is from the
"other users" list
2022-07-24 15:29:46 +00:00
Mpho Jele
311268c4f7 user-accounts: Show the back button when window leaflet folds
Currently the back button is only shown when viewing a user from the
"other users" list.
These changes show the back button when the window AdwLeaflet is
folded or when the selected is from the "other users" list but never
when the window is not folded and the selected user is the current
user.

Fixes: #1719
2022-07-24 15:29:46 +00:00
Lukáš Tyrychtr
cf99eb4529 user-accounts: Set a11y label for login history dialog title
This was originally https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1402
2022-07-24 09:36:51 -05:00
Bilal Elmoussaoui
bb86c36147 panels: Use icon-name property instead
Don't embed a custom GtkImage as that would lack the appropriate style
classes
that GtkButton/GtkMenuButton would automatically add for us
2022-07-20 14:15:57 +02:00
Pablo Correa Gómez
bb4acf75ef user-accounts: run-passwd: Redirect stderr to stdout in the child
The previous code was prone to race conditions if the child already
started writing to stdout before the dup2 call happened. This has
been detected in postmarketOS[1] and I also reproduced it in Alpine
Linux. Since passwd writes to stderr and linux-pam to stdout, the
redirection was needed. However, linux-pam was failing with
"Conversation error" since an fprintf(stdout, ...) call wasn't
able to write to an already-closed stdout.

This problem is fixed by setting the redirection in the child setup
function and ignoring the stderr pipe. It also fixes a leak, where
the stderr fd was simply ignored and never closed.

[1] https://gitlab.com/postmarketOS/pmaports/-/issues/1449
2022-06-20 01:33:36 +00:00
Lukáš Tyrychtr
87ef7e25f6 Add a few missing a11y labels to the users panel 2022-06-19 21:41:09 +00:00
Robert Ancell
23d70d6952 user-accounts: Replace deprecated g_spawn_check_exit_status 2022-05-31 15:21:37 +12:00
Ritik Bhandari
46e8eafa92 user-accounts: Fixed typo from "organisation" to "organization" 2022-05-12 23:11:00 +00:00
koko ng
322bddd971 user-accounts: Close password change dialog
Fixes #1746
2022-04-19 15:08:49 +00:00
Felipe Borges
854c888214 user-accounts: Add cutout to avatar edit button
Shamelessly copied from
https://gitlab.gnome.org/GNOME/fractal/-/blob/fractal-next/data/resources/ui/content-room-details.ui#L29
and
https://gitlab.gnome.org/GNOME/fractal/-/blob/fractal-next/data/resources/style.css#L506

Fixes #1662
2022-03-07 15:59:46 +00:00
Felipe Borges
fb4f430f79 user-accounts: Drop unused CSS style 2022-03-07 15:59:46 +00:00
Felipe Borges
dfb2fa31af users: Make FileChooser inside AvatarChooser transient to main window
Depends on
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1253

Fixes #1677
2022-03-03 17:22:38 +01:00
Felipe Borges
dc032c338d user-accounts: Explicitly initialize CcAvatarChooser
Setting the Gtk.MenuButton.popover property to a CcAvatarChooser
object doesn't initialize the CcAvatarChooser object.

Fixes #1689
2022-03-03 16:13:46 +00:00
Felipe Borges
4b21c5b056 user-accounts: Load avatar image files in "Other users" list
We were checking for the existance of an image file as avatar when
setting up the main avatar widget in the page, but the same wasn't
done for the avatars displayed in the "Other users" list. These
were AdwAvatars simply initialized to use the user initials.

Now we load the user image (if it exists) and it will fallback to
initials when an image isn't set.

Fixes #1658
2022-03-02 16:04:26 +00:00
Felipe Borges
0019b0869a user-accounts: Reinstate fingerprint dialog
The port of the Fingerprint dialog to gtk4 wasn't completed.
Now the dialog is expected to function again.
2022-02-28 15:47:42 +00:00
Jonas Ådahl
5dc4081e2c sharing/remote-desktop: Initialize username/password if not set
If no password or username was set (not even an empty one), initialize
them to something, specifically the username of the user of the session,
and a auto generated password.
2022-02-26 18:19:14 +00:00
Pablo Correa Gómez
fcbe0c039b user-accounts: Try non TRANSLIT conversion if TRANSLIT conversion fails
This fixes a crash in musl-based systems, where TRANSLIT is not
implemented. I followed musl-maintainer recommendation[1] of doing
a run-time check to verify the behavior under these circumstances.

[1] https://github.com/akrennmair/newsbeuter/issues/364#issuecomment-250208235
2022-02-15 14:08:04 +00:00
Felipe Borges
1f693be757 user-accounts: Reset avatar widget when changing user pages
Otherwise the same source image is going to be used for other users
that don't have their own avatar image set.
2022-02-15 13:57:55 +00:00
Felipe Borges
26cc82c754 user-accounts: Always populate other users list
We were not re-populating the list when switching panels.

Related #1631
2022-02-09 15:04:32 +00:00
Felipe Borges
0bf91ed4d6 user-accounts: Fix crash while cancelling user rename
Fixes #1632
2022-02-09 10:51:45 +01:00
Georges Basile Stavracas Neto
59e3c32825 users: Set the activatable-widget property of various rows
It makes it slightly more convenient to interact with them,
since they become activatable.
2022-02-08 11:10:37 -03:00
Georges Basile Stavracas Neto
55072f54db users: Hide enterprise group in new users dialog
Otherwise we get a strange shadow at the bottom.
2022-02-08 11:05:51 -03:00
Georges Basile Stavracas Neto
998db79732 users: Cleanup and modernize CcLoginHistoryDialog
- Remove all 'can-focus' properties, rely on GTK defaults
 - Use AdwPreferencesPage internally
 - Make dialog resizable
 - Set 'icon-name' in header buttons instead of a GtkImage
2022-02-08 10:53:55 -03:00
Felipe Borges
7f8e90a966 user-accounts: Port to gtk4/libadwaita implementing the new design
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/raw/master/users/users.png
2022-02-08 13:29:56 +00:00