• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDEPrint

cupsdfilterpage.cpp

Go to the documentation of this file.
00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@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 "cupsdfilterpage.h"
00021 #include "cupsdconf.h"
00022 #include "sizewidget.h"
00023 
00024 #include <QtGui/QLabel>
00025 #include <QtGui/QLineEdit>
00026 #include <QtGui/QLayout>
00027 #include <QtGui/QComboBox>
00028 
00029 #include <klocale.h>
00030 #include <knuminput.h>
00031 
00032 CupsdFilterPage::CupsdFilterPage(QWidget *parent)
00033         : CupsdPage(parent)
00034 {
00035     setPageLabel(i18n("Filter"));
00036     setHeader(i18n("Filter Settings"));
00037     setPixmap("view-filter");
00038 
00039     user_ = new QLineEdit(this);
00040     group_ = new QLineEdit(this);
00041     ripcache_ = new SizeWidget(this);
00042     filterlimit_ = new KIntNumInput(this);
00043 
00044     filterlimit_->setRange(0, 1000, 1, true);
00045     filterlimit_->setSpecialValueText(i18n("Unlimited"));
00046     filterlimit_->setSteps(1, 10);
00047 
00048     QLabel *l1 = new QLabel(i18n("User:"), this);
00049     QLabel *l2 = new QLabel(i18n("Group:"), this);
00050     QLabel *l3 = new QLabel(i18n("RIP cache:"), this);
00051     QLabel *l4 = new QLabel(i18n("Filter limit:"), this);
00052 
00053     QGridLayout *m1 = new QGridLayout(this);
00054     m1->setMargin(10);
00055     m1->setSpacing(7);
00056     m1->setRowStretch(4, 1);
00057     m1->setColumnStretch(1, 1);
00058     m1->addWidget(l1, 0, 0, Qt::AlignRight);
00059     m1->addWidget(l2, 1, 0, Qt::AlignRight);
00060     m1->addWidget(l3, 2, 0, Qt::AlignRight);
00061     m1->addWidget(l4, 3, 0, Qt::AlignRight);
00062     m1->addWidget(user_, 0, 1);
00063     m1->addWidget(group_, 1, 1);
00064     m1->addWidget(ripcache_, 2, 1);
00065     m1->addWidget(filterlimit_, 3, 1);
00066 }
00067 
00068 bool CupsdFilterPage::loadConfig(CupsdConf *conf, QString&)
00069 {
00070     conf_ = conf;
00071     user_->setText(conf_->user_);
00072     group_->setText(conf_->group_);
00073     ripcache_->setSizeString(conf_->ripcache_);
00074     filterlimit_->setValue(conf_->filterlimit_);
00075 
00076     return true;
00077 }
00078 
00079 bool CupsdFilterPage::saveConfig(CupsdConf *conf, QString&)
00080 {
00081     conf->user_ = user_->text();
00082     conf->group_ = group_->text();
00083     conf->ripcache_ = ripcache_->sizeString();
00084     conf->filterlimit_ = filterlimit_->value();
00085 
00086     return true;
00087 }
00088 
00089 void CupsdFilterPage::setInfos(CupsdConf *conf)
00090 {
00091     user_->setWhatsThis(conf->comments_.toolTip("user"));
00092     group_->setWhatsThis(conf->comments_.toolTip("group"));
00093     ripcache_->setWhatsThis(conf->comments_.toolTip("ripcache"));
00094     filterlimit_->setWhatsThis(conf->comments_.toolTip("filterlimit"));
00095 }

KDEPrint

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

API Reference

Skip menu "API Reference"
  •   KDEPrint
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal