kpilot

knotes-setup.cc

Go to the documentation of this file.
00001 /* KPilot
00002 **
00003 ** Copyright (C) 2001,2003 by Dan Pilone
00004 **
00005 ** This file defines the setup dialog for the knotes-conduit plugin.
00006 */
00007 
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU General Public License as published by
00011 ** the Free Software Foundation; either version 2 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00022 ** MA 02110-1301, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 #include "options.h"
00030 
00031 #include <qtabwidget.h>
00032 #include <qcheckbox.h>
00033 #include <qmap.h>
00034 #include <qtimer.h>
00035 
00036 #include <kapplication.h>
00037 #include <kconfig.h>
00038 
00039 #include "setup_base.h"
00040 
00041 #include "knotes-factory.h"
00042 #include "knotes-setup.h"
00043 #include "knotesconduitSettings.h"
00044 
00045 
00046 KNotesConfigBase::KNotesConfigBase(QWidget *w, const char *n) :
00047     ConduitConfigBase(w,n),
00048     fConfigWidget(0L)
00049 {
00050     fConfigWidget = new KNotesWidget(w);
00051     ConduitConfigBase::addAboutPage(fConfigWidget->tabWidget,KNotesConduitFactory::about());
00052     fWidget = fConfigWidget;
00053     QObject::connect(fConfigWidget->fDeleteNoteForMemo,SIGNAL(clicked()),
00054         this,SLOT(modified()));
00055     QObject::connect(fConfigWidget->fSuppressConfirm,SIGNAL(clicked()),
00056         this,SLOT(modified()));
00057     QObject::connect(fConfigWidget->fDeleteNoteForMemo,SIGNAL(toggled(bool)),
00058         fConfigWidget->fSuppressConfirm,SLOT(setEnabled(bool)));
00059     fConduitName=i18n("KNotes");
00060 }
00061 
00062 void KNotesConfigBase::commit()
00063 {
00064     KNotesConduitSettings::setDeleteNoteForMemo( fConfigWidget->fDeleteNoteForMemo->isChecked() );
00065     KNotesConduitSettings::setSuppressKNotesConfirm(fConfigWidget->fSuppressConfirm->isChecked());
00066     KNotesConduitSettings::self()->writeConfig();
00067     unmodified();
00068 }
00069 
00070 void KNotesConfigBase::load()
00071 {
00072     KNotesConduitSettings::self()->readConfig();
00073     fConfigWidget->fDeleteNoteForMemo->setChecked(KNotesConduitSettings::deleteNoteForMemo() );
00074     fConfigWidget->fSuppressConfirm->setChecked(KNotesConduitSettings::suppressKNotesConfirm() );
00075     fConfigWidget->fSuppressConfirm->setEnabled(KNotesConduitSettings::deleteNoteForMemo());
00076     unmodified();
00077 }
00078 
00079 /* static */ ConduitConfigBase *KNotesConfigBase::create(QWidget *w, const char *n)
00080 {
00081     return new KNotesConfigBase(w,n);
00082 }
00083