Thank you, Ettore. I have thought that the function name should more or less stand for its real action, but maybe a regular name is the best choice, I have fix it as you advised. Then what about these words, "Do you really want to exit Evolution Setup Assistant Program?" Another problem I found is about the buttons on the confirmation dialog. 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? Ettore Perazzoli wrote: +static gboolean +startup_wizard_escape( GtkWidget *widget, + GdkEventKey *keyev, + SWData *data )This should probably be called key_press_event_callback() or something.+ confirm_dialog = gtk_message_dialog_new (widget, GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, + "Are you sure to quit?");I don't think this is proper English, and probably it should have some more information... Anna, can you come up with some text for this? It should also be marked for translation. (And since this is new text, the patch should only be applied to HEAD.) The rest looks good. -- Ettore |
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 10 Sep 2003 12:54:27 -0000 @@ -758,6 +758,29 @@ 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; + + confirm_dialog = gtk_message_dialog_new (data->dialog, GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, + (gchar *)("Do you really want to exit Evolution Setup Assistant Program?")); + 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 +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 (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 10 Sep 2003 12:54:27 -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