]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/printdlg.C
Move LaTeX and VC logs to GUI-I on xforms
[lyx.git] / src / frontends / kde / printdlg.C
1 /*
2  * printdlg.C
3  * (C) 2000, LyX Team
4  * John Levon, moz@compsoc.man.ac.uk
5  */
6
7 #include <config.h>
8 #include "dlg/printdlgdata.h"
9 #include "printdlg.h"
10 #include "support/lstrings.h"
11 #include "support/filetools.h"
12
13 #include <qtooltip.h>
14 #include <kfiledialog.h>
15
16 #include <gettext.h>
17 #include <cstring>
18
19 #define Inherited PrintDialogData
20
21 /* FIXME: tab order is out of whack */
22
23 PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * name)
24         : PrintDialogData(parent, name), form_(f)
25 {
26         setCaption(name); 
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"));
38 }
39
40 PrintDialog::~PrintDialog()
41 {
42 }
43
44 void PrintDialog::clickedBrowse()
45 {
46         // FIXME: move into utility class later, accept URLs etc.
47
48         KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
49
50         if (filedlg.exec() == QDialog::Accepted)
51                 filename->setText(filedlg.selectedFile().data());
52 }
53
54 void PrintDialog::changedCount(const char *text)
55 {
56         if (strcmp("",text) && strToInt(text) == 0) {
57                 count->setText("1");
58                 return;
59         }
60
61         sort->setEnabled(strToInt(text) > 1);
62 }