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



Thanks, Ettore

I should pay more attention to the details and obey the existing rules.
Then this one is ok?

Best Regards
Charles Zhang

Ettore Perazzoli wrote:
Hi Charles,

  
+		gint returnvalue;
+		gchar *confirmations;
    

(We never use g* types for native C types in Evolution, although this is
not that important.)

  
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Cancel"), GTK_RESPONSE_CANCEL);
+		gtk_dialog_add_button (confirm_dialog, (gchar *)("Quit Assistant"), GTK_RESPONSE_OK);
    

What are these casts for?  The strings should also be marked for
translation.

  
+		returnvalue = gtk_dialog_run ((GtkDialog *) confirm_dialog);
    

The shell code uses GTK+ casts, i.e. GTK_DIALOG().  (Yes, I know the
mailer doesn't, but that's just a NotZedism.)

The rest looks fine, I think.

Thanks!
-- 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	16 Sep 2003 12:08:44 -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;
+		int returnvalue;
+		char *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, _("Cancel"), GTK_RESPONSE_CANCEL);
+		gtk_dialog_add_button (confirm_dialog, _("Quit Assistant"), GTK_RESPONSE_OK);
+
+		returnvalue = gtk_dialog_run (GTK_DIALOG (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	16 Sep 2003 12:08: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]