aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorLarry Ewing <lewing@src.gnome.org>2004-05-26 14:13:34 +0800
committerLarry Ewing <lewing@src.gnome.org>2004-05-26 14:13:34 +0800
commit7259b1726d060d9f37f7f1d1a6cf3b55f4e65319 (patch)
treebc3655942ccd25fb822587ba203bd8e5dfd2c6a1 /calendar/gui
parent1bd5e8ff95724a58b2db7968382aa3c9c8076808 (diff)
downloadgsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.gz
gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.zst
gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.zip
(key_press_event): look for escape press and destroy dialog.
svn path=/trunk/; revision=26093
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/calendar-setup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index 517804f34e..e50f1f7f47 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <bonobo/bonobo-i18n.h>
+#include <gdk/gdkkeysyms.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkmenu.h>
@@ -653,6 +654,17 @@ source_group_changed_sensitive (SourceDialog *source_dialog)
general_update_dialog (source_dialog);
}
+static gboolean
+key_press_event (GtkWidget *widget, GdkEventKey *event)
+{
+ if (event->keyval == GDK_Escape) {
+ gtk_widget_destroy (widget);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
new_calendar_cancel (SourceDialog *source_dialog)
{
@@ -687,6 +699,7 @@ calendar_setup_new_calendar (GtkWindow *parent)
}
source_dialog->window = glade_xml_get_widget (source_dialog->gui_xml, "add-calendar-window");
+ g_signal_connect (source_dialog->window, "key-press-event", G_CALLBACK (key_press_event), NULL);
source_dialog->name_entry = glade_xml_get_widget (source_dialog->gui_xml, "name-entry");
g_signal_connect_swapped (source_dialog->name_entry, "changed",
@@ -782,6 +795,8 @@ calendar_setup_edit_calendar (GtkWindow *parent, ESource *source)
source_dialog->source = source;
g_object_ref (source);
+ g_signal_connect (source_dialog->window, "key-press-event", G_CALLBACK (key_press_event), NULL);
+
source_dialog->name_entry = glade_xml_get_widget (source_dialog->gui_xml, "name-entry");
g_signal_connect_swapped (source_dialog->name_entry, "changed",
G_CALLBACK (general_entry_modified), source_dialog);
@@ -889,6 +904,7 @@ calendar_setup_new_task_list (GtkWindow *parent)
}
source_dialog->window = glade_xml_get_widget (source_dialog->gui_xml, "add-task-list-window");
+ g_signal_connect (source_dialog->window, "key-press-event", G_CALLBACK (key_press_event), NULL);
source_dialog->name_entry = glade_xml_get_widget (source_dialog->gui_xml, "name-entry");
g_signal_connect_swapped (source_dialog->name_entry, "changed",
@@ -985,6 +1001,8 @@ calendar_setup_edit_task_list (GtkWindow *parent, ESource *source)
source_dialog->source = source;
g_object_ref (source);
+ g_signal_connect (source_dialog->window, "key-press-event", G_CALLBACK (key_press_event), NULL);
+
source_dialog->name_entry = glade_xml_get_widget (source_dialog->gui_xml, "name-entry");
g_signal_connect_swapped (source_dialog->name_entry, "changed",
G_CALLBACK (general_entry_modified), source_dialog);