4 * John Levon, moz@compsoc.man.ac.uk
8 #include "dlg/printdlgdata.h"
10 #include "support/lstrings.h"
11 #include "support/filetools.h"
14 #include <kfiledialog.h>
19 #define Inherited PrintDialogData
21 /* FIXME: tab order is out of whack */
23 PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * 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"));
40 PrintDialog::~PrintDialog()
44 void PrintDialog::clickedBrowse()
46 // FIXME: move into utility class later, accept URLs etc.
48 KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
50 if (filedlg.exec() == QDialog::Accepted)
51 filename->setText(filedlg.selectedFile().data());
54 void PrintDialog::changedCount(const char *text)
56 if (strcmp("",text) && strToInt(text) == 0) {
61 sort->setEnabled(strToInt(text) > 1);