From 8a2a9c6bb40c83a4bdd64b28a9cd3d425fa34e6d Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Thu, 29 Nov 2001 08:37:51 +0000 Subject: [PATCH] sync with sylpheed 0.6.5cvs19 --- ChangeLog | 8 +++++- ChangeLog.claws | 5 ++++ ChangeLog.jp | 6 ++++ configure.in | 2 +- src/compose.c | 2 ++ src/prefs_template.c | 68 +++++++++++++++++++++++--------------------- src/template.c | 6 ++++ src/template.h | 1 + 8 files changed, 64 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e91015b3..720566377 100644 --- 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 @@ -2911,7 +2917,7 @@ 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. diff --git a/ChangeLog.claws b/ChangeLog.claws index d7e12c6fb..039dddfe4 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/ChangeLog.jp b/ChangeLog.jp index b65f38b29..e086e344b 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -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(): ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿ diff --git a/configure.in b/configure.in index 5b9dc579c..cb265e305 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/compose.c b/src/compose.c index 50ad6e697..c70858b6b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -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; diff --git a/src/prefs_template.c b/src/prefs_template.c index a6da3df39..92aa9ab78 100644 --- a/src/prefs_template.c +++ b/src/prefs_template.c @@ -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; diff --git a/src/template.c b/src/template.c index 80721819b..73c4de6b7 100644 --- a/src/template.c +++ b/src/template.c @@ -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); diff --git a/src/template.h b/src/template.h index b6aae98c6..f5037e080 100644 --- a/src/template.h +++ b/src/template.h @@ -27,6 +27,7 @@ typedef struct _Template Template; struct _Template { gchar *name; gchar *subject; + gchar *to; gchar *value; }; -- 2.25.1