kpilot
vcal-setupbase.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
00030 #include "options.h"
00031
00032 #include <qcheckbox.h>
00033 #include <qbuttongroup.h>
00034 #include <qcombobox.h>
00035
00036 #include <kurlrequester.h>
00037
00038 #include "korganizerConduit.h"
00039 #include "vcalconduitSettings.h"
00040 #include "vcal-setupbase.h"
00041
00042 VCalWidgetSetupBase::VCalWidgetSetupBase(QWidget *w, const char *n) :
00043 ConduitConfigBase(w,n),
00044 fConfigWidget(new VCalWidget(w))
00045 {
00046 FUNCTIONSETUP;
00047 fWidget=fConfigWidget;
00048
00049 fConfigWidget->fCalendarFile->setMode(KFile::File);
00050 fConfigWidget->fCalendarFile->setFilter(CSL1("*.vcs *.ics|ICalendars\n*.*|All Files (*.*)"));
00051
00052 #define CM(a,b) connect(fConfigWidget->a,b,this,SLOT(modified()));
00053 CM(fSyncDestination,SIGNAL(clicked(int)));
00054 CM(fCalendarFile,SIGNAL(textChanged(const QString &)));
00055 CM(fArchive,SIGNAL(toggled(bool)));
00056 CM(fConflictResolution,SIGNAL(activated(int)));
00057 #undef CM
00058 }
00059
00060 VCalWidgetSetupBase::~VCalWidgetSetupBase()
00061 {
00062 FUNCTIONSETUP;
00063 }
00064
00065 void VCalWidgetSetupBase::commit()
00066 {
00067 FUNCTIONSETUP;
00068 config()->readConfig();
00069
00070
00071 #ifdef DEBUG
00072 DEBUGKPILOT << fname << ": Selected type="
00073 << fConfigWidget->fSyncDestination->selected()
00074 << " with id="
00075 << fConfigWidget->fSyncDestination->id(fConfigWidget->fSyncDestination->selected())
00076 << endl;
00077 #endif
00078 config()->setCalendarType( fConfigWidget->fSyncDestination->id(
00079 fConfigWidget->fSyncDestination->selected()));
00080 config()->setCalendarFile( fConfigWidget->fCalendarFile->url());
00081
00082 config()->setSyncArchived( fConfigWidget->fArchive->isChecked() );
00083
00084
00085 config()->setConflictResolution(
00086 fConfigWidget->fConflictResolution->currentItem()+SyncAction::eCROffset);
00087
00088 config()->writeConfig();
00089 unmodified();
00090 }
00091
00092 void VCalWidgetSetupBase::load()
00093 {
00094 FUNCTIONSETUP;
00095 config()->readConfig();
00096
00097
00098 fConfigWidget->fSyncDestination->setButton( config()->calendarType());
00099 fConfigWidget->fCalendarFile->setURL( config()->calendarFile() );
00100
00101 fConfigWidget->fArchive->setChecked( config()->syncArchived() );
00102
00103
00104 fConfigWidget->fConflictResolution->setCurrentItem(
00105 config()->conflictResolution() - SyncAction::eCROffset);
00106
00107 config()->writeConfig();
00108 unmodified();
00109 }
00110
|