20 #include "kmpropbackend.h"
21 #include "kmprinter.h"
26 #include <tdelocale.h>
28 KMPropBackend::KMPropBackend(TQWidget *parent,
const char *name)
29 : KMPropWidget(parent,name)
31 m_uri =
new TQLabel(
"",
this);
32 m_type =
new TQLabel(
"",
this);
34 TQLabel *l1 =
new TQLabel(i18n(
"Printer type:"),
this);
35 TQLabel *l2 =
new TQLabel(i18n(
"URI:"),
this);
38 TQGridLayout *main_ =
new TQGridLayout(
this, 3, 2, 10, 7);
39 main_->setColStretch(0,0);
40 main_->setColStretch(1,1);
41 main_->setRowStretch(2,1);
42 main_->addWidget(l1,0,0);
43 main_->addWidget(l2,1,0);
44 main_->addWidget(m_type,0,1);
45 main_->addWidget(m_uri,1,1);
47 m_pixmap =
"connect_established";
48 m_title = i18n(
"Interface");
49 m_header = i18n(
"Interface Settings");
52 KMPropBackend::~KMPropBackend()
56 void KMPropBackend::setPrinter(KMPrinter *p)
58 if (p && p->isPrinter())
60 m_uri->setText(KURL(p->device()).prettyURL());
61 TQString prot = p->deviceProtocol();
62 if (prot ==
"ipp" || prot ==
"http") m_type->setText(i18n(
"IPP Printer"));
63 else if (prot ==
"usb") m_type->setText(i18n(
"Local USB Printer"));
64 else if (prot ==
"parallel") m_type->setText(i18n(
"Local Parallel Printer"));
65 else if (prot ==
"serial") m_type->setText(i18n(
"Local Serial Printer"));
66 else if (prot ==
"socket") m_type->setText(i18n(
"Network Printer (socket)"));
67 else if (prot ==
"smb") m_type->setText(i18n(
"SMB printers (Windows)"));
68 else if (prot ==
"lpd") m_type->setText(i18n(
"Remote LPD queue"));
69 else if (prot ==
"file") m_type->setText(i18n(
"File printer"));
70 else if (prot ==
"fax") m_type->setText(i18n(
"Serial Fax/Modem printer"));
71 else m_type->setText(i18n(
"Unknown Protocol",
"Unknown"));
73 emit enableChange(p->isLocal());
83 void KMPropBackend::configureWizard(KMWizard *w)
85 w->configure(KMWizard::Backend,KMWizard::Driver,
false);