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



Hi, Anna
I have received your message, you told me that I can commit the code to HEAD now but I must get Ettore or Michael's permission before I do. But I think you must have missed another message from me some days ago. In its attachment, I rearrange the code line of the patch and adjust some words. I think that makes the code clear and understandable enough, after that the dialog looks better than before.
       Now I have post it here, please spare some time to review it.

Best Regards.
Charles

Charles Zhang wrote:

Dear all:
I think this one is better, here I rearranged the codes and the words in the confirmation dialog.
       Please check it, thank you.

Best Regards.
Charles

Anna Marie Dirks wrote:

On Wed, 2003-09-10 at 16:58, Ettore Perazzoli wrote:

Then what about these words, "Do you really want to exit Evolution
Setup Assistant Program?"

I don't think it's called "Evolution Setup Assistant Program" anywhere? I think Anna should just come up with the wording. :)


The key information that this message needs to convey is that the work
put into setting up Evolution will be lost when the assistant is exited.
Please use the following:
If you quit the Evolution Setup Assistant now, all of the information
that you have entered will be forgotten. You will need to  run this
assistant again before using Evolution.
Do you want to quit using the Assistant now?

<Cancel> <Quit Assistant>


Anyway, it is a warning or caution dialog, not for select.
So I should use GTK_BUTTONS_OK_CANCEL but not GTK_BUTTONS_YES_NO here,
do you think so?

Actually, it should maybe be "Quit" / "Don't Quit" as per the HIG?


The section of the HIG that you are thinking of is found here: http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-button-order

and reads:
Button Phrasing. Write button labels as imperative verbs, for example
Save, Print. This allows users to select an action with less
hesitation. An active phrase also fits best with the button's role in
initiating actions, as contrasted with a more passive phrase. For
example Find and Log In are better buttons than than Yes and OK.

Affirmative Button. Place the affirmative button in the lower right
corner of the alert. The affirmative button accepts the action
proposed by the alert, or simply dismisses the alert if no action is
suggested (as is the case with an information alert).


Cancel Button. If the alert was produced in response to a user action,
place a Cancel button immediately to the left of the affirmative
button. This provides an escape route for users to stop an action in
response to new information, or just if they clicked accidentally.
Clicking the Cancel button reverts the application to its state prior
to the user action.




Does that make sense to you guys?
Thanks.


------------------------------------------------------------------------

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 -u -p -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	11 Sep 2003 11:14:45 -0000
@@ -758,6 +758,40 @@ startup_wizard_delete (GnomeDruid *druid
	return FALSE;
}

+static gboolean
+key_press_event_callback (GtkWidget   *widget,
+			  GdkEventKey *keyev,
+			  SWData      *data)
+{
+	if (keyev->keyval == GDK_Escape) {
+		GtkWidget *confirm_dialog;
+		gint returnvalue;
+		gchar *confirmations;
+
+		confirmations = "If you quit the Evolution Setup Assistant now, all of the information that "
+				"you have entered will be forgotten. You will need to run this assistant again "
+				"before using Evolution.\n\nDo you want to quit using the Assistant now?";
+ + confirm_dialog = gtk_message_dialog_new (data->dialog,
+							 GTK_DIALOG_MODAL,
+							 GTK_MESSAGE_WARNING,
+							 GTK_BUTTONS_NONE,
+							 confirmations);
+
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Cancel"), GTK_RESPONSE_CANCEL);
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Quit Assistant"), GTK_RESPONSE_OK);
+
+		returnvalue = gtk_dialog_run ((GtkDialog *) confirm_dialog);
+		gtk_widget_destroy (confirm_dialog);
+ + if (returnvalue == GTK_RESPONSE_OK) {
+			startup_wizard_cancel (data->druid, data);
+			return TRUE;
+		}
+	}
+	return FALSE;
+}
+
gboolean
e_shell_startup_wizard_create (void)
{
@@ -798,6 +832,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 (key_press_event_callback), 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 -u -p -r1.1286.2.6 ChangeLog
--- shell/ChangeLog	30 Jul 2003 13:57:14 -0000	1.1286.2.6
+++ shell/ChangeLog	11 Sep 2003 11:14:45 -0000
@@ -19,6 +19,12 @@
	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
	to "delete_event" signal with startup_wizard_delete. [#46284]

+2003-09-11  Charles Zhang  <charles zhang sun com>
+
+	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
+	to "key_press_event" signal with key_press_event_callback.
+	(key_press_event): Handle `ESC` key press event. [#48145]
+
2003-07-10  Antonio Xu <antonio xu sun com>

	* e-shell-importer.c: (show_import_wizard): use

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 -u -p -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	11 Sep 2003 11:14:45 -0000
@@ -758,6 +758,40 @@ startup_wizard_delete (GnomeDruid *druid
 	return FALSE;
 }
 
+static gboolean
+key_press_event_callback (GtkWidget   *widget,
+			  GdkEventKey *keyev,
+			  SWData      *data)
+{
+	if (keyev->keyval == GDK_Escape) {
+		GtkWidget *confirm_dialog;
+		gint returnvalue;
+		gchar *confirmations;
+
+		confirmations = "If you quit the Evolution Setup Assistant now, all of the information that "
+				"you have entered will be forgotten. You will need to run this assistant again "
+				"before using Evolution.\n\nDo you want to quit using the Assistant now?";
+ 
+		confirm_dialog = gtk_message_dialog_new (data->dialog,
+							 GTK_DIALOG_MODAL,
+							 GTK_MESSAGE_WARNING,
+							 GTK_BUTTONS_NONE,
+							 confirmations);
+
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Cancel"), GTK_RESPONSE_CANCEL);
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Quit Assistant"), GTK_RESPONSE_OK);
+
+		returnvalue = gtk_dialog_run ((GtkDialog *) confirm_dialog);
+		gtk_widget_destroy (confirm_dialog);
+ 
+		if (returnvalue == GTK_RESPONSE_OK) {
+			startup_wizard_cancel (data->druid, data);
+			return TRUE;
+		}
+	}
+	return FALSE;
+}
+
 gboolean
 e_shell_startup_wizard_create (void)
 {
@@ -798,6 +832,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 (key_press_event_callback), 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 -u -p -r1.1286.2.6 ChangeLog
--- shell/ChangeLog	30 Jul 2003 13:57:14 -0000	1.1286.2.6
+++ shell/ChangeLog	11 Sep 2003 11:14:45 -0000
@@ -19,6 +19,12 @@
 	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
 	to "delete_event" signal with startup_wizard_delete. [#46284]
 
+2003-09-11  Charles Zhang  <charles zhang sun com>
+
+	* e-shell-startup-wizard.c (e_shell_startup_wizard_create): connect
+	to "key_press_event" signal with key_press_event_callback.
+	(key_press_event): Handle `ESC` key press event. [#48145]
+
 2003-07-10  Antonio Xu <antonio xu sun com>
 
 	* e-shell-importer.c: (show_import_wizard): use


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