2 * \file QLPrintDialog.C
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 "QLPrintDialog.h"
17 #include "qt_helpers.h"
19 #include <qcheckbox.h>
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
22 #include <qradiobutton.h>
27 QLPrintDialog::QLPrintDialog(QPrint * f)
32 connect(printPB, SIGNAL(clicked()),
33 form_, SLOT(slotOK()));
34 connect(closePB, SIGNAL(clicked()),
35 form_, SLOT(slotClose()));
37 connect( copiesSB, SIGNAL( valueChanged(int) ), this, SLOT( copiesChanged(int) ) );
38 connect( printerED, SIGNAL( textChanged(const QString&) ), this, SLOT( printerChanged() ) );
39 connect( fileED, SIGNAL( textChanged(const QString&) ), this, SLOT( fileChanged() ) );
40 connect( browsePB, SIGNAL( clicked() ), this, SLOT( browseClicked() ) );
41 connect( allRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
42 connect( reverseCB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
43 connect( collateCB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
44 connect( fromED, SIGNAL( textChanged(const QString&) ), this, SLOT( pagerangeChanged() ) );
45 connect( fromED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
46 connect( toED, SIGNAL( textChanged(const QString&) ), this, SLOT( pagerangeChanged() ) );
47 connect( toED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
48 connect( fileRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
49 connect( printerRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
50 connect( rangeRB, SIGNAL( toggled(bool) ), fromED, SLOT( setEnabled(bool) ) );
51 connect( rangeRB, SIGNAL( toggled(bool) ), toED, SLOT( setEnabled(bool) ) );
55 void QLPrintDialog::change_adaptor()
61 void QLPrintDialog::browseClicked()
63 QString file = toqstr(form_->controller().browse(docstring()));
65 fileED->setText(file);
71 void QLPrintDialog::fileChanged()
73 if (!fileED->text().isEmpty())
74 fileRB->setChecked(true);
79 void QLPrintDialog::copiesChanged(int i)
81 collateCB->setEnabled(i != 1);
86 void QLPrintDialog::printerChanged()
88 printerRB->setChecked(true);
93 void QLPrintDialog::pagerangeChanged()
98 } // namespace frontend
101 #include "QLPrintDialog_moc.cpp"