kmconfigjobs.cpp
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 "kmconfigjobs.h" 00021 00022 #include <tqgroupbox.h> 00023 #include <tqlayout.h> 00024 00025 #include <knuminput.h> 00026 #include <klocale.h> 00027 #include <kconfig.h> 00028 #include <kdialog.h> 00029 00030 KMConfigJobs::KMConfigJobs(TQWidget *parent, const char *name) 00031 : KMConfigPage(parent, name) 00032 { 00033 setPageName(i18n("Jobs")); 00034 setPageHeader(i18n("Print Job Settings")); 00035 setPagePixmap("exec"); 00036 00037 TQGroupBox *box = new TQGroupBox(0, Qt::Vertical, i18n("Jobs Shown"), this); 00038 00039 m_limit = new KIntNumInput(box); 00040 m_limit->setRange(0, 9999, 1, true); 00041 m_limit->setSpecialValueText(i18n("Unlimited")); 00042 m_limit->setLabel(i18n("Maximum number of jobs shown:")); 00043 00044 TQVBoxLayout *l0 = new TQVBoxLayout(this, 0, KDialog::spacingHint()); 00045 l0->addWidget(box, 0); 00046 l0->addStretch(1); 00047 TQVBoxLayout *l1 = new TQVBoxLayout(TQT_TQLAYOUT(box->layout()), KDialog::spacingHint()); 00048 l1->addWidget(m_limit); 00049 } 00050 00051 void KMConfigJobs::loadConfig(KConfig *conf) 00052 { 00053 conf->setGroup("Jobs"); 00054 m_limit->setValue(conf->readNumEntry("Limit", 0)); 00055 } 00056 00057 void KMConfigJobs::saveConfig(KConfig *conf) 00058 { 00059 conf->setGroup("Jobs"); 00060 conf->writeEntry("Limit", m_limit->value()); 00061 } 00062 00063 #include "kmconfigjobs.moc"