[gnome-calendar/search-improvements] search-view: properly connect 'row-activated' signal



commit 051787c864412cfdb409d390d4625cce8b8203e0
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jan 6 18:13:49 2015 -0200

    search-view: properly connect 'row-activated' signal

 data/ui/search-view.ui |    1 +
 src/gcal-search-view.c |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/search-view.ui b/data/ui/search-view.ui
index 77f577a..817569b 100644
--- a/data/ui/search-view.ui
+++ b/data/ui/search-view.ui
@@ -30,6 +30,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="selection_mode">none</property>
+                    <signal name="row-activated" handler="open_event" object="GcalSearchView" swapped="no"/>
                     <style>
                       <class name="search-list"/>
                     </style>
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index e706c7d..96dc61b 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -76,7 +76,8 @@ static gint           sort_by_event                             (GtkListBoxRow
                                                                  GtkListBoxRow        *row2,
                                                                  gpointer              user_data);
 
-static void           open_event                                (GtkListBoxRow        *row,
+static void           open_event                                (GtkListBox           *list,
+                                                                 GtkListBoxRow        *row,
                                                                  gpointer              user_data);
 
 static void           free_row_data                             (RowEventData          *data);
@@ -272,7 +273,8 @@ sort_by_event (GtkListBoxRow *row1,
 }
 
 static void
-open_event (GtkListBoxRow *row,
+open_event (GtkListBox    *list,
+            GtkListBoxRow *row,
             gpointer       user_data)
 {
   GcalSearchViewPrivate *priv;
@@ -360,6 +362,8 @@ gcal_search_view_class_init (GcalSearchViewClass *klass)
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, no_results_grid);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, frame);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GcalSearchView, listbox);
+
+  gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), open_event);
 }
 
 static void


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