datetime: Hide the NTP switch when the service is unavailable

https://bugzilla.gnome.org/show_bug.cgi?id=706378
This commit is contained in:
Kalev Lember 2013-08-24 19:43:53 +02:00
parent d0f9982875
commit ab1d1b0c54

View file

@ -792,12 +792,9 @@ static void
on_can_ntp_changed (CcDateTimePanel *self)
{
CcDateTimePanelPrivate *priv = self->priv;
GtkWidget *switch_widget;
gboolean sensitive = TRUE;
gboolean ntp_available = TRUE;
GVariant *value;
switch_widget = W("network_time_switch");
/* We need to access this directly so that we can default to TRUE if
* it is not set.
*/
@ -805,11 +802,12 @@ on_can_ntp_changed (CcDateTimePanel *self)
if (value)
{
if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN))
sensitive = g_variant_get_boolean (value);
ntp_available = g_variant_get_boolean (value);
g_variant_unref (value);
}
gtk_widget_set_sensitive (switch_widget, sensitive);
gtk_widget_set_visible (W ("auto-datetime-row"),
ntp_available);
}
static void