-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 72 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 10 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 7 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 11 |
4 files changed, 95 insertions, 5 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 8873ed1..292cde1 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -242,6 +242,8 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
242 | ++iii; | 242 | ++iii; |
243 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 243 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
244 | mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); | 244 | mIsPi = new QRadioButton ( i18n("Pi-Sync - all resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); |
245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
246 | mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); | ||
247 | connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | ||
246 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 248 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
247 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 249 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
@@ -367,4 +369,14 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
367 | mRemotePortAB = new QLineEdit(temphb); | 369 | mRemotePortAB = new QLineEdit(temphb); |
368 | mRemotePortPWM = new QLineEdit(temphb); | 370 | mRemotePortPWM = new QLineEdit(temphb); |
371 | |||
372 | lab = new QLabel( i18n("Local/remote Resource sync partners"), piWidget); | ||
373 | mTableBox = new QHBox( piWidget ); | ||
374 | mResTableKopi = new QTable( 1, 1, mTableBox ); | ||
375 | mResTableKapi = new QTable( 1, 1, mTableBox ); | ||
376 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); | ||
377 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
378 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
379 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
380 | mResTableKopi->setLeftMargin( 80 ); | ||
369 | } | 381 | } |
370 | // ****************************************** | 382 | // ****************************************** |
@@ -373,4 +385,24 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
373 | } | 385 | } |
374 | 386 | ||
387 | void KSyncPrefsDialog::readResources() | ||
388 | { | ||
389 | mResourcesKopi.clear(); | ||
390 | mResourcesKapi.clear(); | ||
391 | KConfig fc(locateLocal("config","kopicalendarrc")); | ||
392 | fc.setGroup("CC"); | ||
393 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | ||
394 | int curCal = 1; | ||
395 | while ( curCal <= numCals ) { | ||
396 | QString prefix = "Cal_" +QString::number( curCal ); | ||
397 | QString name = fc.readEntry( prefix+"_Name", "Calendar"); | ||
398 | mResourcesKopi.append( name ); | ||
399 | ++curCal; | ||
400 | } | ||
401 | mResTableKopi->setNumRows( mResourcesKopi.count() ); | ||
402 | int i; | ||
403 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | ||
404 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); | ||
405 | } | ||
406 | } | ||
375 | void KSyncPrefsDialog::readFilter() | 407 | void KSyncPrefsDialog::readFilter() |
376 | { | 408 | { |
@@ -474,4 +506,5 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
474 | saveProfile(); | 506 | saveProfile(); |
475 | readFilter(); | 507 | readFilter(); |
508 | readResources(); | ||
476 | currentSelection = item; | 509 | currentSelection = item; |
477 | prof = mSyncProfiles.at(item) ; | 510 | prof = mSyncProfiles.at(item) ; |
@@ -554,8 +587,19 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
554 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; | 587 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; |
555 | mIsPi->setChecked(prof->getIsPiSync()) ; | 588 | mIsPi->setChecked(prof->getIsPiSync()) ; |
589 | mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ; | ||
556 | mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; | 590 | mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; |
557 | mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; | 591 | mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; |
558 | 592 | ||
559 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); | 593 | |
594 | QStringList res = QStringList::split( ":",prof->getResSpecKopi()); | ||
595 | int i; | ||
596 | for ( i = 0;i < res.count(); ++i ) { | ||
597 | mResTableKopi->setText( i, 0, res[i] ); | ||
598 | } | ||
599 | res = QStringList::split( ":",prof->getResSpecKapi()); | ||
600 | for ( i = 0;i < res.count(); ++i ) { | ||
601 | mResTableKapi->setText( i, 0, res[i] ); | ||
602 | } | ||
603 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec()); | ||
560 | proGr->setEnabled( item > 2 ); | 604 | proGr->setEnabled( item > 2 ); |
561 | if ( item < 3 ) { | 605 | if ( item < 3 ) { |
@@ -619,11 +663,19 @@ void KSyncPrefsDialog::kindChanged( bool b ) | |||
619 | else { | 663 | else { |
620 | phoneWidget->hide(); | 664 | phoneWidget->hide(); |
621 | } | 665 | } |
622 | if ( mIsPi->isChecked () ) { | 666 | |
667 | if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) { | ||
623 | piWidget->show(); | 668 | piWidget->show(); |
669 | if (mIsPiSpecific->isChecked () ) { | ||
670 | mTableBox->show(); | ||
671 | } | ||
672 | else { | ||
673 | mTableBox->hide(); | ||
674 | } | ||
624 | } | 675 | } |
625 | else { | 676 | else { |
626 | piWidget->hide(); | 677 | piWidget->hide(); |
627 | } | 678 | } |
679 | |||
628 | 680 | ||
629 | } | 681 | } |
@@ -685,4 +737,5 @@ void KSyncPrefsDialog::saveProfile() | |||
685 | prof->setIsPhoneSync( mIsPhone->isChecked() ); | 737 | prof->setIsPhoneSync( mIsPhone->isChecked() ); |
686 | prof->setIsPiSync( mIsPi->isChecked() ); | 738 | prof->setIsPiSync( mIsPi->isChecked() ); |
739 | prof->setIsPiSyncSpec( mIsPiSpecific->isChecked() ); | ||
687 | prof->setIsKapiFile( mIsKapiFileL->isChecked() ); | 740 | prof->setIsKapiFile( mIsKapiFileL->isChecked() ); |
688 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); | 741 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); |
@@ -698,4 +751,13 @@ void KSyncPrefsDialog::saveProfile() | |||
698 | prof->setFilterInAB ( mFilterInAB ->currentText ()); | 751 | prof->setFilterInAB ( mFilterInAB ->currentText ()); |
699 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); | 752 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); |
753 | if ( mIsPiSpecific->isChecked() ) { | ||
754 | |||
755 | QStringList res; | ||
756 | int i; | ||
757 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | ||
758 | res.append( mResTableKopi->text( i, 0 )); | ||
759 | } | ||
760 | prof->setResSpecKopi( res.join(":")); | ||
761 | } | ||
700 | } | 762 | } |
701 | } | 763 | } |
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index 24543e1..e8a9709 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h | |||
@@ -27,4 +27,6 @@ | |||
27 | #include <kdialogbase.h> | 27 | #include <kdialogbase.h> |
28 | #include <qptrlist.h> | 28 | #include <qptrlist.h> |
29 | #include <qtable.h> | ||
30 | #include <qhbox.h> | ||
29 | 31 | ||
30 | //#include <libkdepim/kprefsdialog.h> | 32 | //#include <libkdepim/kprefsdialog.h> |
@@ -81,4 +83,5 @@ class KSyncPrefsDialog : public KDialog | |||
81 | void setupSyncAlgTab(); | 83 | void setupSyncAlgTab(); |
82 | void readFilter(); | 84 | void readFilter(); |
85 | void readResources(); | ||
83 | private: | 86 | private: |
84 | int currentSelection; | 87 | int currentSelection; |
@@ -87,4 +90,6 @@ class KSyncPrefsDialog : public KDialog | |||
87 | QStringList mFilterKapi; | 90 | QStringList mFilterKapi; |
88 | QStringList mFilterKopi; | 91 | QStringList mFilterKopi; |
92 | QStringList mResourcesKopi; | ||
93 | QStringList mResourcesKapi; | ||
89 | QLineEdit * mMyMachineName; | 94 | QLineEdit * mMyMachineName; |
90 | QComboBox * mProfileBox; | 95 | QComboBox * mProfileBox; |
@@ -93,4 +98,5 @@ class KSyncPrefsDialog : public KDialog | |||
93 | QRadioButton* mIsPhone; | 98 | QRadioButton* mIsPhone; |
94 | QRadioButton* mIsPi; | 99 | QRadioButton* mIsPi; |
100 | QRadioButton* mIsPiSpecific; | ||
95 | QCheckBox* mIncludeInRing; | 101 | QCheckBox* mIncludeInRing; |
96 | QCheckBox* mIncludeInRingAB; | 102 | QCheckBox* mIncludeInRingAB; |
@@ -100,4 +106,8 @@ class KSyncPrefsDialog : public KDialog | |||
100 | void saveProfile(); | 106 | void saveProfile(); |
101 | QButtonGroup* proGr; | 107 | QButtonGroup* proGr; |
108 | QHBox * mTableBox; | ||
109 | QTable* mResTableKopi; | ||
110 | QTable* mResTableKapi; | ||
111 | QTable* mResTablePwmpi; | ||
102 | 112 | ||
103 | QComboBox * mFilterOutCal; | 113 | QComboBox * mFilterOutCal; |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 0d72fc9..d6620c8 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -133,4 +133,5 @@ void KSyncProfile::setDefault() | |||
133 | mIsPhoneSync = false; | 133 | mIsPhoneSync = false; |
134 | mIsPiSync = false; | 134 | mIsPiSync = false; |
135 | mIsPiSyncSpec = false; | ||
135 | mIsKapiFile = false; | 136 | mIsKapiFile = false; |
136 | mWriteContactToSIM = false; | 137 | mWriteContactToSIM = false; |
@@ -196,4 +197,5 @@ void KSyncProfile::readConfig(KConfig *config ) | |||
196 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); | 197 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); |
197 | mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); | 198 | mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); |
199 | mIsPiSyncSpec= config->readBoolEntry( "IsPiSyncSpec", mIsPiSyncSpec ); | ||
198 | mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); | 200 | mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); |
199 | 201 | ||
@@ -202,4 +204,6 @@ void KSyncProfile::readConfig(KConfig *config ) | |||
202 | mFilterInAB = config->readEntry( "FilterInAB", mFilterInAB ); | 204 | mFilterInAB = config->readEntry( "FilterInAB", mFilterInAB ); |
203 | mFilterOutAB = config->readEntry( "FilterOutAB", mFilterOutAB ); | 205 | mFilterOutAB = config->readEntry( "FilterOutAB", mFilterOutAB ); |
206 | mResSpecKopi = config->readEntry( "ResSpecKopi", mResSpecKopi ); | ||
207 | mResSpecKapi = config->readEntry( "ResSpecKapi", mResSpecKapi ); | ||
204 | 208 | ||
205 | } | 209 | } |
@@ -266,4 +270,5 @@ void KSyncProfile::writeConfig( KConfig * config ) | |||
266 | config->writeEntry( "IsPhoneSync", mIsPhoneSync ); | 270 | config->writeEntry( "IsPhoneSync", mIsPhoneSync ); |
267 | config->writeEntry( "IsPiSync", mIsPiSync ); | 271 | config->writeEntry( "IsPiSync", mIsPiSync ); |
272 | config->writeEntry( "IsPiSyncSpec", mIsPiSyncSpec ); | ||
268 | config->writeEntry( "IsKapiFile", mIsKapiFile ); | 273 | config->writeEntry( "IsKapiFile", mIsKapiFile ); |
269 | config->writeEntry( "FilterInCal", mFilterInCal ); | 274 | config->writeEntry( "FilterInCal", mFilterInCal ); |
@@ -272,4 +277,6 @@ void KSyncProfile::writeConfig( KConfig * config ) | |||
272 | config->writeEntry( "FilterOutAB", mFilterOutAB ); | 277 | config->writeEntry( "FilterOutAB", mFilterOutAB ); |
273 | 278 | ||
279 | config->writeEntry( "ResSpecKopi", mResSpecKopi ); | ||
280 | config->writeEntry( "ResSpecKapi", mResSpecKapi ); | ||
274 | } | 281 | } |
275 | 282 | ||
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index aad63d3..91fcfc5 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -145,7 +145,15 @@ class KSyncProfile : public QObject { | |||
145 | bool getIsPhoneSync( ) { return mIsPhoneSync;} | 145 | bool getIsPhoneSync( ) { return mIsPhoneSync;} |
146 | void setIsPiSync( bool b ) { mIsPiSync= b;} | 146 | void setIsPiSync( bool b ) { mIsPiSync= b;} |
147 | void setIsPiSyncSpec( bool b ) { mIsPiSyncSpec= b;} | ||
147 | bool getIsPiSync( ) { return mIsPiSync;} | 148 | bool getIsPiSync( ) { return mIsPiSync;} |
149 | bool getIsPiSyncSpec( ) { return mIsPiSyncSpec;} | ||
148 | void setIsKapiFile( bool b ) { mIsKapiFile= b;} | 150 | void setIsKapiFile( bool b ) { mIsKapiFile= b;} |
149 | bool getIsKapiFile( ) { return mIsKapiFile;} | 151 | bool getIsKapiFile( ) { return mIsKapiFile;} |
152 | |||
153 | |||
154 | QString getResSpecKopi() { return mResSpecKopi;} | ||
155 | QString getResSpecKapi() { return mResSpecKapi;} | ||
156 | void setResSpecKopi( const QString& n ) {mResSpecKopi = n;} | ||
157 | void setResSpecKapi( const QString& n ) {mResSpecKapi = n;} | ||
150 | private: | 158 | private: |
151 | QString mName; | 159 | QString mName; |
@@ -200,5 +208,8 @@ class KSyncProfile : public QObject { | |||
200 | 208 | ||
201 | bool mIsPiSync; | 209 | bool mIsPiSync; |
210 | bool mIsPiSyncSpec; | ||
202 | bool mIsKapiFile; | 211 | bool mIsKapiFile; |
212 | QString mResSpecKopi; | ||
213 | QString mResSpecKapi; | ||
203 | }; | 214 | }; |
204 | 215 | ||