[gnome-calendar/calendar-editor] window: refresh calendar list when a source is edited



commit d08faa0c156b72efe660d0264bb96c56e39f91fc
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Feb 9 17:10:32 2015 -0200

    window: refresh calendar list when a source is edited

 src/gcal-window.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 6e2fd0d..1938b6b 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -837,6 +837,7 @@ source_row_activated (GtkListBox    *listbox,
                       gpointer       user_data)
 {
   GcalWindowPrivate *priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
+  GtkWidget *new_row;
   ESource *source;
   GList *l, *aux;
 
@@ -864,6 +865,14 @@ source_row_activated (GtkListBox    *listbox,
   gtk_dialog_run (GTK_DIALOG (priv->source_dialog));
   gtk_widget_hide (priv->source_dialog);
 
+  /* update the source */
+  new_row = make_row_for_source (GCAL_WINDOW (user_data), source);
+
+  g_hash_table_remove (priv->calendar_source_to_row, source);
+  g_hash_table_insert (priv->calendar_source_to_row, source, new_row);
+
+  gtk_container_add (GTK_CONTAINER (priv->calendar_listbox), new_row);
+
   g_list_free (l);
 }
 


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