author | zautrix <zautrix> | 2005-12-02 08:13:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-12-02 08:13:06 (UTC) |
commit | 467b2e451511d201bfe9bef946728e5488d38e0a (patch) (unidiff) | |
tree | 6b43abf2003cfd80f69de9477ffa035df247db4b | |
parent | 042f35a481acf6c4e711e98184abb6c9f6542429 (diff) | |
download | kdepimpi-467b2e451511d201bfe9bef946728e5488d38e0a.zip kdepimpi-467b2e451511d201bfe9bef946728e5488d38e0a.tar.gz kdepimpi-467b2e451511d201bfe9bef946728e5488d38e0a.tar.bz2 |
more sync
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 55 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 1 |
2 files changed, 48 insertions, 8 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index b097277..6f46d19 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -218,19 +218,24 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
218 | mFilterOutAB = new QComboBox( fibo ); | 218 | mFilterOutAB = new QComboBox( fibo ); |
219 | //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 219 | //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
220 | //++iii; | 220 | //++iii; |
221 | mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); | 221 | mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); |
222 | //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); | 222 | //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); |
223 | //++iii; | 223 | //++iii; |
224 | QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); | 224 | QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame); |
225 | connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); | 225 | connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); |
226 | new QLabel( i18n("From ") , gb3 ); | 226 | |
227 | mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); | 227 | new QLabel( i18n("From ") , gb3 ); |
228 | new QLabel( i18n(" weeks in the past to ") , gb3 ); | 228 | QHBox * tf1 = new QHBox ( gb3 ); |
229 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); | 229 | mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 ); |
230 | new QLabel( i18n(" weeks in the future ") , gb3 ); | 230 | mWriteBackPastWeeks->setMaximumWidth( 100 ); |
231 | new QLabel( i18n(" weeks in the past to ") ,tf1 ); | ||
232 | QHBox * tf2 = new QHBox ( gb3 ); | ||
233 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2); | ||
234 | mWriteBackFutureWeeks->setMaximumWidth( 100 ); | ||
235 | new QLabel( i18n(" weeks in the future ") , tf2 ); | ||
231 | //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); | 236 | //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); |
232 | //++iii; | 237 | //++iii; |
233 | gb3->setEnabled( false ); | 238 | gb3->setEnabled( false ); |
234 | connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); | 239 | connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); |
235 | } | 240 | } |
236 | connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); | 241 | connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); |
@@ -375,22 +380,22 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
375 | mResTableKapi = new QTable( 1, 1, mTableBox ); | 380 | mResTableKapi = new QTable( 1, 1, mTableBox ); |
376 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); | 381 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); |
377 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 382 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
378 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 383 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
379 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 384 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
380 | mResTableKopi->setLeftMargin( 80 ); | 385 | mResTableKopi->setLeftMargin( 80 ); |
386 | mResTableKapi->setLeftMargin( 80 ); | ||
381 | } | 387 | } |
382 | // ****************************************** | 388 | // ****************************************** |
383 | // Profile kind specific settings END | 389 | // Profile kind specific settings END |
384 | 390 | ||
385 | } | 391 | } |
386 | 392 | ||
387 | void KSyncPrefsDialog::readResources() | 393 | void KSyncPrefsDialog::readResources() |
388 | { | 394 | { |
389 | mResourcesKopi.clear(); | 395 | mResourcesKopi.clear(); |
390 | mResourcesKapi.clear(); | ||
391 | KConfig fc(locateLocal("config","kopicalendarrc")); | 396 | KConfig fc(locateLocal("config","kopicalendarrc")); |
392 | fc.setGroup("CC"); | 397 | fc.setGroup("CC"); |
393 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 398 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
394 | int curCal = 1; | 399 | int curCal = 1; |
395 | while ( curCal <= numCals ) { | 400 | while ( curCal <= numCals ) { |
396 | QString prefix = "Cal_" +QString::number( curCal ); | 401 | QString prefix = "Cal_" +QString::number( curCal ); |
@@ -400,12 +405,35 @@ void KSyncPrefsDialog::readResources() | |||
400 | } | 405 | } |
401 | mResTableKopi->setNumRows( mResourcesKopi.count() ); | 406 | mResTableKopi->setNumRows( mResourcesKopi.count() ); |
402 | int i; | 407 | int i; |
403 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | 408 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { |
404 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); | 409 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); |
405 | } | 410 | } |
411 | |||
412 | mResourcesKapi.clear(); | ||
413 | |||
414 | KConfig conf ( locateLocal("config", "kabcrc") ); | ||
415 | |||
416 | conf.setGroup( "General" ); | ||
417 | |||
418 | QStringList keys = conf.readListEntry( "ResourceKeys" ); | ||
419 | //keys += conf->readListEntry( "PassiveResourceKeys" ); | ||
420 | |||
421 | //QString standardKey = mConfig->readEntry( "Standard" ); | ||
422 | |||
423 | for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) { | ||
424 | conf.setGroup("Resource_"+ (*it) ); | ||
425 | QString name = conf.readEntry( "ResourceName" ); | ||
426 | mResourcesKapi.append( name ); | ||
427 | } | ||
428 | mResTableKapi->setNumRows( mResourcesKapi.count() ); | ||
429 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | ||
430 | mResTableKapi->verticalHeader ()->setLabel( i, mResourcesKapi[i] ); | ||
431 | } | ||
432 | |||
433 | |||
406 | } | 434 | } |
407 | void KSyncPrefsDialog::readFilter() | 435 | void KSyncPrefsDialog::readFilter() |
408 | { | 436 | { |
409 | mFilterKapi.clear(); | 437 | mFilterKapi.clear(); |
410 | mFilterKopi.clear(); | 438 | mFilterKopi.clear(); |
411 | KConfig cfgko(locateLocal("config","korganizerrc")); | 439 | KConfig cfgko(locateLocal("config","korganizerrc")); |
@@ -478,13 +506,16 @@ void KSyncPrefsDialog::chooseFilePWM() | |||
478 | 506 | ||
479 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); | 507 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); |
480 | if ( fn == "" ) | 508 | if ( fn == "" ) |
481 | return; | 509 | return; |
482 | mRemoteFilePWM->setText( fn ); | 510 | mRemoteFilePWM->setText( fn ); |
483 | } | 511 | } |
484 | 512 | void KSyncPrefsDialog::updateMyCaption() | |
513 | { | ||
514 | setCaption( mProfileBox->currentText() + " : " +i18n("Synchronization Preferences")); | ||
515 | } | ||
485 | void KSyncPrefsDialog::textChanged( const QString & s ) | 516 | void KSyncPrefsDialog::textChanged( const QString & s ) |
486 | { | 517 | { |
487 | if ( mProfileBox->count() == 0 ) | 518 | if ( mProfileBox->count() == 0 ) |
488 | return; | 519 | return; |
489 | if ( currentSelection < 3 ) { | 520 | if ( currentSelection < 3 ) { |
490 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 521 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
@@ -495,12 +526,13 @@ void KSyncPrefsDialog::textChanged( const QString & s ) | |||
495 | } | 526 | } |
496 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 527 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
497 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 528 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
498 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 529 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
499 | prof->setName( s ); | 530 | prof->setName( s ); |
500 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 531 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
532 | updateMyCaption(); | ||
501 | } | 533 | } |
502 | void KSyncPrefsDialog::profileChanged( int item ) | 534 | void KSyncPrefsDialog::profileChanged( int item ) |
503 | { | 535 | { |
504 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); | 536 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); |
505 | KSyncProfile* prof; | 537 | KSyncProfile* prof; |
506 | saveProfile(); | 538 | saveProfile(); |
@@ -609,12 +641,13 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
609 | remoteFileWidget->hide(); | 641 | remoteFileWidget->hide(); |
610 | phoneWidget->hide(); | 642 | phoneWidget->hide(); |
611 | piWidget->hide(); | 643 | piWidget->hide(); |
612 | 644 | ||
613 | } else | 645 | } else |
614 | kindChanged( prof->getIsLocalFileSync() ); | 646 | kindChanged( prof->getIsLocalFileSync() ); |
647 | updateMyCaption(); | ||
615 | } | 648 | } |
616 | 649 | ||
617 | void KSyncPrefsDialog::fillSSH() | 650 | void KSyncPrefsDialog::fillSSH() |
618 | { | 651 | { |
619 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 652 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
620 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 653 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
@@ -749,20 +782,26 @@ void KSyncPrefsDialog::saveProfile() | |||
749 | prof->setPhoneConnection( mPhoneConnection->text() ); | 782 | prof->setPhoneConnection( mPhoneConnection->text() ); |
750 | prof->setPhoneModel( mPhoneModel->text() ); | 783 | prof->setPhoneModel( mPhoneModel->text() ); |
751 | prof->setFilterInCal ( mFilterInCal->currentText ()); | 784 | prof->setFilterInCal ( mFilterInCal->currentText ()); |
752 | prof->setFilterOutCal ( mFilterOutCal ->currentText ()); | 785 | prof->setFilterOutCal ( mFilterOutCal ->currentText ()); |
753 | prof->setFilterInAB ( mFilterInAB ->currentText ()); | 786 | prof->setFilterInAB ( mFilterInAB ->currentText ()); |
754 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); | 787 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); |
788 | mProfileBox->setFocus(); | ||
755 | if ( mIsPiSpecific->isChecked() ) { | 789 | if ( mIsPiSpecific->isChecked() ) { |
756 | 790 | ||
757 | QStringList res = mResourcesKopi; | 791 | QStringList res = mResourcesKopi; |
758 | int i; | 792 | int i; |
759 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | 793 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { |
760 | res.append( mResTableKopi->text( i, 0 )); | 794 | res.append( mResTableKopi->text( i, 0 )); |
761 | } | 795 | } |
762 | prof->setResSpecKopi( res.join(":")); | 796 | prof->setResSpecKopi( res.join(":")); |
797 | res = mResourcesKapi; | ||
798 | for ( i = 0;i < mResourcesKapi.count(); ++i ) { | ||
799 | res.append( mResTableKapi->text( i, 0 )); | ||
800 | } | ||
801 | prof->setResSpecKapi( res.join(":")); | ||
763 | } | 802 | } |
764 | } | 803 | } |
765 | } | 804 | } |
766 | 805 | ||
767 | void KSyncPrefsDialog::insertProfiles() | 806 | void KSyncPrefsDialog::insertProfiles() |
768 | { | 807 | { |
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index e8a9709..d8c02de 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h | |||
@@ -81,12 +81,13 @@ class KSyncPrefsDialog : public KDialog | |||
81 | protected: | 81 | protected: |
82 | void usrWriteConfig(); | 82 | void usrWriteConfig(); |
83 | void setupSyncAlgTab(); | 83 | void setupSyncAlgTab(); |
84 | void readFilter(); | 84 | void readFilter(); |
85 | void readResources(); | 85 | void readResources(); |
86 | private: | 86 | private: |
87 | void updateMyCaption(); | ||
87 | int currentSelection; | 88 | int currentSelection; |
88 | QPtrList<KSyncProfile> mSyncProfiles; | 89 | QPtrList<KSyncProfile> mSyncProfiles; |
89 | QStringList mSyncProfileNames; | 90 | QStringList mSyncProfileNames; |
90 | QStringList mFilterKapi; | 91 | QStringList mFilterKapi; |
91 | QStringList mFilterKopi; | 92 | QStringList mFilterKopi; |
92 | QStringList mResourcesKopi; | 93 | QStringList mResourcesKopi; |