[evolution-patches] fix for bug #45597



make hitting Delete consistant with hitting Ctrl-D in the
message-browser.



-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? 45597.patch
? diff
? idate
? idate.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2761.2.6
diff -u -r1.2761.2.6 ChangeLog
--- ChangeLog	15 Jul 2003 19:47:57 -0000	1.2761.2.6
+++ ChangeLog	25 Jul 2003 20:25:38 -0000
@@ -1,3 +1,9 @@
+2003-07-25  Jeffrey Stedfast  <fejj ximian com>
+
+	* message-browser.c (on_key_press): New callback function to
+	override the behaviour of hitting the Delete key. Fixes bug
+	#45597.
+
 2003-07-15  Federico Mena Quintero  <federico ximian com>
 
 	* folder-browser.c (message_list_drag_data_received): Handle
Index: folder-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/folder-browser.c,v
retrieving revision 1.347.2.2
diff -u -r1.347.2.2 folder-browser.c
--- folder-browser.c	15 Jul 2003 19:47:57 -0000	1.347.2.2
+++ folder-browser.c	25 Jul 2003 20:25:40 -0000
@@ -2232,7 +2232,6 @@
 	case GDK_KP_Delete:
 		delete_msg (NULL, fb);
 		return TRUE;
-		
 	case GDK_Menu:
 		on_right_click (fb->message_list->tree, row, path, 2,
 				(GdkEvent *)key, fb);
Index: message-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-browser.c,v
retrieving revision 1.39
diff -u -r1.39 message-browser.c
--- message-browser.c	25 Jun 2003 15:59:00 -0000	1.39
+++ message-browser.c	25 Jul 2003 20:25:41 -0000
@@ -328,6 +328,25 @@
 	/*bonobo_ui_component_thaw (uic, NULL);*/
 }
 
+static int
+on_key_press (GtkWidget *widget, GdkEventKey *key, gpointer data)
+{
+	MessageBrowser *mb = data;
+	
+	if (key->state & GDK_CONTROL_MASK)
+		return FALSE;
+	
+	switch (key->keyval) {
+	case GDK_Delete:
+	case GDK_KP_Delete:
+		message_browser_delete (NULL, mb, NULL);
+		return TRUE;
+	default:
+	}
+	
+	return FALSE;
+}
+
 GtkWidget *
 message_browser_new (const GNOME_Evolution_Shell shell, const char *uri, const char *uid)
 {
@@ -368,6 +387,8 @@
 	/* more evil hackery... */
 	new->loaded_id = g_signal_connect (fb, "folder_loaded", G_CALLBACK (message_browser_folder_loaded), new);
 	g_signal_connect (fb, "message_loaded", G_CALLBACK (message_browser_message_loaded), new);
+	
+	g_signal_connect (new, "key_press_event", G_CALLBACK (on_key_press), new);
 	
 	return GTK_WIDGET (new);
 }


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