kpilot Library API Documentation

time-setup.cc

00001 /* Time-setup.cc                      KPilot
00002 **
00003 ** Copyright (C) 2002 by Reinhold Kainhofer
00004 **
00005 ** This file defines the setup dialog for the Time-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., 59 Temple Place, Suite 330, Boston,
00022 ** MA 02111-1307, 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 <qradiobutton.h>
00033 #include <qbuttongroup.h>
00034 #include <kapplication.h>
00035 #include <kconfig.h>
00036 
00037 #include "time-setup_dialog.h"
00038 
00039 #include "time-factory.h"
00040 #include "time-setup.moc"
00041 
00042 TimeWidgetConfig::TimeWidgetConfig(QWidget *w, const char *n) :
00043     ConduitConfigBase(w,n),
00044     fConfigWidget(new TimeWidget(w))
00045 {
00046     FUNCTIONSETUP;
00047     UIDialog::addAboutPage(fConfigWidget->tabWidget,TimeConduitFactory::about());
00048     fWidget=fConfigWidget;
00049     fConduitName=i18n("Time");
00050 }
00051 
00052 void TimeWidgetConfig::commit(KConfig *fConfig)
00053 {
00054     FUNCTIONSETUP;
00055     KConfigGroupSaver s(fConfig,TimeConduitFactory::group());
00056     fConfig->writeEntry(TimeConduitFactory::direction(),
00057         fConfigWidget->directionGroup->id(fConfigWidget->directionGroup->selected()));
00058 }
00059 
00060 void TimeWidgetConfig::load(KConfig *fConfig)
00061 {
00062     FUNCTIONSETUP;
00063     KConfigGroupSaver s(fConfig,TimeConduitFactory::group());
00064     fConfigWidget->directionGroup->setButton(fConfig->readNumEntry(TimeConduitFactory::direction(), DIR_PCToPalm) );
00065 }
00066 
00067 TimeWidgetSetup::TimeWidgetSetup(QWidget *w, const char *n,
00068     const QStringList & a) :
00069     ConduitConfig(w,n,a)
00070 {
00071     FUNCTIONSETUP;
00072 
00073     fConfigBase = new TimeWidgetConfig(widget(),"ConfigWidget");
00074     fConduitName=i18n("Time");
00075 }
00076 
00077 TimeWidgetSetup::~TimeWidgetSetup()
00078 {
00079     FUNCTIONSETUP;
00080 }
00081 
00082 /* virtual */ void TimeWidgetSetup::commitChanges()
00083 {
00084     FUNCTIONSETUP;
00085 
00086     if (!fConfig) return;
00087     fConfigBase->commit(fConfig);
00088 }
00089 
00090 /* virtual */ void TimeWidgetSetup::readSettings()
00091 {
00092     FUNCTIONSETUP;
00093 
00094     if (!fConfig) return;
00095     fConfigBase->load(fConfig);
00096 }
00097 
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:49 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003