diff --git a/src/gcal-days-grid.c b/src/gcal-days-grid.c index 4403b010..b3bfab84 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 @@ -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 65734b77..78045c84 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__ */