From 87cc7232f93413d6116d40dda389e43352544394 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Tue, 3 Apr 2012 19:19:27 -0500 Subject: Add renamed files from previous commit. --- ksystemlog/src/mail/Makefile.am | 7 +++ ksystemlog/src/mail/mailOptions.cpp | 100 ++++++++++++++++++++++++++++++++++++ ksystemlog/src/mail/mailOptions.h | 60 ++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 ksystemlog/src/mail/Makefile.am create mode 100644 ksystemlog/src/mail/mailOptions.cpp create mode 100644 ksystemlog/src/mail/mailOptions.h diff --git a/ksystemlog/src/mail/Makefile.am b/ksystemlog/src/mail/Makefile.am new file mode 100644 index 0000000..2f80c07 --- /dev/null +++ b/ksystemlog/src/mail/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes) +METASOURCES = AUTO + +noinst_LTLIBRARIES = libksystemlog_mail.la +libksystemlog_mail_la_LDFLAGS = $(all_libraries) +libksystemlog_mail_la_SOURCES = mailOptions.cpp +noinst_HEADERS = mailOptions.h diff --git a/ksystemlog/src/mail/mailOptions.cpp b/ksystemlog/src/mail/mailOptions.cpp new file mode 100644 index 0000000..0a8119a --- /dev/null +++ b/ksystemlog/src/mail/mailOptions.cpp @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (C) 2005 by Nicolas Ternisien * + * nicolas.ternisien@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +//TQt includes +#include +#include +#include +#include +#include +#include +#include + +//KDE includes +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//Project includes +#include "mailOptions.h" +#include "ksystemlogConfig.h" + +MailOptions::MailOptions(TQWidget *parent) : + TQWidget(parent) + { + + TQHBoxLayout *layout = new TQHBoxLayout(this); + layout->setAutoAdd(true); + + TQString description= i18n("

These files will be analyzed to display Mail Logs. This list also determine the order in which the files are read.

"); + fileList=new SpecificFileList(this, description); + + connect(fileList, TQT_SIGNAL(fileListChanged(int)), this, TQT_SLOT(slotFileListChanged(int))); + + readConfig(); + + +} + +MailOptions::~MailOptions() { + +} + +bool MailOptions::isValid() { + if (fileList->count()>0) + return(true); + else + return(false); +} + +void MailOptions::slotFileListChanged(int itemLeft) { + if (itemLeft==0) + emit optionsChanged(false); + else + emit optionsChanged(true); +} + +void MailOptions::saveConfig() { + kdDebug() << "Saving config from Daemon Options..." << endl; + + TQStringList stringList; + TQValueList valueList; + + fileList->saveConfig(stringList, valueList); + + KSystemLogConfig::setMailPaths(stringList); + KSystemLogConfig::setMailLevels(valueList); +} + +void MailOptions::readConfig() { + TQStringList stringList=KSystemLogConfig::mailPaths(); + TQValueList valueList=KSystemLogConfig::mailLevels(); + + fileList->readConfig(stringList, valueList); +} + +#include "mailOptions.moc" diff --git a/ksystemlog/src/mail/mailOptions.h b/ksystemlog/src/mail/mailOptions.h new file mode 100644 index 0000000..818a93d --- /dev/null +++ b/ksystemlog/src/mail/mailOptions.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2005 by Nicolas Ternisien * + * nicolas.ternisien@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _MAIL_OPTIONS_H_ +#define _MAIL_OPTIONS_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "globals.h" +#include "specificFileList.h" +#include "logLevel.h" + +class MailOptions : public TQWidget { + Q_OBJECT + + public: + MailOptions(TQWidget *parent = 0); + ~MailOptions(); + + bool isValid(); + public slots: + void saveConfig(); + void readConfig(); + + void slotFileListChanged(int itemLeft); + + signals: + void optionsChanged(bool valid); + + private: + + SpecificFileList* fileList; +}; + +#endif -- cgit v1.2.1