1
/***************************************************************************
2
* Copyright (C) 2005 by Nicolas Ternisien *
3
* nicolas.ternisien@gmail.com *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
23
#include <qvgroupbox.h>
24
#include <qbuttongroup.h>
26
#include <qpushbutton.h>
32
#include <kactioncollection.h>
33
#include <kbuttonbox.h>
35
#include <kfiledialog.h>
37
#include <kmessagebox.h>
38
#include <kiconloader.h>
42
#include "cronOptions.h"
43
#include "ksystemlogConfig.h"
45
CronOptions::CronOptions(QWidget *parent) :
49
QHBoxLayout *layout = new QHBoxLayout(this);
50
layout->setAutoAdd(true);
52
QString description= i18n("<qt><p>These files will be analyzed to display <b>Cron Logs</b> (i.e. planned tasks logs). This list also determines the order in which the files are read.</p></qt>");
53
fileList=new SpecificFileList(this, description);
55
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
62
CronOptions::~CronOptions() {
63
//TODO Delete fileList
66
bool CronOptions::isValid() {
67
if (fileList->count()>0)
73
void CronOptions::slotFileListChanged(int itemLeft) {
75
emit optionsChanged(false);
77
emit optionsChanged(true);
80
void CronOptions::saveConfig() {
81
kdDebug() << "Saving config from Cron Options..." << endl;
83
QStringList stringList;
84
QValueList<int> valueList;
86
fileList->saveConfig(stringList, valueList);
88
KSystemLogConfig::setCronPaths(stringList);
89
KSystemLogConfig::setCronLevels(valueList);
92
void CronOptions::readConfig() {
93
QStringList stringList=KSystemLogConfig::cronPaths();
94
QValueList<int> valueList=KSystemLogConfig::cronLevels();
96
fileList->readConfig(stringList, valueList);
99
#include "cronOptions.moc"