aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-03-30 21:48:31 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-03-30 21:48:31 +0800
commit5d6902cc05f95832e06afd88b6d581be68c1a79f (patch)
tree07b3c98b86de4b24e82fb52990f24716e9b0411a /src/empathy-main-window.c
parent62a0fee5ae1749f38e476ba67c0e1f2804ad5ee7 (diff)
parentd8dd568c2c1fed4cb328c2a9afc148186fda12aa (diff)
downloadgsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar.gz
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar.bz2
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar.lz
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar.xz
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.tar.zst
gsoc2013-empathy-5d6902cc05f95832e06afd88b6d581be68c1a79f.zip
Merge branch 'undo-close-tab'
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r--src/empathy-main-window.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 635627e74..031e23d07 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#include <telepathy-glib/account-manager.h>
@@ -53,6 +54,7 @@
#include <libempathy-gtk/empathy-ui-utils.h>
#include "empathy-accounts-dialog.h"
+#include "empathy-chat-manager.h"
#include "empathy-main-window.h"
#include "ephy-spinner.h"
#include "empathy-preferences.h"
@@ -662,6 +664,23 @@ main_window_destroy_cb (GtkWidget *widget,
g_free (window);
}
+static gboolean
+main_window_key_press_event_cb (GtkWidget *window,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ EmpathyChatManager *chat_manager;
+
+ if (event->keyval == GDK_T
+ && event->state & GDK_SHIFT_MASK
+ && event->state & GDK_CONTROL_MASK) {
+ chat_manager = empathy_chat_manager_dup_singleton ();
+ empathy_chat_manager_undo_closed_chat (chat_manager);
+ g_object_unref (chat_manager);
+ }
+ return FALSE;
+}
+
static void
main_window_chat_quit_cb (GtkAction *action,
EmpathyMainWindow *window)
@@ -1338,6 +1357,7 @@ empathy_main_window_show (void)
empathy_builder_connect (gui, window,
"main_window", "destroy", main_window_destroy_cb,
+ "main_window", "key-press-event", main_window_key_press_event_cb,
"chat_quit", "activate", main_window_chat_quit_cb,
"chat_new_message", "activate", main_window_chat_new_message_cb,
"chat_new_call", "activate", main_window_chat_new_call_cb,