Commit graph

758 commits

Author SHA1 Message Date
Cyber Phantom
aec265db7d user-accounts: Only show Other Users row when there is at least one other user 2023-07-19 08:44:16 +00:00
Felipe Borges
2bfc70782c user-accounts: Set widget sensitivities when we can't obtain GPermission
The banner will show a message indicating a failure to Unlock the panel,
but we still should "lock" widgets by making them sensitive accordingly
to the current permission.

Fixes !1708
2023-07-12 15:57:06 +00:00
velsinki
38ed5ec2df users: close CcAvatarChooser before GtkFileDialog
This makes sure the focus is immediately on the GtkFileDialog instead of
the CcAvatarChooser behind it. This was already added in !1685, but was
accidentally removed in !1822.

Fixes #2315
2023-07-11 11:30:46 +00:00
Lukáš Tyrychtr
701f7c6cf6 users-panel, cc-awatar-chooser: Don't request a symlink target for a file info when
it is not a symlink.

That previously caused a debug message, but will cause a g_critical.
Fixes #2547
2023-07-03 10:25:41 +00:00
Mohammed Sadiq
d4dee45d76 user-accounts: Fix some memory leaks 2023-07-03 01:56:24 +00:00
velsinki
b942a4a6b4 users: Draw avatar crop corners to inside of crop
The crop corners were drawn with the center of the corner lines at the
edges of the crop. This resulted in the corners being visually cut if
the crop is dragged to the edge of the image. Instead, we can draw the
corner lines such that they are inside the edge of the crop, i.e.
shifted by half their linewidth.

We now use relative moves to draw the lines, which simplifies the
movements.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1824>
2023-06-28 00:05:36 +00:00
velsinki
5e87979815 users: Improve rounding of avatar crop edges
If crop.x changes due to a drag, crop.x + crop.width remains fixed, as
thet is the opposite edge. However, in the mapping of paintable to
widget coordinates, crop->x + crop->width can vary due to rounding
errors. This fixes that, so that crop->x + crop->width does not vary,
with the same fix in the y direction.

However, the edges of the circle can still remain jittery due to integer
rounding, which is not fixed by using 'width / 2.0' instead of 'width /
2', since the width and height might differ by a pixel. Instead, draw an
ellipse, which removes edge jitter completely.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1824>
2023-06-28 00:05:36 +00:00
Automeris naranja
d621855dc8 users: Add mnemonics to the "Remove User" and "Add User" buttons 2023-06-27 16:22:56 -03:00
velsinki
44e1a1228f users: Improve avatar crop mechanics
The resizing and movement mechanics for the avatar crop can be finicky,
because:

1. The crop resets to the last valid crop when you drag out of range, so
   that a somewhat quick drag does not go to the edge.
2. A corner drag only works in one direction, as the use of
   eval_radial_line is not correct.
3. A side drag acts the same as a corner drag.
4. A slow drag won't move the crop, especially if the widget is larger.

All these issues are fixed with this partial rewrite of the resize and
movement logic:

1. A drag out of range will result in a size that is guaranteed to touch
   the edge, making a crop to the edge much easier.
2. Instead of fixing eval_radial_line, we just "bind" one side to the
   pointer position, making both directions act the same for a corner
   drag.
3. A side drag now scales around the center for the orthogonal side.
4. Rounding errors in calculating the previous delta are prevented.
2023-06-20 23:13:15 +00:00
Marcos Miller
14bd84dc19 user-accounts: use GtkFileDialog for select avatar image.
The GtkFileChooser interface is deprecated in gtk 4.10.

A new GtkFileDialog api is used.

user-accounts: code improvement
2023-06-07 23:43:17 +00:00
Robert Ancell
69406c3590 user-accounts: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
sunflowerskater
266c55715a general: Add tooltips to headerbar controls
Acc. HIG, "controls in the header bars of primary windows should all have tooltips".

