21 #include "kmprinter.h"
25 #include <tqtextview.h>
26 #include <tdelocale.h>
29 KMWEnd::KMWEnd(TQWidget *parent,
const char *name)
30 : KMWizardPage(parent,name)
33 m_title = i18n(
"Confirmation");
34 m_nextpage = KMWizard::Error;
36 m_view =
new TQTextView(
this);
38 TQVBoxLayout *lay =
new TQVBoxLayout(
this, 0, 0);
39 lay->addWidget(m_view,1);
42 void KMWEnd::initPrinter(KMPrinter *p)
45 TQString s(TQString::fromLatin1(
"<li><u>%1</u>: %2</li>"));
46 int ID = p->option(
"kde-backend").toInt();
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>");
56 if (ID == KMWizard::Class)
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>");
69 txt.append(TQString::fromLatin1(
"<b>%1</b><ul type=circle>").arg(i18n(
"Backend")));
70 KURL url ( p->device() );
74 txt.append(s.arg(i18n(
"Device")).arg(url.path()));
77 txt.append(s.arg(i18n(
"Printer IP")).arg(url.host()));
78 txt.append(s.arg(i18n(
"Port")).arg(url.port()));
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)));
85 txt.append(s.arg(i18n(
"File")).arg(url.path()));
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()));
96 txt.append(s.arg(i18n(
"URI")).arg(KURL( p->device()).prettyURL()));
99 txt.append(
"</ul><br>");
101 if (p->option(
"kde-driver") ==
"raw" || p->driver())
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")));
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()));
114 txt.append(
"</ul><br>");
118 m_view->setText(txt);