Commit graph

528 commits

Author SHA1 Message Date
Robert Ancell
8029b3e7be user-accounts: Rename UmPasswordDialog to CcPasswordDialog
Um is a naming hangover from before this was part of g-c-c.
2018-11-07 12:37:51 +13:00
Robert Ancell
2f68113950 user-accounts: Refactor password change handlers
Split the signal handler into two to remove quirky behaviour of clearing
the validation ticks depending on which GtkEntry generated the event.
2018-11-07 12:37:02 +13:00
Robert Ancell
c95f90b830 user-accounts: Use gchar consistently instead of char 2018-11-07 09:30:25 +13:00
Robert Ancell
cedbbd8eac user-accounts: Use g_auto in UmPasswordDialog 2018-11-07 09:30:25 +13:00
Robert Ancell
ad44ad4367 user-accounts: Convert UmPasswordDialog to GtkTemplate 2018-11-07 09:30:25 +13:00
Robert Ancell
ae90438bc8 user-accounts: Fix namespace of CcUserPanel
It wasn't correctly moved from the UM namespace when renamed in ec529e8.
This hasn't caused a problem, it's just a little confusing.
2018-11-06 16:00:36 +13:00
Robert Ancell
ec529e8566 user-accounts: Use GtkTemplate
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
Robert Ancell
71eefdd8f6 user-accounts: Fix user carousel not showing
This bug was introduced in 02559b0f69
2018-10-24 04:57:35 +00:00
Robert Ancell
f9e088d49e user-accounts: Use g_signal_connect_object with UmUserManager
The UmUserManager object could last longer than the panel. Use
g_signal_connect_object to do this automatically. Remove manual old method.

Connect signals in swapped form.
2018-10-23 06:41:21 +00:00
Robert Ancell
02559b0f69 user-accounts: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-18 01:18:57 +00:00
Ondrej Holy
f27b99e338 user-accounts: Fix libpwquality error handling
Always use pwquality_strerror()	in case	of error in order to prevent
memory leaks and to improve error messages.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/171
2018-09-10 22:04:23 +00:00
Ondrej Holy
64007ce52d user-accounts: Do not crash because of libpwquality failures
Users panel crashes with g_error() if some of libpwquality calls fails,
e.g. when pwquality.conf is broken. The default values should be used
instead of crash. Let's use g_warning() instead of g_error() in that
case.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/171
2018-09-10 22:04:23 +00:00
Ondrej Holy
44c5c9e50b user-accounts: Do not set user for password dialog redundantly
um_password_dialog_set_user() is called from on_permission_changed()
respective show_user(), which more or less means on every change in
the panel. It it pretty enough to call this before opening the password
dialog, which is already done over change_password() callback. Let's
remove the redundant call which may lead to unwanted failures among
others.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/171
2018-09-10 22:04:23 +00:00
Robert Ancell
49e8256a7e user-accounts: Don't mark empty strings as translatable 2018-08-24 11:33:32 +12:00
Ondrej Holy
70d8427b04 user-accounts: Add casts to suppress gcc warnings
"warning: passing argument 1 of ‘gtk_widget_destroy’ from incompatible
pointer type" is printed from g_clear_pointer, because it is more
type-safe now. See https://gitlab.gnome.org/GNOME/glib/issues/1425 for
more info. Add the necessary casts to suppress the warnings.
2018-08-15 22:12:12 +00:00
Yifan J
a1066a27e0 user-accounts: Remove implicit language setting
The commit targets to remove the behavior of implicit set of the language
when the user panel is clicked in g-c-c.

The behavior looks like introduced to partly resolve the bug [0] when the
gnome-initial-setup somehow did not set the language correctly. However the
gnome-initial-setup is able to handle the language nicely now.

Furthermore, the current user could not see its own language chooser in the
g-c-c User panel, instead the Region&Language panel is supposed to do the
task. And the Region&Language panel has already got a default locale set [1]
[2]. So even if the language is not set in the key file, it is less an issue
nowadays than when the issue was originally described in [0].

[0] https://bugzilla.gnome.org/show_bug.cgi?id=737216
[1] https://bugzilla.gnome.org/show_bug.cgi?id=767065
[2] https://gitlab.gnome.org/GNOME/gnome-control-center/commit/5e2ed8e

https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/161
2018-08-15 09:32:35 +00:00
Robert Ancell
148e4c8fd0 common: Use GtkTemplate for the language chooser dialog 2018-07-18 22:39:32 +00:00
Ondrej Holy
1e769bb49d user-accounts: Use term "Confirm" instead of "Verify"
The Password dialog uses "Verify New Password" and Add User dialog
"Confirm". Let's use "Confirm New Password" as it is on mockups to
be consistent in terminology.
2018-07-12 10:11:25 +02:00
Ondrej Holy
833c18bce4 user-accounts: Use the same phrase when passwords do not match
Use "The passwords do not match." phrase in the Add User dialog and
Password dialog consistently.
2018-07-12 10:11:25 +02:00
Robert Ancell
5e91cc7140 user-accounts: Correctly hide password mismatch warnings
The logic for the password mismatch warnings didn't handle the case where
you deleted both the passwords - it would still show them as not
matching.

Fix this by handling the three cases:
- Passwords are different
- Passwords are the same
- No passwords entered
2018-07-11 16:19:54 +02:00
Ondrej Holy
525adcf10b user-accounts: Fix entry sensitivity after password generation
If a password is generated and prefilled in the corresponding entries,
the verify entry remains insensitive. Let's fix the sensitivity...

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/38
2018-07-11 10:38:57 +02:00
Ondrej Holy
d07a67fcb3 user-accounts: Validate password before moving focus
If <tab> is pressed and password is not yet validated (ie. the verify
entry is not sensitive), focus skips the verify entry, even if the
password is strong enough. Let's validate the password when <tab> is
pressed (ie. before focus change) to prevent this <tab> breakage...

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/38
2018-07-11 10:38:57 +02:00
Ondrej Holy
ae16a8e7a0 Revert "user-accounts: Don't disable the verify password entry"
This reverts commit 7b3746af23.

This is needed to make obvious that password is not yet strong
enough.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/38
2018-07-11 10:38:57 +02:00
Sam Hewitt
24174173be common: update pixel_size values to base 16 for icon clarity 2018-07-10 17:52:08 -04:00
Robert Ancell
c461e436b7 user-accounts: Replace ifdefs with #pragma once 2018-06-01 11:04:18 +00:00
Robert Ancell
678beb6712 user-accounts: Replace GObject boilerplace with G_DECLARE_TYPE 2018-06-01 11:04:18 +00:00
Ondrej Holy
f4b1fb66a4 user-accounts: Fix hint for wrong enterprise user/password
A variable of label widget, used for a hint when wrong enterprise
user/password is used, is not properly initialized and thus criticals
are shown instead of the hint when user/password is wrong. Let's bind
the variable properly.
2018-05-12 04:12:43 +00:00
Ondrej Holy
85f267bfa7 user-accounts: Port UmRealmManager to GTask
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/20
2018-04-25 19:11:37 +02:00
Ondrej Holy
3cf277eb68 user-accounts: Port UmAccountDialog to GTask
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/20
2018-04-25 19:11:35 +02:00
Ondrej Holy
05c86d3fdc user-accounts: Prevent freeze caused by external cameras
cheese_camera_device_monitor_new freezes the whole panel when opening
for a couple of seconds if external camera is connected. This is not
acceptable. Probably it is bug in kernel. Let's use GAsyncInitable if
available.

Bump the cheese dependency accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=783789
2018-03-26 10:15:31 +02:00
Rasmus Thomsen
f957ce1776
user-accounts: fix building without cheese
https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/10
2018-03-20 17:24:04 +01:00
Georges Basile Stavracas Neto
a1bace4683 build: Drop libgd
Settings does not use libgd.
2018-03-16 15:55:10 -03:00
Georges Basile Stavracas Neto
23fadca422 user-accounts: Force symlink creation
So that we can run Settings more than once in GNOME Builder.
Without the -f flag, ln errs out after these symlinks are
created, and Builder refuses to run after that.
2018-03-06 22:02:58 -03:00
Ondrej Holy
2ef0e2aa89 user-accounts: Remove unused cell renderer
With the carousel, the custom user image cell renderer is no more needed.
2018-03-02 08:21:09 +00:00
Ondrej Holy
93f8920ae5 user-accounts: Do not show legacy face images
Legacy face images should not be shown in avatar chooser, so let's filter
all symlinks to the legacy files out.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/5
2018-03-02 08:59:49 +01:00
Ondrej Holy
6e4d75eaaf user-accounts: Add back legacy image faces
Commit ffe5aac8 introduced new set of face images and removed the old
ones. Consequently, generic avatar is shown for people after update.
Add back legacy images, so people won't lose their current images on
update. Add them into the subfolder and create symlinks for them,
so it can be simply filtered out from the chooser widget, because just
the new images should be shown.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/5
2018-03-02 08:59:49 +01:00
Ondrej Holy
ff0ec34161 user-accounts: Rename new face images which conflicts with old ones
We want to add back legacy images, so let's rename the new ones to not
be in a conflict. This unfortunately can cause another breakage for
people which uses development versions, but we can't do much about it.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/5
2018-03-02 08:59:49 +01:00
Ondrej Holy
7bc7aa6e59 user-accounts: Use GIO API for face images handling
GFile is needed for face widgets anyway, so let's use GFileEnumerator
for dir listing instead of POSIX API.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/5
2018-03-02 08:59:49 +01:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Bastien Nocera
9e6bed424f user-accounts: Update fingerprint strings from fprintd
Meaning that the strings used in the User Accounts panel should now
match the ones used in fprintd, and thus be translated.

