summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp113
1 files changed, 80 insertions, 33 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 03265d2..8a3f4cf 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -44,4 +44,6 @@
44#include <qlayout.h> 44#include <qlayout.h>
45#include <qscrollview.h> 45#include <qscrollview.h>
46#include <qvgroupbox.h>
47#include <qhgroupbox.h>
46 48
47#include <kcolorbutton.h> 49#include <kcolorbutton.h>
@@ -142,5 +144,7 @@ void KSyncPrefsDialog::setupSyncAlgTab()
142 ++iii; 144 ++iii;
143 145
144 QHBox *iims = new QHBox( topFrame ); 146
147
148 QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame);
145 new QLabel( i18n("Include in multiple "), iims ); 149 new QLabel( i18n("Include in multiple "), iims );
146 mIncludeInRing = new QCheckBox( i18n("calendar "), iims ); 150 mIncludeInRing = new QCheckBox( i18n("calendar "), iims );
@@ -150,11 +154,16 @@ void KSyncPrefsDialog::setupSyncAlgTab()
150 topLayout->addMultiCellWidget(iims, iii,iii,0,1); 154 topLayout->addMultiCellWidget(iims, iii,iii,0,1);
151 ++iii; 155 ++iii;
152 156 QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame);
153 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); 157 topLayout->addMultiCellWidget(gb0, iii,iii,0,1);
154 topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
155 ++iii;
156 QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
157 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
158 ++iii; 158 ++iii;
159 QButtonGroup* gr;
160 {
161 QVGroupBox* topFrame = gb0;
162 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
163 //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
164 //++iii;
165 gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
166 //topLayout->addMultiCellWidget(gr, iii,iii,0,1);
167 //++iii;
159 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); 168 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
160 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 169 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
@@ -166,23 +175,36 @@ void KSyncPrefsDialog::setupSyncAlgTab()
166 175
167 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 176 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
168 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 177 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
169 ++iii; 178 //++iii;
170 179
171 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 180 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
172 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 181 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
173 ++iii; 182 // ++iii;
174
175 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
176 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
177 ++iii;
178 183
179 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); 184 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame);
180 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 185 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1);
181 ++iii; 186 //++iii;
182 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); 187 {
183 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); 188 QVGroupBox*topFrame = gb2;
184 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 189 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame );
185 ++iii; 190 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
191 //++iii;
192 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
193 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
194 //++iii;
195 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame);
196 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
197 new QLabel( i18n("From ") , gb3 );
198 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3);
199 new QLabel( i18n(" weeks in the past to ") , gb3 );
200 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3);
201 new QLabel( i18n(" weeks in the future ") , gb3 );
202 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
203 //++iii;
204 gb3->setEnabled( false );
205 }
206 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
186 207
208 }
187 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 209 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
188 gr = proGr; 210 gr = proGr;
@@ -197,8 +219,16 @@ void KSyncPrefsDialog::setupSyncAlgTab()
197 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 219 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
198 220
221 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame);
222 topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
223 ++iii;
199 224
225 // ******************************************
226 // Profile kind specific settings
227 {
228 // *** phone *******************************
229 QVGroupBox* topFrame = gb1;
200 phoneWidget = new QVBox( topFrame); 230 phoneWidget = new QVBox( topFrame);
201 topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 231 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
202 ++iii; 232 //++iii;
203 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 233 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
204 QHBox* temphb = new QHBox( phoneWidget ); 234 QHBox* temphb = new QHBox( phoneWidget );
@@ -222,8 +252,8 @@ void KSyncPrefsDialog::setupSyncAlgTab()
222 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 252 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
223 253
224 // *** local 254 // *** local*******************************
225 localFileWidget = new QVBox( topFrame); 255 localFileWidget = new QVBox( topFrame);
226 topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 256 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
227 ++iii; 257 //++iii;
228 temphb = new QHBox( localFileWidget ); 258 temphb = new QHBox( localFileWidget );
229 259
@@ -246,8 +276,8 @@ void KSyncPrefsDialog::setupSyncAlgTab()
246 276
247 277
248 // *** remote 278 // *** remote*******************************
249 remoteFileWidget = new QVBox( topFrame); 279 remoteFileWidget = new QVBox( topFrame);
250 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 280 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
251 ++iii; 281 //++iii;
252 temphb = new QHBox( remoteFileWidget ); 282 temphb = new QHBox( remoteFileWidget );
253 new QLabel( i18n("Calendar:"), temphb); 283 new QLabel( i18n("Calendar:"), temphb);
@@ -281,8 +311,8 @@ void KSyncPrefsDialog::setupSyncAlgTab()
281 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 311 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
282 312
283 // *** pi-sync 313 // *** pi-sync*******************************
284 piWidget = new QVBox( topFrame); 314 piWidget = new QVBox( topFrame);
285 topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 315 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
286 ++iii; 316 //++iii;
287 temphb = new QHBox( piWidget ); 317 temphb = new QHBox( piWidget );
288 new QLabel( i18n("Calendar:"), temphb); 318 new QLabel( i18n("Calendar:"), temphb);
@@ -307,4 +337,7 @@ void KSyncPrefsDialog::setupSyncAlgTab()
307 mRemotePortAB = new QLineEdit(temphb); 337 mRemotePortAB = new QLineEdit(temphb);
308 mRemotePortPWM = new QLineEdit(temphb); 338 mRemotePortPWM = new QLineEdit(temphb);
339 }
340 // ******************************************
341 // Profile kind specific settings END
309 342
310} 343}
@@ -312,4 +345,16 @@ void KSyncPrefsDialog::setupSyncAlgTab()
312 345
313 346
347void KSyncPrefsDialog::readFilter()
348{
349 mFilterKapi.clear();
350 mFilterKopi.clear();
351 mFilterKopi.append(i18n("No Filter") );
352 mFilterKapi.append(i18n("No Filter") );
353 KConfig cfgko(locateLocal("config","korganizerrc"));
354 KConfig cfgka(locateLocal("config","kaddressbookrc"));
355 cfgko.setGroup("General");
356 mFilterKopi = cfgko.readListEntry("CalendarFilters");
357 mFilterKopi.prepend(i18n("No Filter") );
358}
314 359
315 360
@@ -431,4 +476,5 @@ void KSyncPrefsDialog::profileChanged( int item )
431 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 476 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
432 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 477 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
478 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
433 479
434 switch ( prof->getSyncPrefs() ) { 480 switch ( prof->getSyncPrefs() ) {
@@ -594,4 +640,5 @@ void KSyncPrefsDialog::saveProfile()
594 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 640 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
595 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 641 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
642 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value());
596 if ( mWriteContactToSIM ) 643 if ( mWriteContactToSIM )
597 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 644 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());