[gnome-calendar] gcal-days-grid: added :get_by_uuid method



commit cd60f84bb8798acc69c0ccd56887463c6eb73aef
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Wed Jun 12 11:52:50 2013 -0400

    gcal-days-grid: added :get_by_uuid method
    
    Added GcalView:get_by_uuid like method to use from GcalDayView and GcalWeekView

 src/gcal-days-grid.c |   39 +++++++++++++++++++++++++++++++++++++++
 src/gcal-days-grid.h |    3 +++
 2 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-days-grid.c b/src/gcal-days-grid.c
index 4403b01..b3bfab8 100644
--- a/src/gcal-days-grid.c
+++ b/src/gcal-days-grid.c
@@ -19,6 +19,7 @@
  */
 
 #include "gcal-days-grid.h"
+#include "gcal-event-widget.h"
 
 #include <glib/gi18n.h>
 
@@ -685,3 +686,41 @@ gcal_days_grid_place (GcalDaysGrid *all_day,
 
   gtk_widget_set_parent (widget, GTK_WIDGET (all_day));
 }
+
+GtkWidget*
+gcal_days_grid_get_by_uuid (GcalDaysGrid *days_grid,
+                            const gchar  *uuid)
+{
+  GcalDaysGridPrivate *priv;
+
+  GList* columns;
+
+  priv = days_grid->priv;
+
+  columns = priv->children;
+  while (columns)
+    {
+      GList *column;
+
+      column = columns->data;
+      columns = columns->next;
+
+      while (column)
+        {
+          GcalEventWidget *event;
+
+          ChildInfo *info = (ChildInfo*) column->data;
+          column  = column->next;
+
+          event = GCAL_EVENT_WIDGET (info->widget);
+
+          if (g_strcmp0 (uuid,
+                         gcal_event_widget_peek_uuid (event)) == 0)
+            {
+              return info->widget;
+            }
+        }
+    }
+
+  return NULL;
+}
diff --git a/src/gcal-days-grid.h b/src/gcal-days-grid.h
index 65734b7..78045c8 100644
--- a/src/gcal-days-grid.h
+++ b/src/gcal-days-grid.h
@@ -62,6 +62,9 @@ void           gcal_days_grid_place                     (GcalDaysGrid   *days_gr
                                                         guint           column_idx,
                                                         guint           cell_idx);
 
+GtkWidget*     gcal_days_grid_get_by_uuid               (GcalDaysGrid   *days_grid,
+                                                        const gchar    *uuid);
+
 G_END_DECLS
 
 #endif /* __GCAL_DAYS_GRID_H__ */


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