diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-03-04 17:43:08 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-03-04 17:43:08 -0500 |
commit | 028e652e4dc2e5ec602654faeba366b777935086 (patch) | |
tree | 40cdd9c2d49484c37b135c920180c3116e89a053 /src | |
parent | 8b7e3b5283cc6bd28d023f4135f54656c6aca282 (diff) | |
download | ayatana-indicator-datetime-028e652e4dc2e5ec602654faeba366b777935086.tar.gz ayatana-indicator-datetime-028e652e4dc2e5ec602654faeba366b777935086.tar.bz2 ayatana-indicator-datetime-028e652e4dc2e5ec602654faeba366b777935086.zip |
preferences: Add CanNTP support
If timedated has the CanNTP property then use it to set the sensitivity
of the "Automatically from the internet" radio.
This property is only available in new versions of systemd, so if the
property is not set, leave the widget sensitive.
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime-prefs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index 2c6998a..13c0fc2 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -252,6 +252,17 @@ proxy_ready (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self) } /* And now, do initial proxy configuration */ + value = g_dbus_proxy_get_cached_property (priv->proxy, "CanNTP"); + if (value != NULL) + { + if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN)) + { + gtk_widget_set_sensitive (priv->auto_radio, g_variant_get_boolean (value)); + g_signal_connect (priv->auto_radio, "notify::active", G_CALLBACK (toggle_ntp), self); + } + g_variant_unref (value); + } + value = g_dbus_proxy_get_cached_property (priv->proxy, "NTP"); if (value != NULL) { |