1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 *======================================================
10 * \file ControlPrint.C
11 * \author Angus Leeming, a.leeming@.ac.uk
17 #pragma implementation
20 #include "ControlPrint.h"
25 #include "PrinterParams.h"
28 #include "lyx_gui_misc.h" // WriteAlert
30 using Liason::printBuffer;
31 using Liason::getPrinterParams;
33 ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
34 : ControlDialog<ControlConnectBD>(lv, d)
36 d_.showPrint.connect(SigC::slot(this, &ControlPrint::show));
40 void ControlPrint::apply()
42 if (!lv_.view()->available())
47 if (!printBuffer(lv_.buffer(), params())) {
48 WriteAlert(_("Error:"),
50 _("Check that your parameters are correct"));
55 LyXView * ControlPrint::lv() const
61 PrinterParams & ControlPrint::params() const
68 void ControlPrint::setParams()
70 if (params_) delete params_;
71 params_ = new PrinterParams(getPrinterParams(lv_.buffer()));
73 bc().valid(); // so that the user can press Ok
77 void ControlPrint::clearParams()