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

tdeprint

kmpropquota.cpp

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
00018  **/
00019 
00020 #include "kmpropquota.h"
00021 #include "kmprinter.h"
00022 #include "kmwizard.h"
00023 
00024 #include <tqlabel.h>
00025 #include <tqlayout.h>
00026 #include <tdelocale.h>
00027 
00028 // some forward declarations (see kmwquota.cpp)
00029 const char* unitKeyword(int);
00030 int findUnit(int&);
00031 
00032 KMPropQuota::KMPropQuota(TQWidget *parent, const char *name)
00033 : KMPropWidget(parent,name)
00034 {
00035     m_period = new TQLabel(this);
00036     m_sizelimit = new TQLabel(this);
00037     m_pagelimit = new TQLabel(this);
00038 
00039     TQLabel *l1 = new TQLabel(i18n("&Period:"), this);
00040     TQLabel *l2 = new TQLabel(i18n("&Size limit (KB):"), this);
00041     TQLabel *l3 = new TQLabel(i18n("&Page limit:"), this);
00042 
00043     l1->setBuddy(m_period);
00044     l2->setBuddy(m_sizelimit);
00045     l3->setBuddy(m_pagelimit);
00046 
00047     TQGridLayout    *main_ = new TQGridLayout(this, 4, 2, 10, 10);
00048     main_->setColStretch(1,1);
00049     main_->setRowStretch(3,1);
00050     main_->addWidget(l1,0,0);
00051     main_->addWidget(l2,1,0);
00052     main_->addWidget(l3,2,0);
00053     main_->addWidget(m_period,0,1);
00054     main_->addWidget(m_sizelimit,1,1);
00055     main_->addWidget(m_pagelimit,2,1);
00056 
00057     m_title = i18n("Quotas");
00058     m_header = i18n("Quota Settings");
00059     m_pixmap = "system-lock-screen";
00060 }
00061 
00062 KMPropQuota::~KMPropQuota()
00063 {
00064 }
00065 
00066 void KMPropQuota::setPrinter(KMPrinter *p)
00067 {
00068     if (p && p->isPrinter())
00069     {
00070         int qu(0), si(0), pa(0), un(0);
00071         qu = p->option("job-quota-period").toInt();
00072         si = p->option("job-k-limit").toInt();
00073         pa = p->option("job-page-limit").toInt();
00074         if (si == 0 && pa == 0)
00075             qu = -1;
00076         if (qu > 0)
00077             un = findUnit(qu);
00078         m_period->setText(qu == -1 ? i18n("No quota") : TQString::number(qu).append(" ").append(i18n(unitKeyword(un))));
00079         m_sizelimit->setText(si ? TQString::number(si) : i18n("None"));
00080         m_pagelimit->setText(pa ? TQString::number(pa) : i18n("None"));
00081         emit enable(true);
00082         emit enableChange(p->isLocal());
00083     }
00084     else
00085     {
00086         emit enable(false);
00087         m_period->setText("");
00088         m_sizelimit->setText("");
00089         m_pagelimit->setText("");
00090     }
00091 }
00092 
00093 void KMPropQuota::configureWizard(KMWizard *w)
00094 {
00095     w->configure(KMWizard::Custom+3,KMWizard::Custom+3,true);
00096 }

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