]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/printdlg.C
small cleanup, doxygen, formatting changes
[lyx.git] / src / frontends / kde / printdlg.C
1 /**
2  * \file printdlg.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #include <config.h>
10 #include "dlg/printdlgdata.h"
11 #include "printdlg.h"
12 #include "support/lstrings.h"
13 #include "support/filetools.h"
14
15 #include <qtooltip.h>
16 #include <kfiledialog.h>
17
18 #include <gettext.h>
19 #include <cstring>
20
21 #define Inherited PrintDialogData
22
23 PrintDialog::PrintDialog(FormPrint * f, QWidget * parent, char const * 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
41 PrintDialog::~PrintDialog()
42 {
43 }
44
45
46 void PrintDialog::clickedBrowse()
47 {
48         // FIXME: move into utility class later, accept URLs etc.
49
50         KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
51
52         if (filedlg.exec() == QDialog::Accepted)
53                 filename->setText(filedlg.selectedFile().data());
54 }
55
56
57 void PrintDialog::changedCount(char const * text)
58 {
59         if (compare("", text) && strToInt(text) == 0) {
60                 count->setText("1");
61                 return;
62         }
63
64         sort->setEnabled(strToInt(text) > 1);
65 }