kpilot

time-setup.cc

Go to the documentation of this file.
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., 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 <qradiobutton.h>
00033 #include <qbuttongroup.h>
00034 
00035 #include <kapplication.h>
00036 #include <kaboutdata.h>
00037 
00038 #include "time-setup_dialog.h"
00039 
00040 #include "time-setup.moc"
00041 #include "timeConduitSettings.h"
00042 
00043 
00044 
00045 static KAboutData *createAbout()
00046 {
00047     KAboutData *fAbout = new KAboutData("Timeconduit",
00048         I18N_NOOP("Time Synchronization Conduit for KPilot"),
00049         KPILOT_VERSION,
00050         I18N_NOOP("Synchronizes the Time on the Handheld and the PC"),
00051         KAboutData::License_GPL,
00052         "(C) 2002, Reinhold Kainhofer");
00053     fAbout->addAuthor("Reinhold Kainhofer",
00054         I18N_NOOP("Primary Author"), "reinhold@kainhofer.com", "http://reinhold.kainhofer.com/");
00055     return fAbout;
00056 }
00057 
00058 
00059 
00060 TimeWidgetConfig::TimeWidgetConfig(QWidget *w, const char *n) :
00061     ConduitConfigBase(w,n),
00062     fConfigWidget(new TimeWidget(w))
00063 {
00064     FUNCTIONSETUP;
00065     fAbout = createAbout();
00066     ConduitConfigBase::addAboutPage(fConfigWidget->tabWidget,fAbout);
00067     fWidget=fConfigWidget;
00068     fConduitName=i18n("Time");
00069 }
00070 
00071 void TimeWidgetConfig::commit()
00072 {
00073     FUNCTIONSETUP;
00074     TimeConduitSettings::setDirection(
00075         fConfigWidget->directionGroup->id(fConfigWidget->directionGroup->selected()) );
00076     TimeConduitSettings::self()->writeConfig();
00077 }
00078 
00079 void TimeWidgetConfig::load()
00080 {
00081     FUNCTIONSETUP;
00082     TimeConduitSettings::self()->readConfig();
00083 
00084     fConfigWidget->directionGroup->setButton( TimeConduitSettings::direction() );
00085 }
00086