3 * Copyright 2001 LyX Team
6 * \author John Levon, moz@compsoc.man.ac.uk
7 * \author Edwin Leuven, leuven@fee.uva.nl
10 #include <qfiledialog.h>
11 #include <qcheckbox.h>
13 #include <qlineedit.h>
14 #include <qpushbutton.h>
15 #include <qradiobutton.h>
18 #include "QPrintDialog.h"
23 #include "support/filetools.h"
24 #include "support/lstrings.h"
29 QPrintDialog::QPrintDialog(QPrint * f)
30 : QPrintDialogBase(0, 0, false, 0),
33 connect(printPB, SIGNAL(clicked()),
34 form_, SLOT(slotOK()));
35 connect(closePB, SIGNAL(clicked()),
36 form_, SLOT(slotClose()));
39 void QPrintDialog::change_adaptor()
45 void QPrintDialog::browseClicked()
47 QString file = QFileDialog::getOpenFileName(QString::null,
48 _("PostScript files (*.ps)"), this, 0, _("Select a file to print to"));
50 fileED->setText(file);
56 void QPrintDialog::fileChanged()
58 if (!fileED->text().isEmpty())
59 fileRB->setChecked(true);
64 void QPrintDialog::copiesChanged(int i)
66 collateCB->setEnabled(i != 1);
71 void QPrintDialog::printerChanged()
73 printerRB->setChecked(true);
78 void QPrintDialog::pagerangeChanged()
80 int from = strToUnsignedInt(fromED->text().latin1());
81 int to = strToUnsignedInt(toED->text().latin1());
83 if (!toED->text().isEmpty() && from > to)
84 fromED->setText(toED->text());