gcal-days-grid: added :get_by_uuid method
Added GcalView:get_by_uuid like method to use from GcalDayView and GcalWeekView
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user