#include "gettext.h"
//#include "lyx_cb.h"
#include "bufferview_funcs.h"
+#include "exporter.h"
extern FD_form_sendto * fd_form_sendto;
extern BufferView * current_view;
void MenuSendto()
{
- static int ow = -1, oh;
+ static int ow = -1;
+ static int oh;
// do this only if the command is empty
if (!fl_get_input(fd_form_sendto->input_cmd) &&
if (command.empty())
return;
Buffer * buffer = current_view->buffer();
+#ifndef NEW_EXPORT
if (fl_get_button(fd_form_sendto->radio_ftype_dvi) ||
fl_get_button(fd_form_sendto->radio_ftype_ps)) {
ProhibitInput(current_view);
}
AllowInput(current_view);
}
+#endif
string ftypeext;
if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
ftypeext = ".lyx";
else if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
ftypeext = ".txt";
else {
+#ifdef NEW_EXPORT
+ ftypeext = ".ps";
+ if (!Exporter::Export(buffer, "ps", true))
+ return;
+#else
ftypeext = ".ps_tmp";
if (!CreatePostscript(buffer, true)) {
return;
}
+#endif
}
- string fname = ChangeExtension(buffer->getLatexName(), ftypeext, true);
+ string fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
+ ftypeext));
if (!contains(command, "$$FName"))
command = "( " + command + " ) <$$FName";
command = subst(command, "$$FName", fname);