3 * Copyright 2001 LyX Team
6 * \author John Levon, moz@compsoc.man.ac.uk
7 * \author Edwin Leuven, leuven@fee.uva.nl
13 #include "support/filetools.h"
14 #include "support/lstrings.h"
17 #include "QPrintDialog.h"
19 #include <qfiledialog.h>
20 #include <qcheckbox.h>
22 #include <qlineedit.h>
23 #include <qpushbutton.h>
24 #include <qradiobutton.h>
27 QPrintDialog::QPrintDialog(QPrint * f)
28 : QPrintDialogBase(0, 0, false, 0),
31 connect(printPB, SIGNAL(clicked()),
32 form_, SLOT(slotOK()));
33 connect(closePB, SIGNAL(clicked()),
34 form_, SLOT(slotClose()));
37 void QPrintDialog::change_adaptor()
43 void QPrintDialog::browseClicked()
45 QString file = QFileDialog::getOpenFileName(QString::null,
46 _("PostScript files (*.ps)"), this, 0, _("Select a file to print to"));
48 fileED->setText(file);
54 void QPrintDialog::fileChanged()
56 if (!fileED->text().isEmpty())
57 fileRB->setChecked(true);
62 void QPrintDialog::copiesChanged(int i)
64 collateCB->setEnabled(i != 1);
69 void QPrintDialog::printerChanged()
71 printerRB->setChecked(true);
76 void QPrintDialog::pagerangeChanged()
78 int from = strToUnsignedInt(fromED->text().latin1());
79 int to = strToUnsignedInt(toED->text().latin1());
81 if (!toED->text().isEmpty() && from > to)
82 fromED->setText(toED->text());