X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FLiason.C;h=ee8d456c831cfadfaea7c5f4daf122e2f088e201;hb=3e39bef2c13125023f3b72532d90575bbe307335;hp=37a1f94b32feb1693101fb88d3396ddd17f05c3f;hpb=ec57ed1e96f6ca1b36c094b9a0083351ac313890;p=lyx.git diff --git a/src/frontends/Liason.C b/src/frontends/Liason.C index 37a1f94b32..ee8d456c83 100644 --- a/src/frontends/Liason.C +++ b/src/frontends/Liason.C @@ -1,10 +1,10 @@ /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. + * Copyright 1995-2001 The LyX Team. * * ====================================================== */ @@ -15,18 +15,20 @@ #endif #include "Liason.h" +#include "lyxrc.h" +#include "PrinterParams.h" + #include "LyXView.h" #include "BufferView.h" #include "buffer.h" -#include "lyxrc.h" -#include "PrinterParams.h" -#include "lyx_gui_misc.h" +#include "exporter.h" +#include "converter.h" + +#include "support/LAssert.h" #include "support/lstrings.h" #include "support/filetools.h" #include "support/path.h" -#include "exporter.h" -#include "converter.h" -#include "support/syscall.h" +#include "support/systemcall.h" using std::endl; @@ -43,10 +45,10 @@ PrinterParams getPrinterParams(Buffer * buffer) } -bool printBuffer(Buffer * buffer, PrinterParams const & pp) +bool printBuffer(Buffer * buffer, PrinterParams const & pp) { string command(lyxrc.print_command + ' '); - + if (pp.target == PrinterParams::PRINTER && lyxrc.print_adapt_output // dvips wants a printer name && !pp.printer_name.empty()) {// printer name given @@ -63,7 +65,7 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) case PrinterParams::ODD: command += lyxrc.print_oddpage_flag + ' '; break; - + default: // only option left is print all of them break; @@ -105,8 +107,8 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) return false; // Push directory path. - string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { + string path = buffer->filePath(); + if (lyxrc.use_tempdir || !IsDirWriteable(path)) { path = buffer->tmppath; } Path p(path); @@ -115,7 +117,7 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) // 1. we print to a file // 2. we print direct to a printer // 3. we print using a spool command (print to file first) - Systemcalls one; + Systemcall one; int res = 0; string dviname = ChangeExtension(buffer->getLatexName(true), "dvi"); switch (pp.target) { @@ -133,13 +135,13 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) command2 += QuoteName(psname); // First run dvips. // If successful, then spool command - res = one.startscript(Systemcalls::System, command); + res = one.startscript(Systemcall::Wait, command); if (res == 0) - res = one.startscript(Systemcalls::SystemDontWait, + res = one.startscript(Systemcall::DontWait, command2); } else // case 2 - res = one.startscript(Systemcalls::SystemDontWait, + res = one.startscript(Systemcall::DontWait, command + QuoteName(dviname)); break; @@ -148,7 +150,7 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) command += lyxrc.print_to_file + QuoteName(MakeAbsPath(pp.file_name, path)); command += ' ' + QuoteName(dviname); - res = one.startscript(Systemcalls::SystemDontWait, command); + res = one.startscript(Systemcall::DontWait, command); break; } return res == 0;