3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
14 #pragma implementation
17 #include "ControlPrint.h"
20 #include "ButtonControllerBase.h"
24 #include "helper_funcs.h"
25 #include "PrinterParams.h"
27 #include "frontends/Alert.h"
28 #include "frontends/Liason.h"
30 #include "support/LAssert.h"
32 using Liason::printBuffer;
33 using Liason::getPrinterParams;
36 ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
37 : ControlDialogBD(lv, d),
42 void ControlPrint::apply()
44 if (!bufferIsAvailable())
49 if (!printBuffer(buffer(), params())) {
50 Alert::alert(_("Error:"),
52 _("Check that your parameters are correct"));
57 PrinterParams & ControlPrint::params() const
64 void ControlPrint::setParams()
66 if (params_) delete params_;
67 params_ = new PrinterParams(getPrinterParams(buffer()));
69 bc().valid(); // so that the user can press Ok
73 void ControlPrint::clearParams()
82 string const ControlPrint::Browse(string const & in_name)
84 string const title = _("Print to file");
85 string const pattern = "*.ps";
87 // Show the file browser dialog
88 return browseRelFile(&lv_, in_name, buffer()->filePath(),