22 #include "kmprinter.h"
27 #include <kurlrequester.h>
28 #include <tdelocale.h>
29 #include <tdefiledialog.h>
31 KMWFile::KMWFile(TQWidget *parent,
const char *name)
32 : KMWizardPage(parent,name)
34 m_ID = KMWizard::File;
35 m_title = i18n(
"File Selection");
36 m_nextpage = KMWizard::Driver;
38 m_url =
new KURLRequester(
this);
39 m_url->setMode((KFile::Mode)(KFile::File|KFile::LocalOnly));
40 TQLabel *l1 =
new TQLabel(
this);
41 l1->setText(i18n(
"<p>The printing will be redirected to a file. Enter here the path "
42 "of the file you want to use for redirection. Use an absolute path or "
43 "the browse button for graphical selection.</p>"));
44 TQLabel *l2 =
new TQLabel(i18n(
"Print to file:"),
this);
46 TQVBoxLayout *lay1 =
new TQVBoxLayout(
this, 0, 30);
47 TQVBoxLayout *lay2 =
new TQVBoxLayout(0, 0, 5);
49 lay1->addLayout(lay2);
52 lay2->addWidget(m_url);
55 bool KMWFile::isValid(TQString& msg)
57 TQFileInfo fi(m_url->url());
58 if (fi.fileName().isEmpty())
60 msg = i18n(
"Empty file name.");
64 if (!fi.dir().exists())
66 msg = i18n(
"Directory does not exist.");
73 void KMWFile::updatePrinter(KMPrinter *p)
75 TQString dev = TQString::fromLatin1(
"file:%1").arg(m_url->url());