aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-03-01 03:08:43 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-03-06 05:51:00 +0800
commitd95165b819c15207ad0a133ea38684043a3776fc (patch)
tree69c9cdd2b1a8634d500213cda21f270383d17bfa /src/empathy-main-window.c
parentdf799743c6e79136ffa44e22cb19dce0146ec422 (diff)
downloadgsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar.gz
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar.bz2
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar.lz
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar.xz
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.tar.zst
gsoc2013-empathy-d95165b819c15207ad0a133ea38684043a3776fc.zip
Add chat manager which tracks chats closing and can respawn them (bug #609832)
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
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 240f4b18b..a1544fa6d 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"
@@ -656,6 +658,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)
@@ -1292,6 +1311,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,