[evolution-patches] Seeking review for bug #47447



Hi,
This little patch fixes bug #47447 <http://bugzilla.ximian.com/show_bug.cgi?id=47447>, "Add new mail account window does not close on Esc". Now the "mail config druid" can be
closed when Esc is pressed.
   Please review, thanks.

--
Best Regards
Maxx

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2784
diff -u -r1.2784 ChangeLog
--- ChangeLog	5 Aug 2003 22:20:51 -0000	1.2784
+++ ChangeLog	7 Aug 2003 06:24:11 -0000
@@ -1,3 +1,11 @@
+2003-08-07  Maxx Cao  <maxx cao sun com>
+	
+	** For bug #47447
+
+	* mail-config-druid.c (druid_key_press): handle Esc key event.
+	(mail_config_druid_new): connect the druid window with 
+	"key_press_event".
+
 2003-08-05  Not Zed  <NotZed Ximian com>
 
 	** See bug #47224.  Hook onto clicked rather than button_pressed,
Index: mail-config-druid.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config-druid.c,v
retrieving revision 1.100
diff -u -r1.100 mail-config-druid.c
--- mail-config-druid.c	16 Apr 2003 17:03:11 -0000	1.100
+++ mail-config-druid.c	7 Aug 2003 06:24:12 -0000
@@ -51,6 +51,8 @@
 #include <evolution-wizard.h>
 #include <e-util/e-account.h>
 
+#include <gdk/gdkkeysyms.h>
+
 typedef enum {
 	MAIL_CONFIG_WIZARD_PAGE_NONE = -1,
 	MAIL_CONFIG_WIZARD_PAGE_IDENTITY,
@@ -620,6 +622,17 @@
 		return FALSE;
 }
 
+static gboolean
+druid_key_press (GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+	if (event->keyval == GDK_Escape){
+		MailConfigWizard *mcw = data;
+		druid_cancel (mcw->druid, data);
+		return TRUE;
+	}
+	return FALSE;
+}
+
 
 MailConfigDruid *
 mail_config_druid_new (void)
@@ -632,6 +645,9 @@
 	mcw->druid = (GnomeDruid *)glade_xml_get_widget (mcw->gui->xml, "druid");
 	g_object_set_data (G_OBJECT (mcw->druid), "MailConfigWizard", mcw);
 	
+	g_signal_connect (gtk_widget_get_parent (mcw->druid), "key_press_event", 
+			  G_CALLBACK (druid_key_press), (gpointer)mcw);
+
 	mcw->interior_pages = g_ptr_array_new ();
 	for (i = 0; i < num_wizard_pages; i++) {
 		page = glade_xml_get_widget (mcw->gui->xml,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]