X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXSendto.C;h=5f672ac07bd0e4da087e725e2aaf06e06c7d0205;hb=5702f22ef0ea3d167fc5f327002d7006eef657b4;hp=1c007a81a3aad4c45e417817b2e3511bdcf56068;hpb=9625f5e2300339330e099ccea259c46667ea1461;p=lyx.git diff --git a/src/LyXSendto.C b/src/LyXSendto.C index 1c007a81a3..5f672ac07b 100644 --- a/src/LyXSendto.C +++ b/src/LyXSendto.C @@ -10,10 +10,11 @@ #include "buffer.h" #include "lyx_gui_misc.h" #include "support/syscall.h" +#include "support/lstrings.h" #include "gettext.h" -//#include "lyx_cb.h" #include "bufferview_funcs.h" #include "exporter.h" +#include "BufferView.h" extern FD_form_sendto * fd_form_sendto; extern BufferView * current_view; @@ -37,7 +38,7 @@ void MenuSendto() fl_raise_form(fd_form_sendto->form_sendto); } else { fl_show_form(fd_form_sendto->form_sendto, - FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, + FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT, _("Send Document to Command")); if (ow < 0) { ow = fd_form_sendto->form_sendto->w; @@ -57,18 +58,6 @@ void SendtoApplyCB(FL_OBJECT *, long) 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); - // Generate dvi file and check if there are errors in the .lyx file - if (MakeLaTeXOutput(buffer) > 0) { - AllowInput(current_view); - return; - } - AllowInput(current_view); - } -#endif string ftypeext; if (fl_get_button(fd_form_sendto->radio_ftype_lyx)) ftypeext = ".lyx"; @@ -79,27 +68,20 @@ void SendtoApplyCB(FL_OBJECT *, long) 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 = OnlyFilename(ChangeExtension(buffer->getLatexName(), - ftypeext)); + string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(), + ftypeext)); if (!contains(command, "$$FName")) command = "( " + command + " ) <$$FName"; command = subst(command, "$$FName", fname); command += " &"; // execute in background // push directorypath, if necessary string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)){ + if (lyxrc.use_tempdir || !IsDirWriteable(path)){ path = buffer->tmppath; } Path p(path);