3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
13 #include "support/lstrings.h"
14 #include "support/filetools.h"
17 #include "dlg/printdlgdata.h"
20 #include <kfiledialog.h>
22 #define Inherited PrintDialogData
24 PrintDialog::PrintDialog(FormPrint * f, QWidget * parent, char const * name)
25 : PrintDialogData(parent, name), form_(f)
28 QToolTip::add(radio_allpages, _("Print every page"));
29 QToolTip::add(radio_oddpages, _("Print odd-numbered pages only"));
30 QToolTip::add(radio_evenpages, _("Print even-numbered pages only"));
31 QToolTip::add(line_from, _("Print from page number"));
32 QToolTip::add(line_to, _("Print to page number"));
33 QToolTip::add(check_reverse, _("Print in reverse order (last page first)"));
34 QToolTip::add(line_count, _("Number of copies to print"));
35 QToolTip::add(check_sort, _("Collate multiple copies"));
36 QToolTip::add(line_printername, _("Printer name"));
37 QToolTip::add(line_filename, _("Output filename (PostScript)"));
38 QToolTip::add(button_browse, _("Select output filename"));
42 PrintDialog::~PrintDialog()
47 void PrintDialog::clickedBrowse()
49 // FIXME: move into utility class later, accept URLs etc.
51 KFileDialog filedlg(OnlyPath(line_filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
53 if (filedlg.exec() == QDialog::Accepted)
54 line_filename->setText(filedlg.selectedFile().data());
58 void PrintDialog::changedCount(char const * text)
60 if (compare("", text) && strToInt(text) == 0) {
61 line_count->setText("1");
65 check_sort->setEnabled(strToInt(text) > 1);