When the month row value is changed, the signal callback uses
the year value from the year spin button. So set year value
before month is set so that the year is set to a valid value
thus avoiding a crash with invalid year.
Using g_date_time_format to get the name of the month
translates the name according to LC_TIME. This is inconsistent
with all other labels displayed, which get translated according
to LC_MESSAGES. By taking the label from the corresponding
entry in the GtkFlowBox, we avoid the incosistency
Fixes#1507
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
g_time_zone_new() is deprecated in favour of g_time_zone_new_identifier().
g_time_zone_new_identifier() returns NULL if no matching identifier is
found, so warn and fallback to UTC in that case.
We cannot simply set the state/active property of the switch without
also triggering the notify:: or state-set signals at the same time. As
such, we need to block the "set-state" handler when we update the
"state" of the switch.
Also, while at it, change the switch to react to "state-set" and only
update the "state" after we received the response from the system.
Fixes: #1299
When the user disables the use of location services in the privacy
panel, then the timezone will never be updated automatically. Automatic
timezone may still be enabled though, so we need to allow the user to
change the timezone when location services are disabled or when
automatic timezone updating is disabled.
Only the date time panel used it, all other panels add their own shell using
cc_shell_embed_widget_in_header which was added after the date time panel was
written. Update the date time panel to use this method.
The following warning occurs when the datetime panel is created:
(gnome-control-center:3173): GLib-GIO-CRITICAL **: 09:18:38.531: g_settings_get_value: assertion 'G_IS_SETTINGS (settings)' failed
This is due to the callback being called before the settings object is created
Automatic timezone does not work if location sharing is disabled in privacy.
Grays out automatic timezone setting if location sharing is disabled in privacy
settings. Enable automatic timezone seting if location sharing is enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=788714
As changing the time can have security implications, such as expiring
passwords, while changing the timezone doesn't, it's not unusual to
have a setup where org.freedesktop.timedate1.set-timezone is allowed
while other time-related actions aren't.
Therefore, if org.freedesktop.timedate1.set-timezone is allowed, there's
no reason to require that the user unlocks the panel to enable them to
change the timezone.
https://bugzilla.gnome.org/show_bug.cgi?id=646185
If the system does not support NTP (as determined by the presence of an
NTP unit in /usr/lib/systemd/ntp-units.d), the Automatic Date & Time row
is intended to be hidden. We respond to changes to timedated's CanNTP
property, but we never account for the initial state of the property,
so we wind up displaying the Automatic Date & Time row even though the
switch is guaranteed to be broken.
Check CanNTP when initializing the panel to fix this.
https://bugzilla.gnome.org/show_bug.cgi?id=732021
GTK+ now uses a 12h/24h setting in the org.gtk.Settings.FileChooser
schema to switch the time display in the file chooser. Set this
to be in sync with the global time format preference we have.
https://bugzilla.gnome.org/show_bug.cgi?id=722942
This caused criticals when on_permission_changed callback tried to
access priv->datetime_dialog or priv->timezone_dialog before they had
been set up.
Another attempt at fixing the leak in the following patch.
This reverts commit 545c886543.
https://bugzilla.gnome.org/show_bug.cgi?id=709443
Instead of hardcoding the accessible name as "Switch between AM and
PM.", set it to "AM" or "PM" depending on which label the stack switcher
is currently showing.
https://bugzilla.gnome.org/show_bug.cgi?id=708219