[gnome-calendar/search-improvements] search-view: emit GcalSearchView::'event-activated' signal
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/search-improvements] search-view: emit GcalSearchView::'event-activated' signal
- Date: Tue, 6 Jan 2015 20:21:22 +0000 (UTC)
commit 633f1e80aac648384686ce59e0cd666439c203c1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Jan 6 18:04:20 2015 -0200
search-view: emit GcalSearchView::'event-activated' signal
Needed so that GcalWindow can go to the selected event's date.
src/gcal-search-view.c | 24 +++++++++++++++++++-----
src/gcal-search-view.h | 2 +-
2 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 0d9db06..e706c7d 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -76,7 +76,7 @@ static gint sort_by_event (GtkListBoxRow
GtkListBoxRow *row2,
gpointer user_data);
-static void open_event (GcalEventWidget *event_widget,
+static void open_event (GtkListBoxRow *row,
gpointer user_data);
static void free_row_data (RowEventData *data);
@@ -272,10 +272,24 @@ sort_by_event (GtkListBoxRow *row1,
}
static void
-open_event (GcalEventWidget *event_widget,
- gpointer user_data)
+open_event (GtkListBoxRow *row,
+ gpointer user_data)
{
- g_signal_emit_by_name (user_data, "event-activated", event_widget);
+ GcalSearchViewPrivate *priv;
+ GcalEventData *data;
+ ECalComponentDateTime dt;
+ icaltimetype *time;
+
+
+ priv = gcal_search_view_get_instance_private (GCAL_SEARCH_VIEW (user_data));
+ data = g_hash_table_lookup (priv->row_to_event, row);
+
+ e_cal_component_get_dtstart (data->event_component, &dt);
+ time = gcal_dup_icaltime (dt.value);
+
+ g_signal_emit_by_name (user_data, "event-activated", time);
+
+ e_cal_component_free_datetime (&dt);
}
static void
@@ -320,7 +334,7 @@ gcal_search_view_class_init (GcalSearchViewClass *klass)
signals[EVENT_ACTIVATED] = g_signal_new ("event-activated", GCAL_TYPE_SEARCH_VIEW, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GcalSearchViewClass, event_activated),
NULL, NULL, NULL,
- G_TYPE_NONE, 1, GCAL_TYPE_EVENT_WIDGET);
+ G_TYPE_NONE, 1, ICAL_TIME_TYPE);
/* properties */
g_object_class_install_property (
diff --git a/src/gcal-search-view.h b/src/gcal-search-view.h
index 96c0a96..ffffde3 100644
--- a/src/gcal-search-view.h
+++ b/src/gcal-search-view.h
@@ -47,7 +47,7 @@ struct _GcalSearchViewClass
GtkScrolledWindowClass parent_class;
/* signals */
- void (*event_activated) (GcalSearchView *view, GcalEventWidget *event_widget);
+ void (*event_activated) (GcalSearchView *view, icaltimetype *date);
};
GType gcal_search_view_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]