#include "manage_window.h"
#include "prefs_common.h"
#include "compose.h"
+#include "addr_compl.h"
#include "quote_fmt.h"
static struct Templates {
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);
label1 = gtk_label_new(_("Template name"));
gtk_widget_show(label1);
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
ADD_ENTRY(entry_to, _("To:"), 0);
+ address_completion_register_entry(GTK_ENTRY(entry_to));
ADD_ENTRY(entry_subject, _("Subject:"), 1);
#undef ADD_ENTRY
gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
GTK_SIGNAL_FUNC(prefs_template_cancel_cb), NULL);
+ address_completion_start(window);
+
templates.window = window;
templates.ok_btn = ok_btn;
templates.clist_tmpls = clist_tmpls;
name = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_name),
0, -1);
subject = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_subject),
- 0, -1);
+ 0, -1);
to = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_to),
0, -1);
+ if (subject && *subject == '\0') {
+ g_free(subject);
+ subject = NULL;
+ }
+ if (to && *to == '\0') {
+ g_free(to);
+ to = NULL;
+ }
+
tmpl = g_new(Template, 1);
tmpl->name = name;
tmpl->subject = subject;