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

tdeprint

  • tdeprint
  • management
kmwend.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 "kmwend.h"
21#include "kmprinter.h"
22#include "kmwizard.h"
23#include "util.h"
24
25#include <tqtextview.h>
26#include <tdelocale.h>
27#include <tqlayout.h>
28
29KMWEnd::KMWEnd(TQWidget *parent, const char *name)
30: KMWizardPage(parent,name)
31{
32 m_ID = KMWizard::End;
33 m_title = i18n("Confirmation");
34 m_nextpage = KMWizard::Error;
35
36 m_view = new TQTextView(this);
37
38 TQVBoxLayout *lay = new TQVBoxLayout(this, 0, 0);
39 lay->addWidget(m_view,1);
40}
41
42void KMWEnd::initPrinter(KMPrinter *p)
43{
44 TQString txt;
45 TQString s(TQString::fromLatin1("<li><u>%1</u>: %2</li>"));
46 int ID = p->option("kde-backend").toInt();
47
48 // general information
49 txt.append(TQString::fromLatin1("<b>%1</b><ul type=circle>").arg(i18n("General")));
50 txt.append(s.arg(i18n("Type")).arg(p->option("kde-backend-description")));
51 txt.append(s.arg(i18n("Name")).arg(p->name()));
52 txt.append(s.arg(i18n("Location")).arg(p->location()));
53 txt.append(s.arg(i18n("Description")).arg(p->description()));
54 txt.append("</ul><br>");
55
56 if (ID == KMWizard::Class)
57 {
58 // class members
59 txt.append(TQString::fromLatin1("<b>%1</b><ul type=circle>").arg(i18n("Members")));
60 TQStringList m(p->members());
61 TQString s1(TQString::fromLatin1("<li>%1</li>"));
62 for (TQStringList::ConstIterator it=m.begin(); it!=m.end(); ++it)
63 txt.append(s1.arg(*it));
64 txt.append("</ul><br>");
65 }
66 else
67 {
68 // backend information
69 txt.append(TQString::fromLatin1("<b>%1</b><ul type=circle>").arg(i18n("Backend")));
70 KURL url ( p->device() );
71 switch (ID)
72 {
73 case KMWizard::Local:
74 txt.append(s.arg(i18n("Device")).arg(url.path()));
75 break;
76 case KMWizard::TCP:
77 txt.append(s.arg(i18n("Printer IP")).arg(url.host()));
78 txt.append(s.arg(i18n("Port")).arg(url.port()));
79 break;
80 case KMWizard::LPD:
81 txt.append(s.arg(i18n("Host")).arg(url.host()));
82 txt.append(s.arg(i18n("Queue")).arg(url.path().right(url.path().length()-1)));
83 break;
84 case KMWizard::File:
85 txt.append(s.arg(i18n("File")).arg(url.path()));
86 break;
87 case KMWizard::IPP:
88 txt.append(s.arg(i18n("Host")).arg(url.host()));
89 txt.append(s.arg(i18n("Port")).arg(url.port()));
90 txt.append(s.arg(i18n("Printer")).arg(url.path().right(url.path().length()-1)));
91 if (url.hasUser()) txt.append(s.arg(i18n("Account")).arg(url.user()));
92 break;
93 default:
94 // double decoding in case the printer name contains chars like '#' that are
95 // not decoded by "prettyURL".
96 txt.append(s.arg(i18n("URI")).arg(KURL( p->device()).prettyURL()));
97 break;
98 }
99 txt.append("</ul><br>");
100
101 if (p->option("kde-driver") == "raw" || p->driver())
102 {
103 // driver information
104 txt.append(TQString::fromLatin1("<b>%1</b><ul type=circle>").arg(i18n("Driver")));
105 if (p->option("kde-driver") == "raw")
106 txt.append(s.arg(i18n("Type")).arg(i18n("Raw printer")));
107 else
108 {
109 txt.append(s.arg(i18n("Type")).arg((p->dbEntry() ? i18n("DB driver") : i18n("External driver"))));
110 txt.append(s.arg(i18n("Manufacturer")).arg(p->manufacturer()));
111 txt.append(s.arg(i18n("Model")).arg(p->model()));
112 txt.append(s.arg(i18n("Description")).arg(p->driverInfo()));
113 }
114 txt.append("</ul><br>");
115 }
116 }
117
118 m_view->setText(txt);
119}

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.