From d64226d81e706ecb4a59b344d11ea9097f612926 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Thu, 21 May 2009 20:59:42 +0000 Subject: [PATCH] 2009-05-21 [mones] 3.7.1cvs61 * src/compose.c * src/compose.h Add button to empty header lines with one click --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/compose.c | 31 +++++++++++++++++++++++++++++-- src/compose.h | 2 ++ 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73c897292..e8e55c8ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-21 [mones] 3.7.1cvs61 + + * src/compose.c + * src/compose.h + Add button to empty header lines with one click + 2009-05-21 [paul] 3.7.1cvs60 * src/mainwindow.c diff --git a/PATCHSETS b/PATCHSETS index d8c896fd3..c019e4013 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -3800,3 +3800,4 @@ ( cvs diff -u -r 1.17.2.55 -r 1.17.2.56 src/send_message.c; ) > 3.7.1cvs58.patchset ( cvs diff -u -r 1.20.2.22 -r 1.20.2.23 src/gtk/Makefile.am; ) > 3.7.1cvs59.patchset ( cvs diff -u -r 1.274.2.301 -r 1.274.2.302 src/mainwindow.c; cvs diff -u -r 1.39.2.56 -r 1.39.2.57 src/mainwindow.h; cvs diff -u -r 1.14.2.68 -r 1.14.2.69 src/plugins/trayicon/trayicon.c; ) > 3.7.1cvs60.patchset +( cvs diff -u -r 1.382.2.508 -r 1.382.2.509 src/compose.c; cvs diff -u -r 1.50.2.53 -r 1.50.2.54 src/compose.h; ) > 3.7.1cvs61.patchset diff --git a/configure.ac b/configure.ac index ca2e4b37c..e4a359f90 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=60 +EXTRA_VERSION=61 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/compose.c b/src/compose.c index 16ecafc06..ce5682a58 100644 --- a/src/compose.c +++ b/src/compose.c @@ -496,6 +496,8 @@ static gboolean compose_headerentry_changed_cb (GtkWidget *entry, static gboolean compose_headerentry_key_press_event_cb(GtkWidget *entry, GdkEventKey *event, ComposeHeaderEntry *headerentry); +static gboolean compose_headerentry_button_clicked_cb (GtkWidget *button, + ComposeHeaderEntry *headerentry); static void compose_show_first_last_header (Compose *compose, gboolean show_first); @@ -6311,6 +6313,8 @@ static void compose_create_header_entry(Compose *compose) GtkWidget *combo; GtkWidget *entry; + GtkWidget *button; + GtkWidget *hbox; gchar **string; const gchar *header = NULL; ComposeHeaderEntry *headerentry; @@ -6364,12 +6368,22 @@ static void compose_create_header_entry(Compose *compose) g_signal_connect_after(G_OBJECT(gtk_bin_get_child(GTK_BIN((combo)))), "grab_focus", G_CALLBACK(compose_grab_focus_cb), compose); - /* Entry field */ + /* Entry field with cleanup button */ + button = gtk_button_new(); + gtk_button_set_image(GTK_BUTTON(button), + gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON)); + gtk_widget_show(button); + CLAWS_SET_TIP(button, + _("Delete entry contents")); entry = gtk_entry_new(); gtk_widget_show(entry); CLAWS_SET_TIP(entry, _("Use to autocomplete from addressbook")); - gtk_table_attach(GTK_TABLE(compose->header_table), entry, 1, 2, + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show(hbox); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_table_attach(GTK_TABLE(compose->header_table), hbox, 1, 2, compose->header_nextrow, compose->header_nextrow+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); @@ -6381,6 +6395,10 @@ static void compose_create_header_entry(Compose *compose) headerentry); g_signal_connect_after(G_OBJECT(entry), "grab_focus", G_CALLBACK(compose_grab_focus_cb), compose); + + g_signal_connect(G_OBJECT(button), "clicked", + G_CALLBACK(compose_headerentry_button_clicked_cb), + headerentry); /* email dnd */ gtk_drag_dest_set(entry, GTK_DEST_DEFAULT_ALL, compose_mime_types, @@ -6401,6 +6419,8 @@ static void compose_create_header_entry(Compose *compose) headerentry->compose = compose; headerentry->combo = combo; headerentry->entry = entry; + headerentry->button = button; + headerentry->hbox = hbox; headerentry->headernum = compose->header_nextrow; compose->header_nextrow++; @@ -10390,6 +10410,13 @@ static void compose_toggle_remove_refs_cb(GtkToggleAction *action, gpointer data compose->remove_references = FALSE; } +static gboolean compose_headerentry_button_clicked_cb (GtkWidget *button, + ComposeHeaderEntry *headerentry) +{ + gtk_entry_set_text(GTK_ENTRY(headerentry->entry), ""); + return FALSE; +} + static gboolean compose_headerentry_key_press_event_cb(GtkWidget *entry, GdkEventKey *event, ComposeHeaderEntry *headerentry) diff --git a/src/compose.h b/src/compose.h index ec635eb4f..cd3c057cc 100644 --- a/src/compose.h +++ b/src/compose.h @@ -82,6 +82,8 @@ typedef struct { Compose *compose; GtkWidget *combo; GtkWidget *entry; + GtkWidget *button; + GtkWidget *hbox; } ComposeHeaderEntry; struct _Compose -- 2.25.1