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

tdeprint

  • tdeprint
  • cups
kmpropquota.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 "kmpropquota.h"
21 #include "kmprinter.h"
22 #include "kmwizard.h"
23 
24 #include <tqlabel.h>
25 #include <tqlayout.h>
26 #include <tdelocale.h>
27 
28 // some forward declarations (see kmwquota.cpp)
29 const char* unitKeyword(int);
30 int findUnit(int&);
31 
32 KMPropQuota::KMPropQuota(TQWidget *parent, const char *name)
33 : KMPropWidget(parent,name)
34 {
35  m_period = new TQLabel(this);
36  m_sizelimit = new TQLabel(this);
37  m_pagelimit = new TQLabel(this);
38 
39  TQLabel *l1 = new TQLabel(i18n("&Period:"), this);
40  TQLabel *l2 = new TQLabel(i18n("&Size limit (KB):"), this);
41  TQLabel *l3 = new TQLabel(i18n("&Page limit:"), this);
42 
43  l1->setBuddy(m_period);
44  l2->setBuddy(m_sizelimit);
45  l3->setBuddy(m_pagelimit);
46 
47  TQGridLayout *main_ = new TQGridLayout(this, 4, 2, 10, 10);
48  main_->setColStretch(1,1);
49  main_->setRowStretch(3,1);
50  main_->addWidget(l1,0,0);
51  main_->addWidget(l2,1,0);
52  main_->addWidget(l3,2,0);
53  main_->addWidget(m_period,0,1);
54  main_->addWidget(m_sizelimit,1,1);
55  main_->addWidget(m_pagelimit,2,1);
56 
57  m_title = i18n("Quotas");
58  m_header = i18n("Quota Settings");
59  m_pixmap = "system-lock-screen";
60 }
61 
62 KMPropQuota::~KMPropQuota()
63 {
64 }
65 
66 void KMPropQuota::setPrinter(KMPrinter *p)
67 {
68  if (p && p->isPrinter())
69  {
70  int qu(0), si(0), pa(0), un(0);
71  qu = p->option("job-quota-period").toInt();
72  si = p->option("job-k-limit").toInt();
73  pa = p->option("job-page-limit").toInt();
74  if (si == 0 && pa == 0)
75  qu = -1;
76  if (qu > 0)
77  un = findUnit(qu);
78  m_period->setText(qu == -1 ? i18n("No quota") : TQString::number(qu).append(" ").append(i18n(unitKeyword(un))));
79  m_sizelimit->setText(si ? TQString::number(si) : i18n("None"));
80  m_pagelimit->setText(pa ? TQString::number(pa) : i18n("None"));
81  emit enable(true);
82  emit enableChange(p->isLocal());
83  }
84  else
85  {
86  emit enable(false);
87  m_period->setText("");
88  m_sizelimit->setText("");
89  m_pagelimit->setText("");
90  }
91 }
92 
93 void KMPropQuota::configureWizard(KMWizard *w)
94 {
95  w->configure(KMWizard::Custom+3,KMWizard::Custom+3,true);
96 }

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.