kpilot
memofile-factory.ccGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "options.h"
00030
00031 #include <qtabwidget.h>
00032 #include <qlineedit.h>
00033 #include <qcheckbox.h>
00034
00035 #include <kconfig.h>
00036 #include <kinstance.h>
00037 #include <kaboutdata.h>
00038 #include <kurlrequester.h>
00039
00040 #include "setup_base.h"
00041 #include "memofile-conduit.h"
00042 #include "memofileSettings.h"
00043
00044 #include "pluginfactory.h"
00045
00046 class MemofileConduitConfig : public ConduitConfigBase
00047 {
00048 public:
00049 MemofileConduitConfig(QWidget *parent=0L, const char *n=0L);
00050 virtual void commit();
00051 virtual void load();
00052 protected:
00053 MemofileWidget *fConfigWidget;
00054 } ;
00055
00056 MemofileConduitConfig::MemofileConduitConfig(QWidget *p, const char *n) :
00057 ConduitConfigBase(p,n),
00058 fConfigWidget(new MemofileWidget(p))
00059 {
00060 FUNCTIONSETUP;
00061 fConduitName = i18n("Memofile");
00062 KAboutData *about = new KAboutData("MemofileConduit",
00063 I18N_NOOP("Memofile Conduit for KPilot"),
00064 KPILOT_VERSION,
00065 I18N_NOOP("Configures the Memofile Conduit for KPilot"),
00066 KAboutData::License_GPL,
00067 "(C) 2004, Jason 'vanRijn' Kasper");
00068 about->addAuthor("Jason 'vanRijn' Kasper",
00069 I18N_NOOP("Primary Author"),
00070 "vR@movingparts.net",
00071 "http://www.cs.kun.nl/~adridg/kpilot");
00072
00073 ConduitConfigBase::addAboutPage(fConfigWidget->tabWidget,about);
00074 fWidget=fConfigWidget;
00075 QObject::connect(fConfigWidget->fDirectory,SIGNAL(textChanged(const QString&)),
00076 this,SLOT(modified()));
00077 QObject::connect(fConfigWidget->fSyncPrivate,SIGNAL(toggled(bool)),
00078 this,SLOT(modified()));
00079
00080 }
00081
00082 void MemofileConduitConfig::commit()
00083 {
00084 FUNCTIONSETUP;
00085
00086 DEBUGKPILOT << fname
00087 << ": Directory="
00088 << fConfigWidget->fDirectory->url()
00089 << endl;
00090
00091 MemofileConduitSettings::setDirectory( fConfigWidget->fDirectory->url() );
00092 MemofileConduitSettings::setSyncPrivate( fConfigWidget->fSyncPrivate->isChecked() );
00093 MemofileConduitSettings::self()->writeConfig();
00094 unmodified();
00095 }
00096
00097 void MemofileConduitConfig::load()
00098 {
00099 FUNCTIONSETUP;
00100 MemofileConduitSettings::self()->readConfig();
00101
00102 fConfigWidget->fDirectory->setURL( MemofileConduitSettings::directory() );
00103 fConfigWidget->fSyncPrivate->setChecked( MemofileConduitSettings::syncPrivate() );
00104
00105 DEBUGKPILOT << fname
00106 << ": Read Directory: ["
00107 << fConfigWidget->fDirectory->url()
00108 << "], sync private records: ["
00109 << fConfigWidget->fSyncPrivate
00110 << "]" << endl;
00111
00112 unmodified();
00113 }
00114
00115
00116
00117 extern "C"
00118 {
00119
00120 void *init_conduit_memofile()
00121 {
00122 return new ConduitFactory<MemofileConduitConfig,MemofileConduit>(0,"memofileconduit");
00123 }
00124
00125 unsigned long version_conduit_memofile = Pilot::PLUGIN_API;
00126
00127 }
00128
|