[evolution-patches] remove selected attachments with "Delete" key



The attached patch makes possible to remove selected attachments by
pressing the "Delete" key.

ciao
	paolo
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.597
diff -u -p -r1.597 ChangeLog
--- composer/ChangeLog	14 Jan 2004 04:25:25 -0000	1.597
+++ composer/ChangeLog	25 Jan 2004 11:18:21 -0000
@@ -1,3 +1,8 @@
+2004-01-25  Paolo Borelli  <pborelli katamail com>
+
+	* e-msg-composer-attachment-bar.c (key_press_event): remove
+	selected attachments when the "Delete" key is pressed.
+
 2004-01-14  Not Zed  <NotZed Ximian com>
 
 	** See Bug #20017.
Index: composer/e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.80
diff -u -p -r1.80 e-msg-composer-attachment-bar.c
--- composer/e-msg-composer-attachment-bar.c	24 Sep 2003 20:12:02 -0000	1.80
+++ composer/e-msg-composer-attachment-bar.c	25 Jan 2004 11:18:23 -0000
@@ -28,6 +28,7 @@
 
 #include <string.h>
 #include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 #include <glade/glade.h>
 #include <gconf/gconf.h>
 #include <gconf/gconf-client.h>
@@ -596,7 +597,23 @@ button_press_event (GtkWidget *widget,
 	return TRUE;
 }
 
-
+static gboolean
+key_press_event (GtkWidget *widget, GdkEventKey *event)
+{
+	EMsgComposerAttachmentBar *bar;
+
+	bar = E_MSG_COMPOSER_ATTACHMENT_BAR (widget);
+
+	if (event->keyval == GDK_Delete) {
+		remove_selected (bar);
+
+		return TRUE;
+	}
+
+	return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+}
+
+
 /* Initialization.  */
 
 static void
@@ -613,7 +630,8 @@ class_init (EMsgComposerAttachmentBarCla
 	parent_class = g_type_class_ref (gnome_icon_list_get_type ());
 	
 	object_class->destroy = destroy;
-	
+
+	widget_class->key_press_event = key_press_event;
 	widget_class->button_press_event = button_press_event;
 	widget_class->popup_menu = popup_menu_event;
 


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