20 #include "kmpropusers.h"
21 #include "kmprinter.h"
24 #include <tqtextview.h>
26 #include <tdelocale.h>
28 KMPropUsers::KMPropUsers(TQWidget *parent,
const char *name)
29 : KMPropWidget(parent,name)
31 m_text =
new TQTextView(
this);
32 m_text->setPaper(colorGroup().background());
33 m_text->setFrameStyle(TQFrame::NoFrame);
35 TQVBoxLayout *l0 =
new TQVBoxLayout(
this, 10, 0);
36 l0->addWidget(m_text, 1);
38 m_title = i18n(
"Users");
39 m_header = i18n(
"Users Access Settings");
40 m_pixmap =
"tdeprint_printer_users";
43 KMPropUsers::~KMPropUsers()
47 void KMPropUsers::setPrinter(KMPrinter *p)
49 if (p && p->isPrinter())
51 TQString txt(
"<p>%1:<ul>%1</ul></p>");
53 if (!p->option(
"requesting-user-name-denied").isEmpty())
55 txt = txt.arg(i18n(
"Denied users"));
56 users = TQStringList::split(
",", p->option(
"requesting-user-name-denied"),
false);
57 if (users.count() == 1 && users[0] ==
"none")
60 else if (!p->option(
"requesting-user-name-allowed").isEmpty())
62 txt = txt.arg(i18n(
"Allowed users"));
63 users = TQStringList::split(
",", p->option(
"requesting-user-name-allowed"),
false);
64 if (users.count() == 1 && users[0] ==
"all")
67 if (users.count() > 0)
70 for (TQStringList::ConstIterator it=users.begin(); it!=users.end(); ++it)
71 s.append(
"<li>").append(*it).append(
"</li>");
76 m_text->setText(i18n(
"All users allowed"));
78 emit enableChange(p->isLocal());
87 void KMPropUsers::configureWizard(KMWizard *w)
89 w->configure(KMWizard::Custom+4,KMWizard::Custom+4,
true);