3 * See the file COPYING.
5 * \author Angus Leeming
7 * Full author contact details are available in file CREDITS
13 #pragma implementation
16 #include "ControlPrint.h"
19 #include "ButtonControllerBase.h"
23 #include "helper_funcs.h"
24 #include "PrinterParams.h"
26 #include "frontends/Alert.h"
27 #include "frontends/Liason.h"
29 #include "support/LAssert.h"
31 using Liason::printBuffer;
32 using Liason::getPrinterParams;
35 ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
36 : ControlDialogBD(lv, d),
41 void ControlPrint::apply()
43 if (!bufferIsAvailable())
48 if (!printBuffer(buffer(), params())) {
49 Alert::alert(_("Error:"),
51 _("Check that your parameters are correct"));
56 PrinterParams & ControlPrint::params() const
63 void ControlPrint::setParams()
65 if (params_) delete params_;
66 params_ = new PrinterParams(getPrinterParams(buffer()));
68 bc().valid(); // so that the user can press Ok
72 void ControlPrint::clearParams()
81 string const ControlPrint::Browse(string const & in_name)
83 string const title = _("Print to file");
84 string const pattern = "*.ps";
86 // Show the file browser dialog
87 return browseRelFile(&lv_, in_name, buffer()->filePath(),