aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-23 15:24:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-23 15:24:50 +0000
commit58aceebeceb618d0b7b4a3a9f7bee35d75bf1126 (patch)
tree7828371027a250857ec60110cf1a6b82ae7b3804
parent419a14181150b9f9de0ad57f2aa23dd0f8a1dc1a (diff)
downloadgnunet-gtk-58aceebeceb618d0b7b4a3a9f7bee35d75bf1126.tar.gz
gnunet-gtk-58aceebeceb618d0b7b4a3a9f7bee35d75bf1126.zip
-LRN: start search on enter
-rw-r--r--contrib/gnunet_fs_gtk_main_window.glade1
-rw-r--r--src/fs/gnunet-fs-gtk.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/contrib/gnunet_fs_gtk_main_window.glade b/contrib/gnunet_fs_gtk_main_window.glade
index 4425dede..39337632 100644
--- a/contrib/gnunet_fs_gtk_main_window.glade
+++ b/contrib/gnunet_fs_gtk_main_window.glade
@@ -1222,6 +1222,7 @@
1222 <property name="secondary_icon_activatable">False</property> 1222 <property name="secondary_icon_activatable">False</property>
1223 <property name="primary_icon_sensitive">True</property> 1223 <property name="primary_icon_sensitive">True</property>
1224 <property name="secondary_icon_sensitive">True</property> 1224 <property name="secondary_icon_sensitive">True</property>
1225 <signal name="key-press-event" handler="main_window_search_entry_key_press_event_cb" swapped="no"/>
1225 </object> 1226 </object>
1226 <packing> 1227 <packing>
1227 <property name="expand">True</property> 1228 <property name="expand">True</property>
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index f11647d9..27ca9eee 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -25,6 +25,7 @@
25 */ 25 */
26#include "gnunet-fs-gtk-common.h" 26#include "gnunet-fs-gtk-common.h"
27#include "gnunet-fs-gtk-event_handler.h" 27#include "gnunet-fs-gtk-event_handler.h"
28#include <gdk/gdkkeysyms.h>
28 29
29/** 30/**
30 * Should gnunet-fs-gtk start in tray mode? 31 * Should gnunet-fs-gtk start in tray mode?
@@ -537,6 +538,27 @@ main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data)
537 GNUNET_FS_uri_destroy (uri); 538 GNUNET_FS_uri_destroy (uri);
538} 539}
539 540
541#ifndef GDK_KEY_Return
542#define GDK_KEY_Return GDK_Return
543#endif
544
545gboolean
546main_window_search_entry_key_press_event_cb (GtkWidget *widget,
547 GdkEventKey *event, gpointer user_data)
548{
549 GtkBuilder *builder;
550 builder = GTK_BUILDER (user_data);
551
552 if (event->keyval == GDK_KEY_Return)
553 {
554 GtkWidget *find = GTK_WIDGET (gtk_builder_get_object (builder,
555 "main_window_search_button"));
556 main_window_search_button_clicked_cb (GTK_BUTTON (find), user_data);
557 return TRUE;
558 }
559 return FALSE;
560}
561
540/** 562/**
541 * Add pseudonym data to tree store 563 * Add pseudonym data to tree store
542 * 564 *