[gnome-control-center] display: Update the disabled banner when the interface changes



commit 8c93ec478f5339d8e2f43425d4d36e32bbfde686
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 10 13:24:07 2017 +0000

    display: Update the disabled banner when the interface changes
    
    GNOME Shell is setting this D-Bus property from the status menu when the
    natural light filter is disabled.

 panels/display/cc-natural-light-dialog.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/panels/display/cc-natural-light-dialog.c b/panels/display/cc-natural-light-dialog.c
index 49ac0ed..605dcde 100644
--- a/panels/display/cc-natural-light-dialog.c
+++ b/panels/display/cc-natural-light-dialog.c
@@ -276,7 +276,6 @@ dialog_mode_changed_cb (GtkToggleButton *togglebutton, CcNaturalLightDialog *sel
 static void
 dialog_undisable_call_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
-  CcNaturalLightDialog *self = (CcNaturalLightDialog *) user_data;
   g_autoptr(GVariant) val = NULL;
   g_autoptr(GError) error = NULL;
 
@@ -287,7 +286,6 @@ dialog_undisable_call_cb (GObject *source_object, GAsyncResult *res, gpointer us
       g_warning ("failed to undisable: %s", error->message);
       return;
     }
-  dialog_update_state (self);
 }
 
 static void
@@ -362,6 +360,15 @@ dialog_time_to_value_changed_cb (GtkAdjustment *adjustment, CcNaturalLightDialog
 }
 
 static void
+dialog_color_properties_changed_cb (GDBusProxy *proxy,
+                                    GVariant *changed_properties,
+                                    GStrv invalidated_properties,
+                                    CcNaturalLightDialog *self)
+{
+  dialog_update_state (self);
+}
+
+static void
 dialog_got_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
   CcNaturalLightDialog *self = (CcNaturalLightDialog *) user_data;
@@ -372,6 +379,8 @@ dialog_got_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_da
       g_warning ("failed to connect to g-s-d: %s", error->message);
       return;
     }
+  g_signal_connect (self->proxy_color, "g-properties-changed",
+                    G_CALLBACK (dialog_color_properties_changed_cb), self);
   dialog_update_state (self);
   self->timer_id = g_timeout_add_seconds (10, dialog_tick_cb, self);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]