After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694922 - Users' region and language settings should be applied system-wide when there's only one user
Users' region and language settings should be applied system-wide when there'...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
3.8
Depends on:
Blocks:
 
 
Reported: 2013-03-01 10:18 UTC by Allan Day
Modified: 2013-04-12 14:54 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
region: Apply user settings system-wide on single account systems (3.93 KB, patch)
2013-04-09 00:51 UTC, Rui Matos
none Details | Review
region: Fix setting the system language (1.90 KB, patch)
2013-04-09 00:52 UTC, Rui Matos
committed Details | Review
region: Apply user settings system-wide on single account systems (4.33 KB, patch)
2013-04-09 12:37 UTC, Rui Matos
reviewed Details | Review
region: Apply user settings system-wide on single account systems (4.47 KB, patch)
2013-04-12 11:53 UTC, Rui Matos
committed Details | Review

Description Allan Day 2013-03-01 10:18:48 UTC
When there's only one user, there's no conceptual difference between user settings and system settings: it's just "the device". In this case we should apply the user's settings to the system. If they change the display language, this should automatically be reflected in the login screen rather than having to do the extra work involved in apply their settings to the system.

This change has the added advantage of meaning that we don't have to show the "Login Settings" button when there's only one user. (This is actually already the case with the new Region and Language settings design - it means that we don't currently have a way for someone to change the login screen options if there is only one user on the system.)
Comment 1 Rui Matos 2013-03-01 10:29:00 UTC
Indeed, with the current code in master it's impossible to change the system settings on a single user system. Auto-applying to the system will fix that. Let's see if we can manage to do that without throwing a policy-kit password dialog at the user...
Comment 2 Bastien Nocera 2013-03-01 11:27:22 UTC
It should check whether that single user is an admin or not, and offer the "login settings" tab otherwise.
Comment 3 Matthias Clasen 2013-03-01 19:14:44 UTC
checking for admin does not really tell you whether the action will or will not be allowed or whether a polkit dialog will pop up
Comment 4 Matthias Clasen 2013-03-01 19:17:01 UTC
we should do a non-interactive polkit check, and depending on the result:
yes -> no button, apply automatically
challenge -> show button
no -> show button anyway, but display settings readonly (so people can learn about the systemwide settings)
Comment 5 Rui Matos 2013-04-09 00:51:23 UTC
Created attachment 241002 [details] [review]
region: Apply user settings system-wide on single account systems

On single account systems we don't show the login button but the user
should still be able to set system-wide locale settings. We can simply
export the user's own settings to the system in that case.
--

(In reply to comment #4)
> we should do a non-interactive polkit check, and depending on the result:

The only way I found to do a non-interactive polkit check was to add
these actions to the .rules file we ship which checks if the user is
in the wheel unix group. Is there a better way?
Comment 6 Rui Matos 2013-04-09 00:52:56 UTC
Created attachment 241003 [details] [review]
region: Fix setting the system language

We need to actually change the variable holding the system language so
that it gets applied.
--

This is a brown paper bag fix for a bug I introduced shortly before
3.8.0.
Comment 7 Rui Matos 2013-04-09 12:37:51 UTC
Created attachment 241055 [details] [review]
region: Apply user settings system-wide on single account systems

--

* Added a fix for the case where the user manager object is already
  loaded, since it's a singleton used elsewhere, in which case the
  signal handler would never run.
Comment 8 Bastien Nocera 2013-04-12 11:09:54 UTC
Review of attachment 241003 [details] [review]:

Looks good.
Comment 9 Bastien Nocera 2013-04-12 11:13:06 UTC
Review of attachment 241055 [details] [review]:

Rest looks fine.

::: panels/region/cc-region-panel.c
@@ +1680,3 @@
+                set_login_button_visibility (self);
+        else
+                g_signal_connect_swapped (priv->user_manager, "notify::is-loaded",

You need to check that the is-loaded is actually TRUE though. We might get notify:: of properties changing even if it didn't really change.
Comment 10 Rui Matos 2013-04-12 11:53:03 UTC
Created attachment 241344 [details] [review]
region: Apply user settings system-wide on single account systems

--

Now checking that the property really changed inside the handler.
Comment 11 Bastien Nocera 2013-04-12 13:29:07 UTC
Review of attachment 241344 [details] [review]:

Looks good.
Comment 12 Rui Matos 2013-04-12 14:54:10 UTC
Attachment 241003 [details] pushed as 29e96e4 - region: Fix setting the system language
Attachment 241344 [details] pushed as 98adcbf - region: Apply user settings system-wide on single account systems