4 * John Levon, moz@compsoc.man.ac.uk
7 #include "printdlgdata.h"
9 #include "support/lstrings.h"
10 #include "support/filetools.h"
13 #include <kfiledialog.h>
18 #define Inherited PrintDialogData
20 PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * name)
21 : PrintDialogData(parent, name), form_(f)
24 QToolTip::add(allpages, _("Print every page"));
25 QToolTip::add(oddpages, _("Print odd-numbered pages only"));
26 QToolTip::add(evenpages, _("Print even-numbered pages only"));
27 QToolTip::add(from, _("Print from page number"));
28 QToolTip::add(to, _("Print to page number"));
29 QToolTip::add(reverse, _("Print in reverse order (last page first)"));
30 QToolTip::add(count, _("Number of copies to print"));
31 QToolTip::add(sort, _("Collate multiple copies"));
32 QToolTip::add(printername, _("Printer name"));
33 QToolTip::add(filename, _("Output filename"));
34 QToolTip::add(browse, _("Select output filename"));
37 PrintDialog::~PrintDialog()
41 void PrintDialog::clickedBrowse()
43 // FIXME: move into utility class later, accept URLs etc.
45 KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
47 if (filedlg.exec() == QDialog::Accepted)
48 filename->setText(filedlg.selectedFile().data());
51 void PrintDialog::changedCount(const char *text)
53 if (strcmp("",text) && strToInt(text) == 0) {
58 sort->setEnabled(strToInt(text) > 1);