aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2010-06-21 23:03:13 +0800
committerXavier Claessens <xclaesse@gmail.com>2010-06-21 23:16:42 +0800
commitb0e035046ad5d3b9d483e8f74ef5f36149a73f16 (patch)
tree40d0773a90075a091f4f92d6475fa601250d1ff0 /libempathy-gtk
parent7ecb49662199bb39b38e38f58ab4dcf5e3393b7b (diff)
downloadgsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar.gz
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar.bz2
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar.lz
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar.xz
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.tar.zst
gsoc2013-empathy-b0e035046ad5d3b9d483e8f74ef5f36149a73f16.zip
Add "activate" signal on EmpathyLiveSearch
It is emitted when its GtkEntry is activated.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-live-search.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-live-search.c b/libempathy-gtk/empathy-live-search.c
index 97dac8791..fb358bef9 100644
--- a/libempathy-gtk/empathy-live-search.c
+++ b/libempathy-gtk/empathy-live-search.c
@@ -50,6 +50,14 @@ enum
PROP_TEXT
};
+enum
+{
+ ACTIVATE,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
static void live_search_hook_widget_destroy_cb (GtkObject *object,
gpointer user_data);
@@ -206,6 +214,13 @@ live_search_key_press_event_cb (GtkWidget *widget,
}
static void
+live_search_entry_activate_cb (GtkEntry *entry,
+ EmpathyLiveSearch *self)
+{
+ g_signal_emit (self, signals[ACTIVATE], 0);
+}
+
+static void
live_search_release_hook_widget (EmpathyLiveSearch *self)
{
EmpathyLiveSearchPriv *priv = GET_PRIV (self);
@@ -349,6 +364,14 @@ empathy_live_search_class_init (EmpathyLiveSearchClass *klass)
widget_class->show = live_search_show;
widget_class->grab_focus = live_search_grab_focus;
+ signals[ACTIVATE] = g_signal_new ("activate",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
param_spec = g_param_spec_object ("hook-widget", "Live Searchs Hook Widget",
"The live search catches key-press-events on this widget",
GTK_TYPE_WIDGET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -389,6 +412,8 @@ empathy_live_search_init (EmpathyLiveSearch *self)
G_CALLBACK (live_search_text_changed), self);
g_signal_connect (priv->search_entry, "key-press-event",
G_CALLBACK (live_search_entry_key_pressed_cb), self);
+ g_signal_connect (priv->search_entry, "activate",
+ G_CALLBACK (live_search_entry_activate_cb), self);
priv->hook_widget = NULL;