2009-05-21 [mones] 3.7.1cvs61
authorRicardo Mones <mones@claws-mail.org>
Thu, 21 May 2009 20:59:42 +0000 (20:59 +0000)
committerRicardo Mones <mones@claws-mail.org>
Thu, 21 May 2009 20:59:42 +0000 (20:59 +0000)
* src/compose.c
* src/compose.h
Add button to empty header lines with one click

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/compose.h

index 73c8972..e8e55c8 100644 (file)
--- 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
index d8c896f..c019e40 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index ca2e4b3..e4a359f 100644 (file)
@@ -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=
 
index 16ecafc..ce5682a 100644 (file)
@@ -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 <tab> 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)
index ec635eb..cd3c057 100644 (file)
@@ -82,6 +82,8 @@ typedef struct {
        Compose *compose;
        GtkWidget *combo;
        GtkWidget *entry;
+       GtkWidget *button;
+       GtkWidget *hbox;
 } ComposeHeaderEntry;
 
 struct _Compose