sync with sylpheed 0.6.5cvs19
authorPaul Mangan <paul@claws-mail.org>
Thu, 29 Nov 2001 08:37:51 +0000 (08:37 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 29 Nov 2001 08:37:51 +0000 (08:37 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/prefs_template.c
src/template.c
src/template.h

index 9e91015..7205663 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-28
+
+       * src/compose.c
+         src/prefs_template.c
+         src/template.[ch]: added To field to the template.
+
 2001-11-27
 
        * src/textview.c: textview_show_part(): use first found
 
 2001-01-06
 
-       * src/compose.[ch]: integrated news posting patch from DINH V. Hoà
+       * src/compose.[ch]: integrated news posting patch from DINH V. Ho`
          and made many modifications (thanks!).
          compose_write_headers(): made the spaces in newsgroups removed.
          Supported Followup-To.
index d7e12c6..039dddf 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-29 [paul]      0.6.5claws43
+       
+        * sync with sylpheed 0.6.5cvs19
+               see ChangeLog entry 2001-11-28
+
 2001-11-29 [melvin]    0.6.5claws42
        * src/Makefile.am
                added enriched.[ch] to the list of files
index b65f38b..e086e34 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-28
+
+       * src/src/compose.c
+         src/prefs_template.c
+         src/template.[ch]: ¥Æ¥ó¥×¥ì¡¼¥È¤Ë To ¥Õ¥£¡¼¥ë¥É¤òÄɲá£
+
 2001-11-27
 
        * src/textview.c: textview_show_part(): ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿
index 5b9dc57..cb265e3 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws42
+EXTRA_VERSION=claws43
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 50ad6e6..c70858b 100644 (file)
@@ -4604,6 +4604,8 @@ static void compose_template_apply(Compose *compose, Template *tmpl)
        if (tmpl->subject)
                gtk_entry_set_text(GTK_ENTRY(compose->subject_entry),
                                   tmpl->subject);
+       if (tmpl->to)
+               compose_entry_append(compose, tmpl->to, COMPOSE_TO);
 
        if (compose->replyinfo == NULL) {
                MsgInfo dummyinfo;
index a6da3df..92aa9ab 100644 (file)
@@ -43,6 +43,7 @@ static struct Templates {
        GtkWidget *clist_tmpls;
        GtkWidget *entry_name;
        GtkWidget *entry_subject;
+       GtkWidget *entry_to;
        GtkWidget *text_value;
 } templates;
 
@@ -82,6 +83,22 @@ void prefs_template_open(void)
        gtk_widget_show(templates.window);
 }
 
+#define ADD_ENTRY(vbox, entry, str) \
+{ \
+       hbox1 = gtk_hbox_new(FALSE, 8); \
+       gtk_widget_show(hbox1); \
+       gtk_box_pack_start(GTK_BOX(vbox), hbox1, FALSE, FALSE, 0); \
+       gtk_container_set_border_width(GTK_CONTAINER(hbox1), 2); \
+ \
+       label1 = gtk_label_new(str); \
+       gtk_widget_show(label1); \
+       gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0); \
+ \
+       entry = gtk_entry_new(); \
+       gtk_widget_show(entry); \
+       gtk_box_pack_start(GTK_BOX(hbox1), entry, TRUE, TRUE, 0); \
+}
+
 static void prefs_template_window_create(void)
 {
        /* window structure ;) */
@@ -91,7 +108,9 @@ static void prefs_template_window_create(void)
        GtkWidget       *hbox1;
        GtkWidget         *label1;
        GtkWidget         *entry_name;
-       GtkWidget         *entry_subject;
+       GtkWidget         *vbox_hdr;
+       GtkWidget           *entry_to;
+       GtkWidget           *entry_subject;
        GtkWidget       *scroll2;
        GtkWidget         *text_value;
        GtkWidget     *vbox2;
@@ -128,37 +147,17 @@ static void prefs_template_window_create(void)
        gtk_container_set_border_width(GTK_CONTAINER(vbox1), 8);
        gtk_paned_pack1(GTK_PANED(vpaned), vbox1, FALSE, FALSE);
 
-       /* hbox for a label and template name entry */
-       hbox1 = gtk_hbox_new(FALSE, 8);
-       gtk_widget_show(hbox1);
-       gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
-       gtk_container_set_border_width(GTK_CONTAINER(hbox1), 2);
-
-       /* self-documenting */
-       label1 = gtk_label_new(_("Template name"));
-       gtk_widget_show(label1);
-       gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0);
-
-       /* holds template name */
-       entry_name = gtk_entry_new();
-       gtk_widget_show(entry_name);
-       gtk_box_pack_start(GTK_BOX(hbox1), entry_name, TRUE, TRUE, 0);
-
-       /* hbox for a label and subject entry */
-       hbox1 = gtk_hbox_new(FALSE, 8);
-       gtk_widget_show(hbox1);
-       gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
-       gtk_container_set_border_width(GTK_CONTAINER(hbox1), 2);
-
-       /* self-documenting */
-       label1 = gtk_label_new(_("Subject"));
-       gtk_widget_show(label1);
-       gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0);
-
-       /* holds subject */
-       entry_subject = gtk_entry_new();
-       gtk_widget_show(entry_subject);
-       gtk_box_pack_start(GTK_BOX(hbox1), entry_subject, TRUE, TRUE, 0);
+       ADD_ENTRY(vbox1, entry_name, _("Template name"));
+
+       /* vbox to handle headers */
+       vbox_hdr = gtk_vbox_new(FALSE, 2);
+       gtk_widget_show(vbox_hdr);
+       gtk_box_pack_start(GTK_BOX(vbox1), vbox_hdr, FALSE, FALSE, 0);
+
+       ADD_ENTRY(vbox_hdr, entry_to, _("To"));
+       ADD_ENTRY(vbox_hdr, entry_subject, _("Subject"));
+
+#undef ADD_ENTRY
 
        /* template content */
        scroll2 = gtk_scrolled_window_new(NULL, NULL);
@@ -268,6 +267,7 @@ static void prefs_template_window_create(void)
        templates.clist_tmpls = clist_tmpls;
        templates.entry_name = entry_name;
        templates.entry_subject = entry_subject;
+       templates.entry_to = entry_to;
        templates.text_value = text_value;
 }
 
@@ -400,6 +400,7 @@ static gint prefs_template_clist_set_row(gint row)
        Template *tmp_tmpl;
        gchar *name;
        gchar *subject;
+       gchar *to;
        gchar *value;
        gchar *title[1];
 
@@ -409,12 +410,15 @@ static gint prefs_template_clist_set_row(gint row)
                                      0, -1);
        subject = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_subject),
                                      0, -1);
+       to = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_to),
+                                   0, -1);
        value = gtk_editable_get_chars(GTK_EDITABLE(templates.text_value),
                                       0, -1);
 
        tmpl = g_new(Template, 1);
        tmpl->name = name;
        tmpl->subject = subject;
+       tmpl->to = to;
        tmpl->value = value;
 
        title[0] = name;
index 8072181..73c4de6 100644 (file)
@@ -50,6 +50,7 @@ static Template *template_load(gchar *filename)
        tmpl = g_new(Template, 1);
        tmpl->name = NULL;
        tmpl->subject = NULL;
+       tmpl->to = NULL;
        tmpl->value = NULL;
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
@@ -59,6 +60,8 @@ static Template *template_load(gchar *filename)
                        tmpl->name = g_strdup(g_strstrip(buf + 5));
                else if (!g_strncasecmp(buf, "Subject:", 8))
                        tmpl->subject = g_strdup(g_strstrip(buf + 8));
+               else if (!g_strncasecmp(buf, "To:", 3))
+                       tmpl->to = g_strdup(g_strstrip(buf + 3));
        }
 
        if (!tmpl->name) {
@@ -84,6 +87,7 @@ void template_free(Template *tmpl)
 {
        g_free(tmpl->name);
        g_free(tmpl->subject);
+       g_free(tmpl->to);
        g_free(tmpl->value);
        g_free(tmpl);
 }
@@ -192,6 +196,8 @@ void template_write_config(GSList *tmpl_list)
                fprintf(fp, "Name: %s\n", tmpl->name);
                if (tmpl->subject)
                        fprintf(fp, "Subject: %s\n", tmpl->subject);
+               if (tmpl->to)
+                       fprintf(fp, "To: %s\n", tmpl->to);
                fputs("\n", fp);
                fwrite(tmpl->value, sizeof(gchar) * strlen(tmpl->value), 1,
                       fp);
index b6aae98..f5037e0 100644 (file)
@@ -27,6 +27,7 @@ typedef struct _Template      Template;
 struct _Template {
        gchar *name;
        gchar *subject;
+       gchar *to;
        gchar *value;
 };