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

kdeprint

  • kdeprint
  • cups
kmpropusers.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <kdeprint@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 "kmpropusers.h"
21 #include "kmprinter.h"
22 #include "kmwizard.h"
23 
24 #include <tqtextview.h>
25 #include <tqlayout.h>
26 #include <klocale.h>
27 
28 KMPropUsers::KMPropUsers(TQWidget *parent, const char *name)
29 : KMPropWidget(parent,name)
30 {
31  m_text = new TQTextView(this);
32  m_text->setPaper(colorGroup().background());
33  m_text->setFrameStyle(TQFrame::NoFrame);
34 
35  TQVBoxLayout *l0 = new TQVBoxLayout(this, 10, 0);
36  l0->addWidget(m_text, 1);
37 
38  m_title = i18n("Users");
39  m_header = i18n("Users Access Settings");
40  m_pixmap = "kdeprint_printer_users";
41 }
42 
43 KMPropUsers::~KMPropUsers()
44 {
45 }
46 
47 void KMPropUsers::setPrinter(KMPrinter *p)
48 {
49  if (p && p->isPrinter())
50  {
51  TQString txt("<p>%1:<ul>%1</ul></p>");
52  TQStringList users;
53  if (!p->option("requesting-user-name-denied").isEmpty())
54  {
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")
58  users.clear();
59  }
60  else if (!p->option("requesting-user-name-allowed").isEmpty())
61  {
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")
65  users.clear();
66  }
67  if (users.count() > 0)
68  {
69  TQString s;
70  for (TQStringList::ConstIterator it=users.begin(); it!=users.end(); ++it)
71  s.append("<li>").append(*it).append("</li>");
72  txt = txt.arg(s);
73  m_text->setText(txt);
74  }
75  else
76  m_text->setText(i18n("All users allowed"));
77  emit enable(true);
78  emit enableChange(p->isLocal());
79  }
80  else
81  {
82  emit enable(false);
83  m_text->setText("");
84  }
85 }
86 
87 void KMPropUsers::configureWizard(KMWizard *w)
88 {
89  w->configure(KMWizard::Custom+4,KMWizard::Custom+4,true);
90 }

kdeprint

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

kdeprint

Skip menu "kdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeprint by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |