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 707252 - datetime: Show the automatic timezone switch
datetime: Show the automatic timezone switch
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Date and Time
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: Zeeshan Ali
Control-Center Maintainers
Depends on: 707191 707200
Blocks:
 
 
Reported: 2013-09-02 01:42 UTC by Kalev Lember
Modified: 2013-09-02 20:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
datetime: Rename settings to clock_settings (3.01 KB, patch)
2013-09-02 01:43 UTC, Kalev Lember
committed Details | Review
datetime: Exit early if the timedate1 service isn't available (3.16 KB, patch)
2013-09-02 01:43 UTC, Kalev Lember
committed Details | Review
datetime: Move polkit initialization earlier (2.52 KB, patch)
2013-09-02 01:43 UTC, Kalev Lember
committed Details | Review
datetime: Use GObject property binding for the NTP switch (5.76 KB, patch)
2013-09-02 01:43 UTC, Kalev Lember
committed Details | Review
datetime: Show the automatic timezone switch (3.71 KB, patch)
2013-09-02 01:43 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2013-09-02 01:42:12 UTC
Automatic time zone updating is last major missing piece from the Date & Time redesign. The backend in gnome-settings-daemon is now functional, so we can finally expose the option in the control center UI.

http://wiki.gnome.org/Design/SystemSettings/DateAndTime#Guidelines

(Sorry, I got a bit carried away and cleaned up some surrounding code as well.)
Comment 1 Kalev Lember 2013-09-02 01:43:00 UTC
Created attachment 253793 [details] [review]
datetime: Rename settings to clock_settings
Comment 2 Kalev Lember 2013-09-02 01:43:04 UTC
Created attachment 253794 [details] [review]
datetime: Exit early if the timedate1 service isn't available

We cannot meaningfully change (or display) any Date & Time system
settings without the timedate1 DBus service, so just exit early.
Comment 3 Kalev Lember 2013-09-02 01:43:08 UTC
Created attachment 253795 [details] [review]
datetime: Move polkit initialization earlier

... so that in the following commit, we can rely on the permissions
being available.

While at this, also create a DATETIME_PERMISSION for the PolicyKit
action ID at the top of the file.
Comment 4 Kalev Lember 2013-09-02 01:43:12 UTC
Created attachment 253796 [details] [review]
datetime: Use GObject property binding for the NTP switch

This makes it possible to remove the code for manually keeping the NTP
switch and the timedated1 DBus proxy properties in sync, and also makes
it easy to share code with the automatic timezone switch.
Comment 5 Kalev Lember 2013-09-02 01:43:16 UTC
Created attachment 253797 [details] [review]
datetime: Show the automatic timezone switch

The backend in gnome-settings-daemon is now functional, so we can expose
the option in the UI.
Comment 6 Zeeshan Ali 2013-09-02 13:42:33 UTC
Review of attachment 253793 [details] [review]:

ack, could be pushed as trivial fix.
Comment 7 Zeeshan Ali 2013-09-02 13:48:58 UTC
Review of attachment 253794 [details] [review]:

ACK

::: panels/datetime/cc-datetime-panel.c
@@ +600,3 @@
   const gchar *timezone;
 
+  timezone = timedate1_get_timezone (self->priv->dtm);

btw, would be nice to change the name of 'dtm' field. Unknown abbreviations make up for unreadable code.
Comment 8 Zeeshan Ali 2013-09-02 13:51:45 UTC
Review of attachment 253795 [details] [review]:

ACK (depending on the resolution of following commit.
Comment 9 Zeeshan Ali 2013-09-02 13:59:27 UTC
Review of attachment 253796 [details] [review]:

Looks good
Comment 10 Zeeshan Ali 2013-09-02 14:05:09 UTC
Review of attachment 253797 [details] [review]:

Looks good apart from these nitpicks

::: panels/datetime/cc-datetime-panel.c
@@ +748,3 @@
   allowed = (priv->permission == NULL || g_permission_get_allowed (priv->permission));
   using_ntp = gtk_switch_get_active (GTK_SWITCH (W("network_time_switch")));
+  auto_timezone = gtk_switch_get_active (GTK_SWITCH (W("auto_timezone_switch")));

Would have been nice if all widgets in UI file used the same format for naming, either '-' or '_'.

@@ -747,1 @@
-  /* All the widgets but the lock button and the 24h setting */

Seems very irrelevant
Comment 11 Kalev Lember 2013-09-02 14:44:49 UTC
> -  /* All the widgets but the lock button and the 24h setting */
> 
> Seems very irrelevant

Ah yes, I misread what the comment said and thought it's obsolete now; I've added it back.
Comment 12 Kalev Lember 2013-09-02 20:07:45 UTC
Thanks for the reviews!

Attachment 253793 [details] pushed as a709ae4 - datetime: Rename settings to clock_settings
Attachment 253794 [details] pushed as d7847fe - datetime: Exit early if the timedate1 service isn't available
Attachment 253795 [details] pushed as 853fb8c - datetime: Move polkit initialization earlier
Attachment 253796 [details] pushed as 88f4c30 - datetime: Use GObject property binding for the NTP switch
Attachment 253797 [details] pushed as c68f9ec - datetime: Show the automatic timezone switch