[gnome-calendar] source-dialog: bind source::display-name with label::label



commit 023a79a90f4778517669bdaf1cbbe90ff0f05f6a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri May 1 23:15:01 2015 -0300

    source-dialog: bind source::display-name with label::label

 src/gcal-source-dialog.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index e6b3af9..7c77be1 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -590,6 +590,16 @@ is_goa_source (GcalSourceDialog *dialog,
   return is_goa;
 }
 
+static void
+invalidate_calendar_listbox_sort (GObject    *source,
+                                  GParamSpec *pspec,
+                                  gpointer    user_data)
+{
+  g_return_if_fail (GTK_IS_LIST_BOX (user_data));
+
+  gtk_list_box_invalidate_sort (GTK_LIST_BOX (user_data));
+}
+
 /**
  * make_row_from_source:
  *
@@ -632,6 +642,9 @@ make_row_from_source (GcalSourceDialog *dialog,
                             "xalign", 0.0,
                             "hexpand", TRUE,
                             NULL);
+  g_object_bind_property (source, "display-name", top_label, "label", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
+  g_signal_connect (source, "notify::display-name", G_CALLBACK (invalidate_calendar_listbox_sort),
+                    priv->calendars_listbox);
 
   /* parent source name label */
   bottom_label = g_object_new (GTK_TYPE_LABEL,


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