https://developer.gnome.org/hig/patterns/feedback/tooltips.html
2023-06-06 13:27:00 +00:00
Felipe Borges
f6d5080ffd user-accounts: Fix pointer cast in sort_users function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1812>
2023-06-01 01:38:20 +00:00
Felipe Borges
c8fe38c4f1 user-accounts: Move "Add User" button out of the user listbox
Per mockups at
78b6a0506b/users/users.png

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1812>
2023-06-01 01:38:20 +00:00
Robert Ancell
39ccf2c610 user-accounts: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Automeris naranja
901f395e9e user-add-dialog: Use CCListRowInfoButton for the "Administrator" AdwActionRow
Follow-up from Follow-up from https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1571
2023-05-30 08:35:12 +00:00
Felipe Borges
e97429f0f6 Make dialogs close when pressing the Escape key
Fixes #2503
2023-05-25 23:24:00 +00:00
Gotam Gorabh
f9c75e6694 user-accounts:updated the remove user dialog with AdwMessageDialog
This commit will update the GUI of remove user dialog with AdwMessageDialog which
doesn't follow design guidelines. Re-desined according to https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/users/users.png

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2093
, https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2341
2023-05-24 08:57:30 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Mpho Jele
483a5f3e8d user-accounts: Use AdwEntryRow for user full name 2023-05-17 11:14:29 +02:00
Felipe Borges
45931c783f user-accounts: Make Administrator row use info button widget
Instead of recreating the menu button and popover.
2023-05-16 13:32:21 +00:00
Felipe Borges
d586df5c87 user-accounts: Add a popover describing the autologin functionality
Fixes #2235
2023-05-16 13:32:21 +00:00
sunflowerskater
1300d4b2d7 add-user-dialog: Add popover explaining about the "Administrator" option
This change adds a GtkPopover to explain about the "Administrator" option like in the mockups below:
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/users/add-user.png
2023-05-10 09:37:04 +00:00
sunflowerskater
1ba63a360c user-panel: Add popover explaining about the "Administrator" option
This change adds a GtkPopover to explain about the "Administrator" option like in the mockups below:
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/raw/master/users/users.png
2023-05-10 09:37:04 +00:00
Felipe Borges
61ba210c99 user-accounts: Remove autologin row tooltip when unlocked
Fixes #2451
2023-04-20 09:24:48 +00:00
Chris Mayo
92c4b6a706 Fix panel crashes due to unknown types in UI descriptions
Error building template class 'CcSearchPanel' for an instance of type 'CcSearchPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcDisplayPanel' for an instance of type 'CcDisplayPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcMousePanel' for an instance of type 'CcMousePanel': .:0:0 Invalid object type 'CcIllustratedRow'

Error building template class 'CcKeyboardPanel' for an instance of type 'CcKeyboardPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcRegionPanel' for an instance of type 'CcRegionPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcUaPanel' for an instance of type 'CcUaPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcUserPanel' for an instance of type 'CcUserPanel': .:0:0 Invalid object type 'CcAvatarChooser'
Error building template class 'CcUserPanel' for an instance of type 'CcUserPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcDateTimePanel' for an instance of type 'CcDateTimePanel': .:0:0 Invalid object type 'CcTzDialog'
cc_tz_dialog_get_selected_location: assertion 'CC_IS_TZ_DIALOG (self)' failed
dumped core
Error building template class 'CcDateTimePanel' for an instance of type 'CcDateTimePanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcInfoOverviewPanel' for an instance of type 'CcInfoOverviewPanel': .:0:0 Invalid object type 'CcHostnameEntry'
2023-04-17 12:14:58 +00:00
Christopher Davis
d25c0e345d general: Use AdwBanner in CcPermissionInfobar
AdwBanner is a new adaptive widget that replaces GtkInfoBar.
AdwBanner adapts better to mobile sizes and has an API
that fits with how we use infobars.

This commit changes CcPermissionInfobar to use an AdwBanner
internally instead of a GtkInfoBar. It also re-implements
part of GtkLockButton, as AdwBanner does not support adding
arbitrary widgets.
2023-04-11 12:23:16 +00:00
Maksym Hazevych
9b155f6c5c user-accounts: Set language-chooser to hide on close 2023-03-29 14:26:55 +13:00
Maksym Hazevych
08c2e69851 Resolving suggestions 2023-03-29 14:26:55 +13:00
Maksym Hazevych
e00f773b2f Remove unnecessary visibility change 2023-03-29 14:26:55 +13:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
Gotam Gorabh
a14a4513a2 removed dead variable 2023-03-24 08:38:03 +00:00
Gotam Gorabh
19d611ad03 user-accounts: Removed account activity window
This changes remove the account activity window or
login history as it is less used or no use.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2096
2023-03-24 08:38:03 +00:00
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