"));
make_ptbuffer();
write_pt(def_pt_filename);
using_pt_template = false;
}
void cb_pt_html()
{
string pt_name = ICS_dir;
string html_text = "";
pt_name.append("plaintext_doc.html");
update_ptfields();
string ptform = pt_html_template;
for (int i = 0; i < num_ptfields; i++) {
if (ptfields[i].w_type != 'e')
replacestr( ptform, ptfields[i].f_type, ptfields[i].f_data );
else {
html_text = "";
if (progStatus.autowordwrap)
html_text.append(wordwrap(ptfields[i].f_data, progStatus.charcount));
else
html_text.append(ptfields[i].f_data);
html_text.append("");
replacestr( ptform, ptfields[i].f_type, html_text );
}
}
FILE *ptfile = fopen(pt_name.c_str(), "w");
fprintf(ptfile,"%s", ptform.c_str());
fclose(ptfile);
open_url(pt_name.c_str());
}
void cb_pt_msg_type()
{
if (tabs_msg_type->value() == tab_plaintext ) {
show_filename(def_pt_filename);
} else {
show_filename(def_rg_filename);
}
}
void cb_pt_textout()
{
string pt_name = ICS_dir;
pt_name.append("plaintext.txt");
update_ptfields();
string ptform = pt_txt_template;
for (int i = 0; i < num_ptfields; i++)
replacestr( ptform, ptfields[i].f_type, ptfields[i].f_data);
FILE *ptfile = fopen(pt_name.c_str(), "w");
fprintf(ptfile,"%s", ptform.c_str());
fclose(ptfile);
open_url(pt_name.c_str());
}