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 
00043 TimeWidgetSetup::TimeWidgetSetup(QWidget *w, const char *n,
00044         const QStringList & a) :
00045         ConduitConfig(w,n,a)
00046 {
00047         FUNCTIONSETUP;
00048 
00049         fConfigWidget = new TimeWidget(widget());
00050         setTabWidget(fConfigWidget->tabWidget);
00051         addAboutPage(false,TimeConduitFactory::about());
00052 
00053         fConfigWidget->tabWidget->adjustSize();
00054         fConfigWidget->resize(fConfigWidget->tabWidget->size());
00055 }
00056 
00057 TimeWidgetSetup::~TimeWidgetSetup()
00058 {
00059         FUNCTIONSETUP;
00060 }
00061 
00062 /* virtual */ void TimeWidgetSetup::commitChanges()
00063 {
00064         FUNCTIONSETUP;
00065 
00066         if (!fConfig) return;
00067 
00068         KConfigGroupSaver s(fConfig,TimeConduitFactory::group());
00069 
00070         fConfig->writeEntry(TimeConduitFactory::direction(),
00071                 fConfigWidget->directionGroup->id(fConfigWidget->directionGroup->selected()));
00072 }
00073 
00074 /* virtual */ void TimeWidgetSetup::readSettings()
00075 {
00076         FUNCTIONSETUP;
00077 
00078         if (!fConfig) return;
00079 
00080         KConfigGroupSaver s(fConfig,TimeConduitFactory::group());
00081 
00082         fConfigWidget->directionGroup->setButton(fConfig->readNumEntry(TimeConduitFactory::direction(), DIR_PCToPalm) );
00083 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:15 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001