• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
  • management
kmwfile.cpp
1/*
2 * This file is part of the KDE libraries
3 * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License version 2 as published by the Free Software Foundation.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 **/
19
20#include "kmwfile.h"
21#include "kmwizard.h"
22#include "kmprinter.h"
23
24#include <tqlabel.h>
25#include <tqlayout.h>
26
27#include <kurlrequester.h>
28#include <tdelocale.h>
29#include <tdefiledialog.h>
30
31KMWFile::KMWFile(TQWidget *parent, const char *name)
32: KMWizardPage(parent,name)
33{
34 m_ID = KMWizard::File;
35 m_title = i18n("File Selection");
36 m_nextpage = KMWizard::Driver;
37
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);
45
46 TQVBoxLayout *lay1 = new TQVBoxLayout(this, 0, 30);
47 TQVBoxLayout *lay2 = new TQVBoxLayout(0, 0, 5);
48 lay1->addWidget(l1);
49 lay1->addLayout(lay2);
50 lay1->addStretch(1);
51 lay2->addWidget(l2);
52 lay2->addWidget(m_url);
53}
54
55bool KMWFile::isValid(TQString& msg)
56{
57 TQFileInfo fi(m_url->url());
58 if (fi.fileName().isEmpty())
59 {
60 msg = i18n("Empty file name.");
61 return false;
62 }
63
64 if (!fi.dir().exists())
65 {
66 msg = i18n("Directory does not exist.");
67 return false;
68 }
69
70 return true;
71}
72
73void KMWFile::updatePrinter(KMPrinter *p)
74{
75 TQString dev = TQString::fromLatin1("file:%1").arg(m_url->url());
76 p->setDevice(dev);
77}

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.4
This website is maintained by Timothy Pearson.