diff options
author | Jonny Lamb <jonnylamb@gnome.org> | 2009-10-23 20:33:39 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2009-10-23 20:33:39 +0800 |
commit | f4e6cbe11974883a3883536461c0be08f75cdd39 (patch) | |
tree | 908a21069216314ed86f52d20213560145dca58a | |
parent | 7c5ac57b9aafe95d159c2a96410a0afa76408678 (diff) | |
download | gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar.gz gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar.bz2 gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar.lz gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar.xz gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.tar.zst gsoc2013-empathy-f4e6cbe11974883a3883536461c0be08f75cdd39.zip |
ft-manager: allow closing the dialog with C-w or Esc
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r-- | src/empathy-ft-manager.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c index bc4f2a7b7..9f6c1f327 100644 --- a/src/empathy-ft-manager.c +++ b/src/empathy-ft-manager.c @@ -33,6 +33,7 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> #define DEBUG_FLAG EMPATHY_DEBUG_FT #include <libempathy/empathy-debug.h> @@ -950,6 +951,21 @@ ft_manager_destroy_cb (GtkWidget *widget, g_object_unref (manager); } +static gboolean +ft_manager_key_press_event_cb (GtkWidget *widget, + GdkEventKey *event, + gpointer user_data) +{ + if ((event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) + || event->keyval == GDK_Escape) + { + gtk_widget_destroy (widget); + return TRUE; + } + + return FALSE; +} + static void ft_manager_build_ui (EmpathyFTManager *manager) { @@ -978,6 +994,7 @@ ft_manager_build_ui (EmpathyFTManager *manager) "ft_manager_dialog", "response", ft_manager_response_cb, "ft_manager_dialog", "delete-event", ft_manager_delete_event_cb, "ft_manager_dialog", "configure-event", ft_manager_configure_event_cb, + "ft_manager_dialog", "key-press-event", ft_manager_key_press_event_cb, NULL); empathy_builder_unref_and_keep_widget (gui, priv->window); |