[Spice-devel] [PATCH spice-gtk 2/2] Connect on recent connection item activation
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Tue May 24 14:08:48 PDT 2011
Now (commit 27df918) that we already gather connection information when
user (single)-clicks a recent connection item, we can safely use the
selected recent connection when user activates (double-clicks) it.
---
gtk/spicy.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gtk/spicy.c b/gtk/spicy.c
index 7b51216..45e16d9 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -182,6 +182,11 @@ static void recent_selection_changed_dialog_cb(GtkRecentChooser *chooser, gpoint
gtk_recent_info_unref(info);
}
+
+static void recent_item_activated_dialog_cb(GtkRecentChooser *chooser, gpointer data)
+{
+ gtk_dialog_response (GTK_DIALOG (data), GTK_RESPONSE_ACCEPT);
+}
#endif
static int connect_dialog(SpiceSession *session)
@@ -238,6 +243,8 @@ static int connect_dialog(SpiceSession *session)
gtk_recent_chooser_set_local_only(GTK_RECENT_CHOOSER(recent), FALSE);
g_signal_connect(recent, "selection-changed",
G_CALLBACK(recent_selection_changed_dialog_cb), session);
+ g_signal_connect(recent, "item-activated",
+ G_CALLBACK(recent_item_activated_dialog_cb), dialog);
#endif
/* show and wait for response */
gtk_widget_show_all(dialog);
--
1.7.5.1
More information about the Spice-devel
mailing list