[Commits] contactwindow.c 1.12 1.13
miras at claws-mail.org
miras at claws-mail.org
Sun Dec 18 16:54:21 CET 2011
Update of /home/claws-mail/contacts/src
In directory claws-mail:/tmp/cvs-serv10479/src
Modified Files:
contactwindow.c
Log Message:
2011-12-18 [mir] 0.6.0cvs55
* src/contactwindow.c
Implemented GTK standard shortcut key Esc for
closing GtkDialog in contactwindow.
Index: contactwindow.c
===================================================================
RCS file: /home/claws-mail/contacts/src/contactwindow.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- contactwindow.c 9 Dec 2011 23:01:21 -0000 1.12
+++ contactwindow.c 18 Dec 2011 15:54:19 -0000 1.13
@@ -831,6 +831,21 @@
cw->email_dirty = TRUE;
}
+static gboolean contactwindow_key_press_event_cb(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data) {
+ if (!event) return FALSE;
+
+ switch (event->keyval) {
+ case GDK_KEY_Escape:
+ delete_contact_window(widget, (GdkEvent *) event, user_data);
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
static void contact_widget(ContactWindow* cw) {
GtkWidget *label, *vbox, *hbox, *win1, *win2, *frame,
*add_btn, *delete_btn, *cancel_btn, *ok_btn, *apply_btn,
@@ -1042,6 +1057,9 @@
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(cw->window), vbox);
+ g_signal_connect(cw->window, "key-press-event",
+ G_CALLBACK(contactwindow_key_press_event_cb), cw);
+
gtk_widget_show_all(vbox);
}
More information about the Commits
mailing list