[gnome-calendar] Removed read-only sources from EditDialog.



commit 4c3e232623196497cf0d62a90ffdd5812e22dcbc
Author: Erick PÃrez Castellanos <erick red gmail com>
Date:   Sun Aug 26 11:33:00 2012 -0400

    Removed read-only sources from EditDialog.
    
    Removed disabled and read-only calendars from showing in GcalEditDialog.

 src/gcal-edit-dialog.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 036f374..16756fa 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -608,17 +608,31 @@ gcal_edit_dialog_set_manager (GcalEditDialog *dialog,
 
   while (valid)
     {
-      /* Walk through the list, reading each row */
+      gchar *uid;
       gchar *name;
+      gboolean active;
       GdkColor *color;
       GtkWidget *cal_image;
       GdkPixbuf *pix;
 
       gtk_tree_model_get (GTK_TREE_MODEL (sources_model), &iter,
+                          0, &uid,
                           1, &name,
+                          2, &active,
                           3, &color,
                           -1);
 
+      if (! active ||
+          gcal_manager_get_source_readonly (priv->manager, uid))
+        {
+          valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (sources_model),
+                                            &iter);
+          gdk_color_free (color);
+          g_free (name);
+          g_free (uid);
+          continue;
+        }
+
       item = gtk_image_menu_item_new ();
       g_object_set_data_full (G_OBJECT (item),
                               "sources-iter",
@@ -641,8 +655,9 @@ gcal_edit_dialog_set_manager (GcalEditDialog *dialog,
       gtk_container_add (GTK_CONTAINER (menu), item);
 
       g_object_unref (pix);
-      g_free (name);
       gdk_color_free (color);
+      g_free (name);
+      g_free (uid);
 
       valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (sources_model),
                                         &iter);



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