From caccc4df1f7d0472f14682a57bf19f9a5014464f Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 7 Apr 2018 22:01:41 +0300 Subject: [PATCH] Make pressing Enter in the serverlist connect. This is similar to the firefox profile manager and is faster and more convenient. --- src/fe-gtk/servlistgui.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index b22330ac..3a8dffd3 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -577,6 +577,9 @@ servlist_move_item (GtkTreeView *view, GSList *list, gpointer item, int delta) return list; } +static void +servlist_connect_cb (GtkWidget *button, gpointer userdata); + static gboolean servlist_net_keypress_cb (GtkWidget *wid, GdkEventKey *evt, gpointer tree) { @@ -598,6 +601,11 @@ servlist_net_keypress_cb (GtkWidget *wid, GdkEventKey *evt, gpointer tree) network_list = servlist_move_item (GTK_TREE_VIEW (tree), network_list, selected_net, +1); } } + else if (evt->keyval == GDK_KEY_Return) + { + handled = TRUE; + servlist_connect_cb(NULL, NULL); + } return handled; }