]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLPrintDialog.C
Joao latest bits
[lyx.git] / src / frontends / qt2 / QLPrintDialog.C
1 /**
2  * \file QLPrintDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14
15 #include "qt_helpers.h"
16
17 #include "QPrint.h"
18 #include "QLPrintDialog.h"
19
20 #include <qfiledialog.h>
21 #include <qcheckbox.h>
22 #include <qlineedit.h>
23 #include <qpushbutton.h>
24 #include <qradiobutton.h>
25
26
27 QLPrintDialog::QLPrintDialog(QPrint * f)
28         : QPrintDialogBase(0, 0, false, 0),
29         form_(f)
30 {
31         connect(printPB, SIGNAL(clicked()),
32                 form_, SLOT(slotOK()));
33         connect(closePB, SIGNAL(clicked()),
34                 form_, SLOT(slotClose()));
35 }
36
37
38 void QLPrintDialog::change_adaptor()
39 {
40         form_->changed();
41 }
42
43
44 void QLPrintDialog::browseClicked()
45 {
46         QString file =
47                 QFileDialog::getOpenFileName(QString::null,
48                                              qt_("PostScript files (*.ps)"),
49                                              this, 0,
50                                              qt_("Select a file to print to"));
51         if (!file.isNull()) {
52                 fileED->setText(file);
53                 form_->changed();
54         }
55 }
56
57
58 void QLPrintDialog::fileChanged()
59 {
60         if (!fileED->text().isEmpty())
61                 fileRB->setChecked(true);
62         form_->changed();
63 }
64
65
66 void QLPrintDialog::copiesChanged(int i)
67 {
68         collateCB->setEnabled(i != 1);
69         form_->changed();
70 }
71
72
73 void QLPrintDialog::printerChanged()
74 {
75         printerRB->setChecked(true);
76         form_->changed();
77 }
78
79
80 void QLPrintDialog::pagerangeChanged()
81 {
82         form_->changed();
83 }