summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-14 22:24:22 (UTC)
committer zautrix <zautrix>2005-01-14 22:24:22 (UTC)
commitd937154e5ae3691dda55fac9114142f92e29e37b (patch) (unidiff)
tree8c8960d6f4fb9a097a462240953a1f5a5603c5c5
parentee9df90c4898f4ed624be2d4e94918fcc80060e9 (diff)
downloadkdepimpi-d937154e5ae3691dda55fac9114142f92e29e37b.zip
kdepimpi-d937154e5ae3691dda55fac9114142f92e29e37b.tar.gz
kdepimpi-d937154e5ae3691dda55fac9114142f92e29e37b.tar.bz2
filtersettings complete
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 6e42fd4..2101bbb 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -172,412 +172,412 @@ void KSyncPrefsDialog::setupSyncAlgTab()
172 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 172 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
173 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); 173 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
174 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); 174 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
175 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); 175 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
176 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); 176 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
177 // both = new QRadioButton ( i18n("Take both on conflict"), gr ); 177 // both = new QRadioButton ( i18n("Take both on conflict"), gr );
178 178
179 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 179 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
180 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 180 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
181 //++iii; 181 //++iii;
182 182
183 QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame); 183 QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame);
184 QVBox * fibo2 = new QVBox ( gb5 ); 184 QVBox * fibo2 = new QVBox ( gb5 );
185 new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); 185 new QLabel ( i18n("Incoming calendar filter:"), fibo2 );
186 mFilterInCal = new QComboBox( fibo2 ); 186 mFilterInCal = new QComboBox( fibo2 );
187 fibo2 = new QVBox ( gb5 ); 187 fibo2 = new QVBox ( gb5 );
188 new QLabel ( i18n("Incoming adressbook filter:"), fibo2 ); 188 new QLabel ( i18n("Incoming adressbook filter:"), fibo2 );
189 mFilterInAB = new QComboBox( fibo2 ); 189 mFilterInAB = new QComboBox( fibo2 );
190 190
191 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 191 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
192 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 192 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
193 // ++iii; 193 // ++iii;
194 194
195 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); 195 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame);
196 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); 196 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1);
197 //++iii; 197 //++iii;
198 { 198 {
199 QVGroupBox*topFrame = gb2; 199 QVGroupBox*topFrame = gb2;
200 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); 200 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame );
201 QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); 201 QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame);
202 QVBox * fibo = new QVBox ( gb4 ); 202 QVBox * fibo = new QVBox ( gb4 );
203 new QLabel ( i18n("Outgoing calendar filter:"), fibo ); 203 new QLabel ( i18n("Outgoing calendar filter:"), fibo );
204 mFilterOutCal = new QComboBox( fibo ); 204 mFilterOutCal = new QComboBox( fibo );
205 fibo = new QVBox ( gb4 ); 205 fibo = new QVBox ( gb4 );
206 new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); 206 new QLabel ( i18n("Outgoing addressbook filter:"), fibo );
207 mFilterOutAB = new QComboBox( fibo ); 207 mFilterOutAB = new QComboBox( fibo );
208 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 208 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
209 //++iii; 209 //++iii;
210 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); 210 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
211 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 211 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
212 //++iii; 212 //++iii;
213 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); 213 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame);
214 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); 214 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
215 new QLabel( i18n("From ") , gb3 ); 215 new QLabel( i18n("From ") , gb3 );
216 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); 216 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3);
217 new QLabel( i18n(" weeks in the past to ") , gb3 ); 217 new QLabel( i18n(" weeks in the past to ") , gb3 );
218 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); 218 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3);
219 new QLabel( i18n(" weeks in the future ") , gb3 ); 219 new QLabel( i18n(" weeks in the future ") , gb3 );
220 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 220 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
221 //++iii; 221 //++iii;
222 gb3->setEnabled( false ); 222 gb3->setEnabled( false );
223 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); 223 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) );
224 } 224 }
225 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); 225 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
226 226
227 } 227 }
228 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 228 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
229 gr = proGr; 229 gr = proGr;
230 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 230 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
231 ++iii; 231 ++iii;
232 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 232 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
233 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); 233 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr );
234 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 234 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
235 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 235 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
236 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 236 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
237 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 237 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
238 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 238 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
239 239
240 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); 240 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame);
241 topLayout->addMultiCellWidget(gb1, iii,iii,0,1); 241 topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
242 ++iii; 242 ++iii;
243 243
244 // ****************************************** 244 // ******************************************
245 // Profile kind specific settings 245 // Profile kind specific settings
246 { 246 {
247 // *** phone ******************************* 247 // *** phone *******************************
248 QVGroupBox* topFrame = gb1; 248 QVGroupBox* topFrame = gb1;
249 phoneWidget = new QVBox( topFrame); 249 phoneWidget = new QVBox( topFrame);
250 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 250 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
251 //++iii; 251 //++iii;
252 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 252 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
253 QHBox* temphb = new QHBox( phoneWidget ); 253 QHBox* temphb = new QHBox( phoneWidget );
254 new QLabel( i18n("I/O device: "), temphb ); 254 new QLabel( i18n("I/O device: "), temphb );
255 mPhoneDevice = new QLineEdit( temphb); 255 mPhoneDevice = new QLineEdit( temphb);
256 button = new QPushButton( i18n("Help..."), temphb ); 256 button = new QPushButton( i18n("Help..."), temphb );
257 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); 257 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) );
258 258
259 259
260 temphb = new QHBox( phoneWidget ); 260 temphb = new QHBox( phoneWidget );
261 new QLabel( i18n("Connection: "), temphb ); 261 new QLabel( i18n("Connection: "), temphb );
262 mPhoneConnection = new QLineEdit( temphb); 262 mPhoneConnection = new QLineEdit( temphb);
263 button = new QPushButton( i18n("Help..."), temphb ); 263 button = new QPushButton( i18n("Help..."), temphb );
264 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); 264 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
265 265
266 266
267 temphb = new QHBox( phoneWidget ); 267 temphb = new QHBox( phoneWidget );
268 new QLabel( i18n("Model(opt.): "), temphb ); 268 new QLabel( i18n("Model(opt.): "), temphb );
269 mPhoneModel = new QLineEdit( temphb); 269 mPhoneModel = new QLineEdit( temphb);
270 button = new QPushButton( i18n("Help..."), temphb ); 270 button = new QPushButton( i18n("Help..."), temphb );
271 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 271 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
272 272
273 // *** local******************************* 273 // *** local*******************************
274 localFileWidget = new QVBox( topFrame); 274 localFileWidget = new QVBox( topFrame);
275 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 275 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
276 //++iii; 276 //++iii;
277 temphb = new QHBox( localFileWidget ); 277 temphb = new QHBox( localFileWidget );
278 278
279 lab = new QLabel( i18n("Local file Cal:"), temphb ); 279 lab = new QLabel( i18n("Local file Cal:"), temphb );
280 lab = new QLabel( i18n("Local file ABook:"), temphb ); 280 lab = new QLabel( i18n("Local file ABook:"), temphb );
281 lab = new QLabel( i18n("Local file PWMgr:"), temphb ); 281 lab = new QLabel( i18n("Local file PWMgr:"), temphb );
282 temphb = new QHBox( localFileWidget ); 282 temphb = new QHBox( localFileWidget );
283 button = new QPushButton( i18n("Choose..."), temphb ); 283 button = new QPushButton( i18n("Choose..."), temphb );
284 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 284 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
285 button = new QPushButton( i18n("Choose..."), temphb ); 285 button = new QPushButton( i18n("Choose..."), temphb );
286 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 286 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
287 button = new QPushButton( i18n("Choose..."), temphb ); 287 button = new QPushButton( i18n("Choose..."), temphb );
288 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 288 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
289 temphb = new QHBox( localFileWidget ); 289 temphb = new QHBox( localFileWidget );
290 290
291 mRemoteFile = new QLineEdit( temphb); 291 mRemoteFile = new QLineEdit( temphb);
292 mRemoteFileAB = new QLineEdit( temphb); 292 mRemoteFileAB = new QLineEdit( temphb);
293 mRemoteFilePWM = new QLineEdit( temphb); 293 mRemoteFilePWM = new QLineEdit( temphb);
294 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); 294 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
295 295
296 296
297 // *** remote******************************* 297 // *** remote*******************************
298 remoteFileWidget = new QVBox( topFrame); 298 remoteFileWidget = new QVBox( topFrame);
299 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 299 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
300 //++iii; 300 //++iii;
301 temphb = new QHBox( remoteFileWidget ); 301 temphb = new QHBox( remoteFileWidget );
302 new QLabel( i18n("Calendar:"), temphb); 302 new QLabel( i18n("Calendar:"), temphb);
303 new QLabel( i18n("AddressBook:"), temphb); 303 new QLabel( i18n("AddressBook:"), temphb);
304 new QLabel( i18n("PWManager:"), temphb); 304 new QLabel( i18n("PWManager:"), temphb);
305 305
306 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 306 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
307 temphb = new QHBox( remoteFileWidget ); 307 temphb = new QHBox( remoteFileWidget );
308 mRemotePrecommand = new QLineEdit(temphb); 308 mRemotePrecommand = new QLineEdit(temphb);
309 mRemotePrecommandAB = new QLineEdit(temphb); 309 mRemotePrecommandAB = new QLineEdit(temphb);
310 mRemotePrecommandPWM = new QLineEdit(temphb); 310 mRemotePrecommandPWM = new QLineEdit(temphb);
311 311
312 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 312 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
313 temphb = new QHBox( remoteFileWidget ); 313 temphb = new QHBox( remoteFileWidget );
314 mLocalTempFile = new QLineEdit(temphb); 314 mLocalTempFile = new QLineEdit(temphb);
315 mLocalTempFileAB = new QLineEdit(temphb); 315 mLocalTempFileAB = new QLineEdit(temphb);
316 mLocalTempFilePWM = new QLineEdit(temphb); 316 mLocalTempFilePWM = new QLineEdit(temphb);
317 317
318 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 318 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
319 temphb = new QHBox( remoteFileWidget ); 319 temphb = new QHBox( remoteFileWidget );
320 mRemotePostcommand = new QLineEdit(temphb ); 320 mRemotePostcommand = new QLineEdit(temphb );
321 mRemotePostcommandAB = new QLineEdit(temphb ); 321 mRemotePostcommandAB = new QLineEdit(temphb );
322 mRemotePostcommandPWM = new QLineEdit(temphb ); 322 mRemotePostcommandPWM = new QLineEdit(temphb );
323 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); 323 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
324 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 324 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
325 temphb = new QHBox( remoteFileWidget ); 325 temphb = new QHBox( remoteFileWidget );
326 button = new QPushButton( i18n("ssh/scp"), temphb ); 326 button = new QPushButton( i18n("ssh/scp"), temphb );
327 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 327 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
328 button = new QPushButton( i18n("ftp"), temphb ); 328 button = new QPushButton( i18n("ftp"), temphb );
329 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 329 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
330 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 330 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
331 331
332 // *** pi-sync******************************* 332 // *** pi-sync*******************************
333 piWidget = new QVBox( topFrame); 333 piWidget = new QVBox( topFrame);
334 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 334 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
335 //++iii; 335 //++iii;
336 temphb = new QHBox( piWidget ); 336 temphb = new QHBox( piWidget );
337 new QLabel( i18n("Calendar:"), temphb); 337 new QLabel( i18n("Calendar:"), temphb);
338 new QLabel( i18n("AddressBook:"), temphb); 338 new QLabel( i18n("AddressBook:"), temphb);
339 new QLabel( i18n("PWManager:"), temphb); 339 new QLabel( i18n("PWManager:"), temphb);
340 340
341 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); 341 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget);
342 temphb = new QHBox( piWidget ); 342 temphb = new QHBox( piWidget );
343 mRemotePw = new QLineEdit(temphb); 343 mRemotePw = new QLineEdit(temphb);
344 mRemotePwAB = new QLineEdit(temphb); 344 mRemotePwAB = new QLineEdit(temphb);
345 mRemotePwPWM = new QLineEdit(temphb); 345 mRemotePwPWM = new QLineEdit(temphb);
346 346
347 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); 347 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
348 temphb = new QHBox( piWidget ); 348 temphb = new QHBox( piWidget );
349 mRemoteIP = new QLineEdit(temphb); 349 mRemoteIP = new QLineEdit(temphb);
350 mRemoteIPAB = new QLineEdit(temphb); 350 mRemoteIPAB = new QLineEdit(temphb);
351 mRemoteIPPWM = new QLineEdit(temphb); 351 mRemoteIPPWM = new QLineEdit(temphb);
352 352
353 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); 353 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
354 temphb = new QHBox( piWidget ); 354 temphb = new QHBox( piWidget );
355 mRemotePort = new QLineEdit(temphb); 355 mRemotePort = new QLineEdit(temphb);
356 mRemotePortAB = new QLineEdit(temphb); 356 mRemotePortAB = new QLineEdit(temphb);
357 mRemotePortPWM = new QLineEdit(temphb); 357 mRemotePortPWM = new QLineEdit(temphb);
358 } 358 }
359 // ****************************************** 359 // ******************************************
360 // Profile kind specific settings END 360 // Profile kind specific settings END
361 361
362} 362}
363 363
364
365
366void KSyncPrefsDialog::readFilter() 364void KSyncPrefsDialog::readFilter()
367{ 365{
368 mFilterKapi.clear(); 366 mFilterKapi.clear();
369 mFilterKopi.clear(); 367 mFilterKopi.clear();
370 mFilterKopi.append(i18n("No Filter") );
371 mFilterKapi.append(i18n("No Filter") );
372 KConfig cfgko(locateLocal("config","korganizerrc")); 368 KConfig cfgko(locateLocal("config","korganizerrc"));
373 KConfig cfgka(locateLocal("config","kaddressbookrc")); 369 KConfig cfgka(locateLocal("config","kaddressbookrc"));
374 cfgko.setGroup("General"); 370 cfgko.setGroup("General");
375 mFilterKopi = cfgko.readListEntry("CalendarFilters"); 371 mFilterKopi = cfgko.readListEntry("CalendarFilters");
376 mFilterKapi = mFilterKopi; 372 cfgka.setGroup("Filter");
373 int count = cfgka.readNumEntry( "Count", 0 );
374 for ( int i = 0; i < count; i++ ) {
375 cfgka.setGroup("Filter_"+QString::number( i ) );
376 mFilterKapi.append( cfgka.readEntry("Name", "internal error") );
377 }
377 mFilterOutCal->clear(); 378 mFilterOutCal->clear();
378 mFilterInCal->clear(); 379 mFilterInCal->clear();
379 mFilterOutAB->clear(); 380 mFilterOutAB->clear();
380 mFilterInAB->clear(); 381 mFilterInAB->clear();
381 QStringList temp = mFilterKopi; 382 QStringList temp = mFilterKopi;
382 temp.prepend(i18n("No Filter") ); 383 temp.prepend(i18n("No Filter") );
383 mFilterOutCal->insertStringList( temp ); 384 mFilterOutCal->insertStringList( temp );
384 mFilterInCal->insertStringList( temp ); 385 mFilterInCal->insertStringList( temp );
385 temp = mFilterKapi; 386 temp = mFilterKapi;
386 temp.prepend(i18n("No Filter") ); 387 temp.prepend(i18n("No Filter") );
387 mFilterOutAB->insertStringList( temp ); 388 mFilterOutAB->insertStringList( temp );
388 mFilterInAB->insertStringList( temp ); 389 mFilterInAB->insertStringList( temp );
389} 390}
390 391
391
392void KSyncPrefsDialog::slotOK() 392void KSyncPrefsDialog::slotOK()
393{ 393{
394 if ( mMyMachineName->text() == "undefined" ) { 394 if ( mMyMachineName->text() == "undefined" ) {
395 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); 395 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
396 return; 396 return;
397 } 397 }
398 int i; 398 int i;
399 for (i = 0; i < mSyncProfileNames.count(); ++ i) { 399 for (i = 0; i < mSyncProfileNames.count(); ++ i) {
400 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { 400 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) {
401 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); 401 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error"));
402 return; 402 return;
403 } 403 }
404 } 404 }
405 usrWriteConfig(); 405 usrWriteConfig();
406 QDialog::accept(); 406 QDialog::accept();
407} 407}
408void KSyncPrefsDialog::accept() 408void KSyncPrefsDialog::accept()
409{ 409{
410 slotOK(); 410 slotOK();
411} 411}
412void KSyncPrefsDialog::chooseFile() 412void KSyncPrefsDialog::chooseFile()
413{ 413{
414 QString fn = QDir::homeDirPath(); 414 QString fn = QDir::homeDirPath();
415 415
416 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); 416 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
417 if ( fn == "" ) 417 if ( fn == "" )
418 return; 418 return;
419 mRemoteFile->setText( fn ); 419 mRemoteFile->setText( fn );
420} 420}
421 421
422void KSyncPrefsDialog::chooseFileAB() 422void KSyncPrefsDialog::chooseFileAB()
423{ 423{
424 QString fn = QDir::homeDirPath(); 424 QString fn = QDir::homeDirPath();
425 425
426 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); 426 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this );
427 if ( fn == "" ) 427 if ( fn == "" )
428 return; 428 return;
429 mRemoteFileAB->setText( fn ); 429 mRemoteFileAB->setText( fn );
430} 430}
431 431
432void KSyncPrefsDialog::chooseFilePWM() 432void KSyncPrefsDialog::chooseFilePWM()
433{ 433{
434 QString fn = QDir::homeDirPath(); 434 QString fn = QDir::homeDirPath();
435 435
436 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); 436 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this );
437 if ( fn == "" ) 437 if ( fn == "" )
438 return; 438 return;
439 mRemoteFilePWM->setText( fn ); 439 mRemoteFilePWM->setText( fn );
440} 440}
441 441
442void KSyncPrefsDialog::textChanged( const QString & s ) 442void KSyncPrefsDialog::textChanged( const QString & s )
443{ 443{
444 if ( mProfileBox->count() == 0 ) 444 if ( mProfileBox->count() == 0 )
445 return; 445 return;
446 if ( currentSelection < 3 ) { 446 if ( currentSelection < 3 ) {
447 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); 447 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error"));
448 mProfileBox->blockSignals( true ); 448 mProfileBox->blockSignals( true );
449 mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); 449 mProfileBox->setCurrentItem(mProfileBox-> currentItem ());
450 mProfileBox->blockSignals( false ); 450 mProfileBox->blockSignals( false );
451 return; 451 return;
452 } 452 }
453 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 453 //qDebug("cur i %d ",mProfileBox-> currentItem () );
454 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 454 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
455 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 455 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
456 prof->setName( s ); 456 prof->setName( s );
457 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 457 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
458} 458}
459void KSyncPrefsDialog::profileChanged( int item ) 459void KSyncPrefsDialog::profileChanged( int item )
460{ 460{
461 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 461 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
462 KSyncProfile* prof; 462 KSyncProfile* prof;
463 saveProfile(); 463 saveProfile();
464 readFilter(); 464 readFilter();
465 currentSelection = item; 465 currentSelection = item;
466 prof = mSyncProfiles.at(item) ; 466 prof = mSyncProfiles.at(item) ;
467 467
468 mRemotePw->setText(prof->getRemotePw()); 468 mRemotePw->setText(prof->getRemotePw());
469 mRemoteIP->setText(prof->getRemoteIP()); 469 mRemoteIP->setText(prof->getRemoteIP());
470 mRemotePort->setText(prof->getRemotePort()); 470 mRemotePort->setText(prof->getRemotePort());
471 471
472 mRemotePwAB->setText(prof->getRemotePwAB()); 472 mRemotePwAB->setText(prof->getRemotePwAB());
473 mRemoteIPAB->setText(prof->getRemoteIPAB()); 473 mRemoteIPAB->setText(prof->getRemoteIPAB());
474 mRemotePortAB->setText(prof->getRemotePortAB()); 474 mRemotePortAB->setText(prof->getRemotePortAB());
475 475
476 mRemotePwPWM->setText(prof->getRemotePwPWM()); 476 mRemotePwPWM->setText(prof->getRemotePwPWM());
477 mRemoteIPPWM->setText(prof->getRemoteIPPWM()); 477 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
478 mRemotePortPWM->setText(prof->getRemotePortPWM()); 478 mRemotePortPWM->setText(prof->getRemotePortPWM());
479 479
480 mRemotePrecommand->setText(prof->getPreSyncCommand()); 480 mRemotePrecommand->setText(prof->getPreSyncCommand());
481 mRemotePostcommand->setText(prof->getPostSyncCommand()); 481 mRemotePostcommand->setText(prof->getPostSyncCommand());
482 mLocalTempFile->setText(prof->getLocalTempFile()); 482 mLocalTempFile->setText(prof->getLocalTempFile());
483 mRemoteFile->setText(prof->getRemoteFileName()) ; 483 mRemoteFile->setText(prof->getRemoteFileName()) ;
484 484
485 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 485 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
486 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 486 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
487 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 487 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
488 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 488 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
489 489
490 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 490 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
491 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 491 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
492 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 492 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
493 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 493 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
494 494
495 if ( mWriteContactToSIM ) 495 if ( mWriteContactToSIM )
496 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 496 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
497 mPhoneDevice->setText(prof->getPhoneDevice()); 497 mPhoneDevice->setText(prof->getPhoneDevice());
498 mPhoneConnection->setText(prof->getPhoneConnection()); 498 mPhoneConnection->setText(prof->getPhoneConnection());
499 mPhoneModel->setText(prof->getPhoneModel()); 499 mPhoneModel->setText(prof->getPhoneModel());
500 500
501 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 501 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
502 mAskForPreferences->setChecked( prof->getAskForPreferences()); 502 mAskForPreferences->setChecked( prof->getAskForPreferences());
503 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 503 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
504 mWriteBackFile->setChecked( prof->getWriteBackFile()); 504 mWriteBackFile->setChecked( prof->getWriteBackFile());
505 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 505 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
506 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 506 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
507 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 507 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
508 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 508 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
509 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 509 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
510 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); 510 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
511 511
512 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); 512 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 );
513 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); 513 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 );
514 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); 514 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 );
515 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); 515 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 );
516 516
517 switch ( prof->getSyncPrefs() ) { 517 switch ( prof->getSyncPrefs() ) {
518 case 0: 518 case 0:
519 loc->setChecked( true); 519 loc->setChecked( true);
520 break; 520 break;
521 case 1: 521 case 1:
522 rem->setChecked( true ); 522 rem->setChecked( true );
523 break; 523 break;
524 case 2: 524 case 2:
525 newest->setChecked( true); 525 newest->setChecked( true);
526 break; 526 break;
527 case 3: 527 case 3:
528 ask->setChecked( true); 528 ask->setChecked( true);
529 break; 529 break;
530 case 4: 530 case 4:
531 f_loc->setChecked( true); 531 f_loc->setChecked( true);
532 break; 532 break;
533 case 5: 533 case 5:
534 f_rem->setChecked( true); 534 f_rem->setChecked( true);
535 break; 535 break;
536 case 6: 536 case 6:
537 //both->setChecked( true); 537 //both->setChecked( true);
538 break; 538 break;
539 default: 539 default:
540 break; 540 break;
541 } 541 }
542 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 542 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
543 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 543 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
544 mIsPi->setChecked(prof->getIsPiSync()) ; 544 mIsPi->setChecked(prof->getIsPiSync()) ;
545 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; 545 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
546 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; 546 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
547 547
548 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); 548 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() );
549 proGr->setEnabled( item > 2 ); 549 proGr->setEnabled( item > 2 );
550 if ( item < 3 ) { 550 if ( item < 3 ) {
551 localFileWidget->hide(); 551 localFileWidget->hide();
552 remoteFileWidget->hide(); 552 remoteFileWidget->hide();
553 phoneWidget->hide(); 553 phoneWidget->hide();
554 piWidget->hide(); 554 piWidget->hide();
555 555
556 } else 556 } else
557 kindChanged( prof->getIsLocalFileSync() ); 557 kindChanged( prof->getIsLocalFileSync() );
558} 558}
559 559
560void KSyncPrefsDialog::fillSSH() 560void KSyncPrefsDialog::fillSSH()
561{ 561{
562 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 562 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
563 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 563 mLocalTempFile->setText("/tmp/mycalendar.ics" );
564 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 564 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
565 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 565 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
566 mLocalTempFileAB->setText("/tmp/std.vcf" ); 566 mLocalTempFileAB->setText("/tmp/std.vcf" );
567 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); 567 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
568 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 568 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
569 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 569 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
570 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); 570 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
571} 571}
572void KSyncPrefsDialog::fillFTP() 572void KSyncPrefsDialog::fillFTP()
573{ 573{
574 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); 574 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
575 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 575 mLocalTempFile->setText("/tmp/mycalendar.ics" );
576 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 576 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
577 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 577 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
578 mLocalTempFileAB->setText("/tmp/std.vcf" ); 578 mLocalTempFileAB->setText("/tmp/std.vcf" );
579 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 579 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
580 580
581 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 581 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
582 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 582 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
583 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 583 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );