]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLPrintDialog.C
Martin's changes to the Note inset.
[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 #include "support/filetools.h"
17 #include "support/lstrings.h"
18
19 #include "QPrint.h"
20 #include "QLPrintDialog.h"
21
22 #include <qfiledialog.h>
23 #include <qcheckbox.h>
24 #include <qlabel.h>
25 #include <qlineedit.h>
26 #include <qpushbutton.h>
27 #include <qradiobutton.h>
28 #include <qspinbox.h>
29
30
31 QLPrintDialog::QLPrintDialog(QPrint * f)
32         : QPrintDialogBase(0, 0, false, 0),
33         form_(f)
34 {
35         connect(printPB, SIGNAL(clicked()),
36                 form_, SLOT(slotOK()));
37         connect(closePB, SIGNAL(clicked()),
38                 form_, SLOT(slotClose()));
39 }
40
41
42 void QLPrintDialog::change_adaptor()
43 {
44         form_->changed();
45 }
46
47
48 void QLPrintDialog::browseClicked()
49 {
50         QString file =
51                 QFileDialog::getOpenFileName(QString::null,
52                                              qt_("PostScript files (*.ps)"),
53                                              this, 0,
54                                              qt_("Select a file to print to"));
55         if (!file.isNull()) {
56                 fileED->setText(file);
57                 form_->changed();
58         }
59 }
60
61
62 void QLPrintDialog::fileChanged()
63 {
64         if (!fileED->text().isEmpty())
65                 fileRB->setChecked(true);
66         form_->changed();
67 }
68
69
70 void QLPrintDialog::copiesChanged(int i)
71 {
72         collateCB->setEnabled(i != 1);
73         form_->changed();
74 }
75
76
77 void QLPrintDialog::printerChanged()
78 {
79         printerRB->setChecked(true);
80         form_->changed();
81 }
82
83
84 void QLPrintDialog::pagerangeChanged()
85 {
86         form_->changed();
87 }