datetime: Hide the NTP switch when the service is unavailable
https://bugzilla.gnome.org/show_bug.cgi?id=706378
This commit is contained in:
parent
d0f9982875
commit
ab1d1b0c54
1 changed files with 4 additions and 6 deletions
|
@ -792,12 +792,9 @@ static void
|
||||||
on_can_ntp_changed (CcDateTimePanel *self)
|
on_can_ntp_changed (CcDateTimePanel *self)
|
||||||
{
|
{
|
||||||
CcDateTimePanelPrivate *priv = self->priv;
|
CcDateTimePanelPrivate *priv = self->priv;
|
||||||
GtkWidget *switch_widget;
|
gboolean ntp_available = TRUE;
|
||||||
gboolean sensitive = TRUE;
|
|
||||||
GVariant *value;
|
GVariant *value;
|
||||||
|
|
||||||
switch_widget = W("network_time_switch");
|
|
||||||
|
|
||||||
/* We need to access this directly so that we can default to TRUE if
|
/* We need to access this directly so that we can default to TRUE if
|
||||||
* it is not set.
|
* it is not set.
|
||||||
*/
|
*/
|
||||||
|
@ -805,11 +802,12 @@ on_can_ntp_changed (CcDateTimePanel *self)
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
if (g_variant_is_of_type (value, G_VARIANT_TYPE_BOOLEAN))
|
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);
|
g_variant_unref (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_set_sensitive (switch_widget, sensitive);
|
gtk_widget_set_visible (W ("auto-datetime-row"),
|
||||||
|
ntp_available);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue