Re: [evolution-patches] address book patch to fix #52765



hi, Chris

Thanks for your review my patch for bug 52765 in bugzilla.ximnain.org.
I think you mean that bug only related to Delete Dialog, and my previous fix covered other case(e.g. support ESC for contact editor).
So I create a simiplified patch just for bug 52765.
(I think you have approved this oneline patch, if so I will check it in soon )

BTW, I filed another bug 54447, which is related to provide ESC suport for contact editor, and I will send you the patch for it soon.

Best regards


Chris Toshok wrote:

This patch has too much to it too.

The only thing required to get the cancel button working is the first
part of the patch:


@@ -1729,7 +1732,7 @@
					    "to delete this contact?"));

	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-				GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
				GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
				NULL);


Feel free to commit this one liner (both to 1-4-branch and HEAD).

Chris

On Fri, 2004-02-13 at 14:21, hao.sheng wrote:
Hi,
   Ignore the previous patch .
Because there is a simple mothed to deal with the ESC event on message dialog.

This patch is aimed for Head.
Fix the Bug#52765  on http://bugzilla.ximian.com.
Attach is a patch to fix that. Would you like to spend a little time to review it?

Best regards
______________________________________________________________________
Index: gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.165
diff -u -r1.165 e-contact-editor.c
--- gui/contact-editor/e-contact-editor.c	30 Jan 2004 22:52:38 -0000	1.165
+++ gui/contact-editor/e-contact-editor.c	13 Feb 2004 09:05:00 -0000
@@ -45,6 +45,7 @@
#include <gal/widgets/e-categories.h>
#include <gal/widgets/e-gui-utils.h>
#include <gal/e-text/e-entry.h>
+#include <gdk/gdkkeysyms.h>

#include <libebook/e-address-western.h>

@@ -116,6 +117,8 @@
static void close_dialog (EContactEditor *ce);
static void enable_widget (GtkWidget *widget, gboolean enabled);

+static gint app_key_press_cb(GtkWidget *widget, GdkEvent *event, gpointer data);
+
static GtkObjectClass *parent_class = NULL;

static guint contact_editor_signals[LAST_SIGNAL];
@@ -1729,7 +1732,7 @@
					    "to delete this contact?"));

	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-				GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
				GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
				NULL);

@@ -1881,6 +1884,22 @@
	return TRUE;
}

+/* Callback used when the ESC key pressed at contact  */
+static gint
+app_key_press_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+	if (event->key.keyval == GDK_Escape){
+		EContactEditor *ce;
+		if (E_IS_CONTACT_EDITOR(data)){
+			ce = E_CONTACT_EDITOR (data);
+			close_dialog (ce);
+			return TRUE;
+			}
+		return FALSE;
+	}
+	return FALSE;
+}
+
static GList *
add_to_tab_order(GList *list, GladeXML *gui, char *name)
{
@@ -2059,6 +2078,10 @@
	g_signal_connect (e_contact_editor->app, "delete_event",
			    GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor);

+	/*Connect to the ESC of the dialog*/
+	g_signal_connect (e_contact_editor->app, "key_press_event",
+			    GTK_SIGNAL_FUNC (app_key_press_cb), e_contact_editor);
+
	/* set the icon */
	icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL);
	gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path);

Index: gui/contact-editor/e-contact-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-editor/e-contact-editor.c,v
retrieving revision 1.165
diff -u -r1.165 e-contact-editor.c
--- gui/contact-editor/e-contact-editor.c	30 Jan 2004 22:52:38 -0000	1.165
+++ gui/contact-editor/e-contact-editor.c	17 Feb 2004 03:07:34 -0000
@@ -1729,7 +1729,7 @@
 					    "to delete this contact?"));
 
 	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-				GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 				GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
 				NULL);
 


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