Make pressing Enter in the serverlist connect.

This is similar to the firefox profile manager and is faster and more
convenient.
This commit is contained in:
Shlomi Fish 2018-04-07 22:01:41 +03:00
parent c1091c38b8
commit caccc4df1f

View File

@ -577,6 +577,9 @@ servlist_move_item (GtkTreeView *view, GSList *list, gpointer item, int delta)
return list; return list;
} }
static void
servlist_connect_cb (GtkWidget *button, gpointer userdata);
static gboolean static gboolean
servlist_net_keypress_cb (GtkWidget *wid, GdkEventKey *evt, gpointer tree) 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); 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; return handled;
} }