3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
10 #include "dlg/printdlgdata.h"
12 #include "support/lstrings.h"
13 #include "support/filetools.h"
16 #include <kfiledialog.h>
21 #define Inherited PrintDialogData
23 PrintDialog::PrintDialog(FormPrint * f, QWidget * parent, char const * name)
24 : PrintDialogData(parent, name), form_(f)
27 QToolTip::add(allpages, _("Print every page"));
28 QToolTip::add(oddpages, _("Print odd-numbered pages only"));
29 QToolTip::add(evenpages, _("Print even-numbered pages only"));
30 QToolTip::add(from, _("Print from page number"));
31 QToolTip::add(to, _("Print to page number"));
32 QToolTip::add(reverse, _("Print in reverse order (last page first)"));
33 QToolTip::add(count, _("Number of copies to print"));
34 QToolTip::add(sort, _("Collate multiple copies"));
35 QToolTip::add(printername, _("Printer name"));
36 QToolTip::add(filename, _("Output filename (PostScript)"));
37 QToolTip::add(browse, _("Select output filename"));
41 PrintDialog::~PrintDialog()
46 void PrintDialog::clickedBrowse()
48 // FIXME: move into utility class later, accept URLs etc.
50 KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
52 if (filedlg.exec() == QDialog::Accepted)
53 filename->setText(filedlg.selectedFile().data());
57 void PrintDialog::changedCount(char const * text)
59 if (compare("", text) && strToInt(text) == 0) {
64 sort->setEnabled(strToInt(text) > 1);