[gnome-calendar/search-improvements] window: properly hear GcalSearchView::'event-activated' signal
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/search-improvements] window: properly hear GcalSearchView::'event-activated' signal
- Date: Tue, 6 Jan 2015 20:21:33 +0000 (UTC)
commit 960310017d5d07246daf6c4b359770440707f925
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Jan 6 18:20:13 2015 -0200
window: properly hear GcalSearchView::'event-activated' signal
Data passed by search view's signal is different
from the other views, so special case this into
a new function.
src/gcal-window.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index a776e0b..1a2bd3d 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -127,6 +127,10 @@ static gboolean key_pressed (GtkWidget *w
static void date_updated (GtkButton *buttton,
gpointer user_data);
+static void search_event_selected (GcalSearchView *search_view,
+ icaltimetype *date,
+ gpointer user_data);
+
static void load_geometry (GcalWindow *window);
static gboolean save_geometry (gpointer user_data);
@@ -308,6 +312,16 @@ date_updated (GtkButton *button,
}
static void
+search_event_selected (GcalSearchView *search_view,
+ icaltimetype *date,
+ gpointer user_data)
+{
+ g_object_set (user_data, "active-date", date, NULL);
+ update_view (GCAL_WINDOW (user_data));
+ gcal_window_set_search_mode (GCAL_WINDOW (user_data), FALSE);
+}
+
+static void
load_geometry (GcalWindow *window)
{
GcalApplication *app;
@@ -1366,7 +1380,8 @@ gcal_window_constructed (GObject *object)
}
}
- g_signal_connect (priv->views[GCAL_WINDOW_VIEW_SEARCH], "event-activated", G_CALLBACK (event_activated),
object);
+ g_signal_connect (priv->views[GCAL_WINDOW_VIEW_SEARCH], "event-activated", G_CALLBACK
(search_event_selected),
+ object);
/* refresh timeout, first is fast */
priv->refresh_timeout_id = g_timeout_add (FAST_REFRESH_TIMEOUT, (GSourceFunc) refresh_sources, object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]