2 * \file GuiPrintDialog.cpp
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.
14 #include "controllers/ControlPrint.h"
15 #include "GuiPrintDialog.h"
17 #include "qt_helpers.h"
19 #include <qcheckbox.h>
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
22 #include <qradiobutton.h>
27 GuiPrintDialog::GuiPrintDialog(GuiPrint * f)
32 connect(printPB, SIGNAL(clicked()), form_, SLOT(slotOK()));
33 connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
35 connect(copiesSB, SIGNAL(valueChanged(int)), this, SLOT(copiesChanged(int)));
36 connect(printerED, SIGNAL(textChanged(const QString&)),
37 this, SLOT(printerChanged()));
38 connect(fileED, SIGNAL(textChanged(const QString&)),
39 this, SLOT(fileChanged() ));
40 connect(browsePB, SIGNAL(clicked()), this, SLOT(browseClicked()));
41 connect(allRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
42 connect(reverseCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
43 connect(collateCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
44 connect(fromED, SIGNAL(textChanged(const QString&)),
45 this, SLOT(pagerangeChanged()));
46 connect(fromED, SIGNAL(textChanged(const QString&)),
47 this, SLOT(change_adaptor()));
48 connect(toED, SIGNAL(textChanged(const QString&)),
49 this, SLOT(pagerangeChanged()));
50 connect(toED, SIGNAL(textChanged(const QString&)),
51 this, SLOT(change_adaptor()));
52 connect(fileRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
53 connect(printerRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
54 connect(rangeRB, SIGNAL(toggled(bool)), fromED, SLOT(setEnabled(bool)));
55 connect(rangeRB, SIGNAL(toggled(bool)), toED, SLOT(setEnabled(bool)));
59 void GuiPrintDialog::change_adaptor()
65 void GuiPrintDialog::browseClicked()
67 QString file = toqstr(form_->controller().browse(docstring()));
69 fileED->setText(file);
75 void GuiPrintDialog::fileChanged()
77 if (!fileED->text().isEmpty())
78 fileRB->setChecked(true);
83 void GuiPrintDialog::copiesChanged(int i)
85 collateCB->setEnabled(i != 1);
90 void GuiPrintDialog::printerChanged()
92 printerRB->setChecked(true);
97 void GuiPrintDialog::pagerangeChanged()
102 } // namespace frontend
105 #include "GuiPrintDialog_moc.cpp"