3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
15 #pragma implementation
19 #include "support/filetools.h"
20 #include "support/lstrings.h"
23 #include "QPrintDialog.h"
25 #include <qfiledialog.h>
26 #include <qcheckbox.h>
28 #include <qlineedit.h>
29 #include <qpushbutton.h>
30 #include <qradiobutton.h>
34 QPrintDialog::QPrintDialog(QPrint * f)
35 : QPrintDialogBase(0, 0, false, 0),
38 connect(printPB, SIGNAL(clicked()),
39 form_, SLOT(slotOK()));
40 connect(closePB, SIGNAL(clicked()),
41 form_, SLOT(slotClose()));
45 void QPrintDialog::change_adaptor()
51 void QPrintDialog::browseClicked()
54 QFileDialog::getOpenFileName(QString::null,
55 _("PostScript files (*.ps)"),
57 _("Select a file to print to"));
59 fileED->setText(file);
65 void QPrintDialog::fileChanged()
67 if (!fileED->text().isEmpty())
68 fileRB->setChecked(true);
73 void QPrintDialog::copiesChanged(int i)
75 collateCB->setEnabled(i != 1);
80 void QPrintDialog::printerChanged()
82 printerRB->setChecked(true);
87 void QPrintDialog::pagerangeChanged()
89 int const from = strToUnsignedInt(fromED->text().latin1());
90 int const to = strToUnsignedInt(toED->text().latin1());
92 if (!toED->text().isEmpty() && from > to)
93 fromED->setText(toED->text());