2001-02-12 14:09:09 +00:00
|
|
|
/**
|
|
|
|
* \file printdlg.C
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon
|
2000-10-17 08:27:35 +00:00
|
|
|
*/
|
|
|
|
|
2000-12-06 09:49:54 +00:00
|
|
|
#include <config.h>
|
2000-12-04 17:18:01 +00:00
|
|
|
#include "dlg/printdlgdata.h"
|
2000-10-17 08:27:35 +00:00
|
|
|
#include "printdlg.h"
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
#include "support/filetools.h"
|
|
|
|
|
|
|
|
#include <qtooltip.h>
|
|
|
|
#include <kfiledialog.h>
|
|
|
|
|
|
|
|
#include <gettext.h>
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
#define Inherited PrintDialogData
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
PrintDialog::PrintDialog(FormPrint * f, QWidget * parent, char const * name)
|
2000-10-17 08:27:35 +00:00
|
|
|
: PrintDialogData(parent, name), form_(f)
|
|
|
|
{
|
|
|
|
setCaption(name);
|
|
|
|
QToolTip::add(allpages, _("Print every page"));
|
|
|
|
QToolTip::add(oddpages, _("Print odd-numbered pages only"));
|
|
|
|
QToolTip::add(evenpages, _("Print even-numbered pages only"));
|
|
|
|
QToolTip::add(from, _("Print from page number"));
|
|
|
|
QToolTip::add(to, _("Print to page number"));
|
|
|
|
QToolTip::add(reverse, _("Print in reverse order (last page first)"));
|
|
|
|
QToolTip::add(count, _("Number of copies to print"));
|
|
|
|
QToolTip::add(sort, _("Collate multiple copies"));
|
|
|
|
QToolTip::add(printername, _("Printer name"));
|
2001-01-24 11:43:48 +00:00
|
|
|
QToolTip::add(filename, _("Output filename (PostScript)"));
|
2000-10-17 08:27:35 +00:00
|
|
|
QToolTip::add(browse, _("Select output filename"));
|
|
|
|
}
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
PrintDialog::~PrintDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
void PrintDialog::clickedBrowse()
|
|
|
|
{
|
|
|
|
// FIXME: move into utility class later, accept URLs etc.
|
|
|
|
|
|
|
|
KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false);
|
|
|
|
|
|
|
|
if (filedlg.exec() == QDialog::Accepted)
|
|
|
|
filename->setText(filedlg.selectedFile().data());
|
|
|
|
}
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
|
|
|
void PrintDialog::changedCount(char const * text)
|
2000-10-17 08:27:35 +00:00
|
|
|
{
|
|
|
|
if (strcmp("",text) && strToInt(text) == 0) {
|
|
|
|
count->setText("1");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sort->setEnabled(strToInt(text) > 1);
|
|
|
|
}
|