kpilot Library API Documentation

abbrowser-setup.cc

00001 /* abbrowser-setup.cc                      KPilot
00002 **
00003 ** Copyright (C) 2001 by Dan Pilone
00004 **
00005 ** This file defines the setup dialog for the abbrowser-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 #include "abbrowser-setup.moc"
00031 
00032 #include <qtabwidget.h>
00033 #include <qcheckbox.h>
00034 #include <qcombobox.h>
00035 
00036 #include <kconfig.h>
00037 
00038 #include "kaddressbookConduit.h"
00039 #include "abbrowser-factory.h"
00040 
00041 
00042 AbbrowserWidgetSetup::AbbrowserWidgetSetup(QWidget *w, const char *n,
00043         const QStringList & a) :
00044         ConduitConfig(w,n,a)
00045 {
00046         FUNCTIONSETUP;
00047 
00048         fConfigWidget = new AbbrowserWidget(widget());
00049         setTabWidget(fConfigWidget->tabWidget);
00050         addAboutPage(false,AbbrowserConduitFactory::about());
00051 
00052         fConfigWidget->tabWidget->adjustSize();
00053         fConfigWidget->resize(fConfigWidget->tabWidget->size());
00054 }
00055 
00056 AbbrowserWidgetSetup::~AbbrowserWidgetSetup()
00057 {
00058         FUNCTIONSETUP;
00059 }
00060 
00061 /* virtual */ void AbbrowserWidgetSetup::commitChanges()
00062 {
00063         FUNCTIONSETUP;
00064 
00065         if (!fConfig) return;
00066 
00067         KConfigGroupSaver s(fConfig,AbbrowserConduitFactory::group());
00068 
00069         fConfig->writeEntry(AbbrowserConduitFactory::smartMerge(),
00070                 fConfigWidget->fSmartMerge->isChecked());
00071         fConfig->writeEntry(AbbrowserConduitFactory::conflictResolution(),
00072                 fConfigWidget->fConflictStrategy->currentItem());
00073         fConfig->writeEntry(AbbrowserConduitFactory::archiveDeletedRecs(),
00074                 fConfigWidget->fArchive->isChecked());
00075         fConfig->writeEntry(AbbrowserConduitFactory::streetType(),
00076                 fConfigWidget->fAddress->currentItem());
00077         fConfig->writeEntry(AbbrowserConduitFactory::faxType(),
00078                 fConfigWidget->fFax->currentItem());
00079         fConfig->writeEntry(AbbrowserConduitFactory::syncMode(),
00080                 fConfigWidget->fSyncMode->currentItem());
00081         fConfig->writeEntry(AbbrowserConduitFactory::firstSync(),
00082                 fConfigWidget->fFirstTimeSync->isChecked());
00083         fConfig->writeEntry(AbbrowserConduitFactory::otherField(),
00084                 fConfigWidget->fOtherPhone->currentItem());
00085 }
00086 
00087 /* virtual */ void AbbrowserWidgetSetup::readSettings()
00088 {
00089         FUNCTIONSETUP;
00090 
00091         if (!fConfig) return;
00092 
00093         KConfigGroupSaver s(fConfig,AbbrowserConduitFactory::group());
00094 
00095         fConfigWidget->fSmartMerge->setChecked(
00096                 fConfig->readBoolEntry(AbbrowserConduitFactory::smartMerge(),true));
00097         fConfigWidget->fConflictStrategy->setCurrentItem(
00098                 fConfig->readNumEntry(AbbrowserConduitFactory::conflictResolution(),0));
00099         fConfigWidget->fArchive->setChecked(
00100                 fConfig->readBoolEntry(AbbrowserConduitFactory::archiveDeletedRecs(),true));
00101         fConfigWidget->fAddress->setCurrentItem(
00102                 fConfig->readNumEntry(AbbrowserConduitFactory::streetType(),0));
00103         fConfigWidget->fFax->setCurrentItem(
00104                 fConfig->readNumEntry(AbbrowserConduitFactory::faxType(),0));
00105         fConfigWidget->fSyncMode->setCurrentItem(
00106                 fConfig->readNumEntry(AbbrowserConduitFactory::syncMode(),0));
00107         fConfigWidget->fFirstTimeSync->setChecked(
00108                 fConfig->readBoolEntry(AbbrowserConduitFactory::firstSync(),false));
00109         fConfigWidget->fOtherPhone->setCurrentItem(
00110                 fConfig->readNumEntry(AbbrowserConduitFactory::otherField(),0));
00111 }
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:14 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001