https://bugzilla.gnome.org/show_bug.cgi?id=792630
2018-02-06 14:21:47 +01:00
Felipe Borges
028a06ff98 user-accounts: Introduce the new Avatar Chooser popover
This is based in the Avatar Chooser specifications available at
https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design

https://bugzilla.gnome.org/show_bug.cgi?id=766670
2018-02-05 16:18:24 +01:00
Felipe Borges
169a0b3d56 user-accounts: Introduce a UI template for UmPhotoDialog
https://bugzilla.gnome.org/show_bug.cgi?id=766670
2018-02-05 16:18:24 +01:00
Felipe Borges
3fb1c1dca1 user-accounts: Turn UmPhotoDialog in a full GObject
For the new avatar-chooser implementation we will use Gtk+ widget
composite templates.

https://bugzilla.gnome.org/show_bug.cgi?id=766670
2018-02-05 16:17:53 +01:00
Felipe Borges
0f893b7cff user-accounts: Make face images bigger
Now we present 72x72 faces in a 4x4 grid.

https://bugzilla.gnome.org/show_bug.cgi?id=792243
2018-02-05 16:17:10 +01:00
Felipe Borges
ffe5aac838 user-accounts: Update face images
The faces that are included in the users panel are really old,
the style is outdated and they are too small for modern designs
as well as hidpi screens.

https://bugzilla.gnome.org/show_bug.cgi?id=792243
2018-02-05 16:17:10 +01:00
Ondrej Holy
4e43bd6ce8 user-accounts: Prevent crashes if current user is not in carousel
In a specific cases, current user doesn't have to be returned from
accountsservice, or can be skipped by act_user_is_system_account check.
System users should not be shown. This is expected for root account,
but should not happen with regular user accounts. It needs to be fixed
in accountsservice if you see this happening with regular user accounts.
We have to be just sure that Users panel doesn't crash in such cases
and show all non-system user accounts returned from accountsservice.
Empty page is shown currently only if act_user_manager_list_users
returns nothing, but it has to be also shown if only system accounts
are returned. To fix this issue, do not try to show current user, but
show first user account in carousel instead if there is any. First user
account is current user in normal case.

The patch also fixes problems that current user account is sometimes
selected instead of currently selected user account. This is because
of preselection of first item in um_carousel_add, which causes unwanted
signal emissions...

https://bugzilla.gnome.org/show_bug.cgi?id=773673
2018-02-02 13:40:37 +01:00
Felipe Borges
a701b4646c user-accounts: Introduce an empty state page
There are eventually corner cases where there's no user other than
root in the system and control-center can be launched by the root
user (not recommended). In this cases, the panel crashes without
any user to show (since accountsservice would just list normal
users).

This patch introduces an empty state[0] "No Users Page".

[0] https://wiki.gnome.org/Design/OS/EmptyStates

https://bugzilla.gnome.org/show_bug.cgi?id=773673
2018-02-02 12:49:53 +01:00
Michael Catanzaro
09b94a9b53 user-accounts: Fix definition of MAXNAMELEN
Currently we get MAXNAMELEN from glibc's LOGIN_NAME_MAX, if available,
and sysconf otherwise. But the maximum username length supported by
glibc and the kernel is actually way larger than the maximum length that
actually works in practice. On Linux, anything larger than 32 characters
is not going to fit into utmp, and will therefore be rejected by
useradd. Then gnome-control-center will spit out a confusing error
message dialog.

Let's spare our users from that.

useradd (in shadow-utils) gets its max name size from the following
magic:

 /* Maximum length of usernames */
 #ifdef HAVE_UTMPX_H
 # include <utmpx.h>
 # define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
 #else
 # include <utmp.h>
 # ifdef HAVE_STRUCT_UTMP_UT_USER
 #  define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user))
 # else
 #  ifdef HAVE_STRUCT_UTMP_UT_NAME
 #   define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_name))
 #  else
 #   define USER_NAME_MAX_LENGTH 32
 #  endif
 # endif
 #endif

It's more work than necessary. utmpx is standardized by POSIX (it's
actually an XSI extension), whereas utmp is not, so let's just use
utmpx. This ought to work on at least FreeBSD as well. And if any free
operating systems that care about GNOME don't have utmpx yet, no doubt
they'll send patches.

https://bugzilla.gnome.org/show_bug.cgi?id=724193
2018-02-01 09:32:58 -06:00
Michael Catanzaro
0344f663dc user-accounts: Do not suggest usernames that are too long
We assume that we only generate valid usernames, so make sure they're
short enough to be used, else we'll display a dialog with a meaningless
error message when useradd fails.

Note that this commit doesn't completely fix the bug, as our definition
of MAXNAMELEN is different from useradd's.

https://bugzilla.gnome.org/show_bug.cgi?id=766401
2018-01-31 14:18:37 -06:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00