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



Thank you, Nod Zed
But I cannot catch what you said clearly.
First, both these two methods will change the code slightly, anyway, we should pop up a confirmation dialog.
Or you mean that we will not need to modify the code if we want to change this exit key-binding to some other key in the future?

Here, using key_press_event is less efficient than key binding, I agree.
But I think it doesn't matter in this startup step, and some similar bugs are also fixed in this way, such as: 47751, 47752 by Maxx Cao.
I don't know if it is necessary to use the same mothed to fix similar bugs in our work.
What's your opinion?

Not Zed wrote:
I would suspect it is less efficient by a long way - but key bindings
done in this way can be altered I believe without having to change the
code.  This is the reason to do it that way rather than a key press
handler.

I think, anyway, from talks with a gtk expert.

On Sat, 2003-09-06 at 03:23, Charles Zhang wrote:
  
en, you mean that binding a 'cancel' signal to a key, I think it also
makes, and more efficent than check all key_press.
But that's the same, both are simple and reliable enough, 
and to be coordinate with the common method used in the evolution
bug-fixing,
I think catching the 'ESC' key is ok for us.


Charles Zhang wrote:

    
Thank you for your advice. :)

In fact, in this dialog, a gnome-druid is embedded.
These buttions "previous", "next", "help" and "cancel" are also
created in thiat gnome_druid.
So I think the best way is to handle the key_press_event for "ESC"
in the dialog.
      
Not Zed wrote:
      
I can't remember if the wizard is also a gtkdialog, if it is, then you
should just use a CANCEL button and/or connect to the close signal.

On Thu, 2003-09-04 at 09: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);
    
          
_______________________________________________
Evolution-patches mailing list
Evolution-patches lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution-patches
  
        

_______________________________________________
Evolution-patches mailing list
Evolution-patches lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution-patches

  



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