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

tdeprint

  • tdeprint
  • cups
  • cupsdconf2
cupsdfilterpage.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 "cupsdfilterpage.h"
21 #include "cupsdconf.h"
22 #include "sizewidget.h"
23 
24 #include <tqlabel.h>
25 #include <tqlineedit.h>
26 #include <tqlayout.h>
27 #include <tqwhatsthis.h>
28 #include <tqcombobox.h>
29 
30 #include <tdelocale.h>
31 #include <knuminput.h>
32 
33 CupsdFilterPage::CupsdFilterPage(TQWidget *parent, const char *name)
34  : CupsdPage(parent, name)
35 {
36  setPageLabel(i18n("Filter"));
37  setHeader(i18n("Filter Settings"));
38  setPixmap("filter");
39 
40  user_ = new TQLineEdit(this);
41  group_ = new TQLineEdit(this);
42  ripcache_ = new SizeWidget(this);
43  filterlimit_ = new KIntNumInput(this);
44 
45  filterlimit_->setRange(0, 1000, 1, true);
46  filterlimit_->setSpecialValueText(i18n("Unlimited"));
47  filterlimit_->setSteps(1, 10);
48 
49  TQLabel *l1 = new TQLabel(i18n("User:"), this);
50  TQLabel *l2 = new TQLabel(i18n("Group:"), this);
51  TQLabel *l3 = new TQLabel(i18n("RIP cache:"), this);
52  TQLabel *l4 = new TQLabel(i18n("Filter limit:"), this);
53 
54  TQGridLayout *m1 = new TQGridLayout(this, 5, 2, 10, 7);
55  m1->setRowStretch(4, 1);
56  m1->setColStretch(1, 1);
57  m1->addWidget(l1, 0, 0, TQt::AlignRight);
58  m1->addWidget(l2, 1, 0, TQt::AlignRight);
59  m1->addWidget(l3, 2, 0, TQt::AlignRight);
60  m1->addWidget(l4, 3, 0, TQt::AlignRight);
61  m1->addWidget(user_, 0, 1);
62  m1->addWidget(group_, 1, 1);
63  m1->addWidget(ripcache_, 2, 1);
64  m1->addWidget(filterlimit_, 3, 1);
65 }
66 
67 bool CupsdFilterPage::loadConfig(CupsdConf *conf, TQString&)
68 {
69  conf_ = conf;
70  user_->setText(conf_->user_);
71  group_->setText(conf_->group_);
72  ripcache_->setSizeString(conf_->ripcache_);
73  filterlimit_->setValue(conf_->filterlimit_);
74 
75  return true;
76 }
77 
78 bool CupsdFilterPage::saveConfig(CupsdConf *conf, TQString&)
79 {
80  conf->user_ = user_->text();
81  conf->group_ = group_->text();
82  conf->ripcache_ = ripcache_->sizeString();
83  conf->filterlimit_ = filterlimit_->value();
84 
85  return true;
86 }
87 
88 void CupsdFilterPage::setInfos(CupsdConf *conf)
89 {
90  TQWhatsThis::add(user_, conf->comments_.toolTip("user"));
91  TQWhatsThis::add(group_, conf->comments_.toolTip("group"));
92  TQWhatsThis::add(ripcache_, conf->comments_.toolTip("ripcache"));
93  TQWhatsThis::add(filterlimit_, conf->comments_.toolTip("filterlimit"));
94 }

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.9.1
This website is maintained by Timothy Pearson.