Re: [evolution-patches] Please review my patch for bug #48145



Thank you, Anna.

It's my fault not to specify it, this patch is for HEAD.
This time, I add a confirmation dialog in accordance with the HIG's recommendations.
When 'ESC' is pressed, the user will be asked if he is sure or not.
Please review it.
Thanks

Best Regards
Charles

Anna Marie Dirks wrote:

Greetings, Charles.
Thank you for your patch! I really appreciate your work. I have a few
observations:
1. Is this for HEAD? Trunk? I can't tell.

2. A few weeks ago, Maxx Cao prepared a similar patch, for the importers
druid. When we were discussing Max's patch, we hit upon an important
issue:
Some Evolution windows (in specific, druids) should show a message
dialog alerting the user to the risk of losing her work when the user
tries to close them via the cancel button or the "ESC" key. This is in
accordance with the HIG's recommendations.
3. The complete text of this thread is available in the
evolution-patches mailing list archive. Please see the following link:
http://lists.ximian.com/archives/public/evolution-patches/2003-August/002607.html
(to read the whole thread)

or these links: http://lists.ximian.com/archives/public/evolution-patches/2003-August/002622.html
http://lists.ximian.com/archives/public/evolution-patches/2003-August/002624.html
(to see the HIG-based logic and the formation of the formal Evolution
policy on this matter.)
4. We are in string freeze right now, so if this is a patch for 1.4,
then you should *not* add a message dialog to that branch. If, however,
this patch is for HEAD, then you should follow the policy outlined above
(and add a confirmation dialog).
Does this make sense to you? Please just ask if you need more
clarification! Thank you again for you work, Anna


On Thu, 2003-09-04 at 10:02, Charles Zhang wrote:
Hello All,

Could you review my patch for bug #48145?
I found that the key_press_event for `ESC` was not handled in startup-wizard dialog, so I fixed it.

Bug Summary: Starup wizard does not close on `ESC`
Bug URL: http://bugzilla.ximian.com/show_bug.cgi?id=48145

Best Regards
Charles Zhang

______________________________________________________________________
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1286.2.6
diff -p -u -r1.1286.2.6 ChangeLog
--- shell/ChangeLog	30 Jul 2003 13:57:14 -0000	1.1286.2.6
+++ shell/ChangeLog	3 Sep 2003 13:44:17 -0000
@@ -26,6 +26,12 @@
	(prepare_intelligent_page): Display some error log and disable
	forward button rather than jump to finish page.  [#46017]

+2003-09-02  Charles Zhang <charles zhang sun com>
+
+	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
+	"key_press_event" signal to startup_wizard_escape.
+	(startup_wizard_escape): handle "key_press_event" signal.  [4913305]
+
2003-07-15  Antonio Xu  <antonio xu sun com>

	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
Index: shell/e-shell-startup-wizard.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-startup-wizard.c,v
retrieving revision 1.41.4.2
diff -p -u -r1.41.4.2 e-shell-startup-wizard.c
--- shell/e-shell-startup-wizard.c	22 Jul 2003 09:29:30 -0000	1.41.4.2
+++ shell/e-shell-startup-wizard.c	3 Sep 2003 13:44:21 -0000
@@ -758,6 +758,18 @@ startup_wizard_delete (GnomeDruid *druid
	return FALSE;
}

+static gboolean
+startup_wizard_escape( GtkWidget   *widget,
+		       GdkEventKey *keyev,
+		       SWData 	   *data )
+{
+	if (keyev->keyval == gdk_keyval_from_name ("Escape")) {
+		startup_wizard_cancel (data->druid, data);
+		return TRUE;
+	}
+	return FALSE;
+}
+
gboolean
e_shell_startup_wizard_create (void)
{
@@ -798,6 +810,9 @@ e_shell_startup_wizard_create (void)
	g_signal_connect (data->druid, "cancel",
			  G_CALLBACK (startup_wizard_cancel), data);

+	g_signal_connect (data->dialog, "key_press_event",
+			  G_CALLBACK (startup_wizard_escape), data);
+
	data->start = glade_xml_get_widget (data->wizard, "start-page");
	data->finish = glade_xml_get_widget (data->wizard, "done-page");
	g_return_val_if_fail (data->start != NULL, FALSE);

Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1286.2.6
diff -p -u -r1.1286.2.6 ChangeLog
--- shell/ChangeLog	30 Jul 2003 13:57:14 -0000	1.1286.2.6
+++ shell/ChangeLog	5 Sep 2003 14:03:19 -0000
@@ -26,6 +26,12 @@
 	(prepare_intelligent_page): Display some error log and disable
 	forward button rather than jump to finish page.  [#46017]
 
+2003-09-05  Charles Zhang <charles zhang sun com>
+
+	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
+	"key_press_event" signal to startup_wizard_escape.
+	(startup_wizard_escape): handle "key_press_event" signal.  [48145]
+
 2003-07-15  Antonio Xu  <antonio xu sun com>
 
 	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
Index: shell/e-shell-startup-wizard.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-startup-wizard.c,v
retrieving revision 1.41.4.2
diff -p -u -r1.41.4.2 e-shell-startup-wizard.c
--- shell/e-shell-startup-wizard.c	22 Jul 2003 09:29:30 -0000	1.41.4.2
+++ shell/e-shell-startup-wizard.c	5 Sep 2003 14:03:23 -0000
@@ -758,6 +758,29 @@ startup_wizard_delete (GnomeDruid *druid
 	return FALSE;
 }
 
+static gboolean
+startup_wizard_escape( GtkWidget   *widget,
+		       GdkEventKey *keyev,
+		       SWData 	   *data )
+{
+	if (keyev->keyval == GDK_Escape) {
+		GtkWidget *confirm_dialog;
+		gint response;
+
+		confirm_dialog = gtk_message_dialog_new (widget, GTK_DIALOG_MODAL,
+							 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+							 "Are you sure to quit?");
+		response = gtk_dialog_run (GTK_DIALOG (confirm_dialog));
+		gtk_widget_destroy (confirm_dialog);
+
+		if (response == GTK_RESPONSE_YES) {
+			startup_wizard_cancel (data->druid, data);
+			return TRUE;
+		}
+	}
+	return FALSE;
+}
+
 gboolean
 e_shell_startup_wizard_create (void)
 {
@@ -798,6 +821,9 @@ e_shell_startup_wizard_create (void)
 	g_signal_connect (data->druid, "cancel",
 			  G_CALLBACK (startup_wizard_cancel), data);
 
+	g_signal_connect (data->dialog, "key_press_event",
+			  G_CALLBACK (startup_wizard_escape), data);
+
 	data->start = glade_xml_get_widget (data->wizard, "start-page");
 	data->finish = glade_xml_get_widget (data->wizard, "done-page");
 	g_return_val_if_fail (data->start != NULL, FALSE);


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