diff options
author | Larry Ewing <lewing@src.gnome.org> | 2004-05-26 14:13:34 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2004-05-26 14:13:34 +0800 |
commit | 7259b1726d060d9f37f7f1d1a6cf3b55f4e65319 (patch) | |
tree | bc3655942ccd25fb822587ba203bd8e5dfd2c6a1 | |
parent | 1bd5e8ff95724a58b2db7968382aa3c9c8076808 (diff) | |
download | gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.gz gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.bz2 gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.lz gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.xz gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.tar.zst gsoc2013-evolution-7259b1726d060d9f37f7f1d1a6cf3b55f4e65319.zip |
(key_press_event): look for escape press and destroy dialog.
svn path=/trunk/; revision=26093
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/calendar-setup.c | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 2e95abd666..4003753cff 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-05-25 Larry Ewing <lewing@ximian.com> + + * gui/dialogs/calendar-setup.c (calendar_setup_edit_task_list): + use the new dialog. + (calendar_setup_edit_calendar): use the new dialog. + (key_press_event): look for escape press and destroy dialog. + 2004-05-25 Jeffrey Stedfast <fejj@novell.com> * gui/dialogs/url-editor-dialog.c (init_widgets): Use 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); |