summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-11-25 09:55:37 (UTC)
committer zautrix <zautrix>2005-11-25 09:55:37 (UTC)
commit90b62d1158d00f162a258541e24aaed4c967480b (patch) (unidiff)
tree96f76bc60fae40113101aa1f321ff869bbd7979b
parentd0de047797095f1862f4ff77b8dcd0d22643882d (diff)
downloadkdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.zip
kdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.tar.gz
kdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.tar.bz2
sync
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp72
-rw-r--r--libkdepim/ksyncprefsdialog.h10
-rw-r--r--libkdepim/ksyncprofile.cpp7
-rw-r--r--libkdepim/ksyncprofile.h11
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
@@ -232,26 +232,28 @@ void KSyncPrefsDialog::setupSyncAlgTab()
232 //++iii; 232 //++iii;
233 gb3->setEnabled( false ); 233 gb3->setEnabled( false );
234 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); 234 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) );
235 } 235 }
236 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); 236 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
237 237
238 } 238 }
239 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 239 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
240 gr = proGr; 240 gr = proGr;
241 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 241 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
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) ) );
248 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 250 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
249 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 251 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
250 252
251 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); 253 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame);
252 topLayout->addMultiCellWidget(gb1, iii,iii,0,1); 254 topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
253 ++iii; 255 ++iii;
254 256
255 // ****************************************** 257 // ******************************************
256 // Profile kind specific settings 258 // Profile kind specific settings
257 { 259 {
@@ -357,30 +359,60 @@ void KSyncPrefsDialog::setupSyncAlgTab()
357 359
358 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); 360 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
359 temphb = new QHBox( piWidget ); 361 temphb = new QHBox( piWidget );
360 mRemoteIP = new QLineEdit(temphb); 362 mRemoteIP = new QLineEdit(temphb);
361 mRemoteIPAB = new QLineEdit(temphb); 363 mRemoteIPAB = new QLineEdit(temphb);
362 mRemoteIPPWM = new QLineEdit(temphb); 364 mRemoteIPPWM = new QLineEdit(temphb);
363 365
364 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); 366 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
365 temphb = new QHBox( piWidget ); 367 temphb = new QHBox( piWidget );
366 mRemotePort = new QLineEdit(temphb); 368 mRemotePort = new QLineEdit(temphb);
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 // ******************************************
371 // Profile kind specific settings END 383 // Profile kind specific settings END
372 384
373} 385}
374 386
387void 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}
375void KSyncPrefsDialog::readFilter() 407void KSyncPrefsDialog::readFilter()
376{ 408{
377 mFilterKapi.clear(); 409 mFilterKapi.clear();
378 mFilterKopi.clear(); 410 mFilterKopi.clear();
379 KConfig cfgko(locateLocal("config","korganizerrc")); 411 KConfig cfgko(locateLocal("config","korganizerrc"));
380 KConfig cfgka(locateLocal("config","kaddressbookrc")); 412 KConfig cfgka(locateLocal("config","kaddressbookrc"));
381 cfgko.setGroup("General"); 413 cfgko.setGroup("General");
382 mFilterKopi = cfgko.readListEntry("CalendarFilters"); 414 mFilterKopi = cfgko.readListEntry("CalendarFilters");
383 cfgka.setGroup("Filter"); 415 cfgka.setGroup("Filter");
384 int count = cfgka.readNumEntry( "Count", 0 ); 416 int count = cfgka.readNumEntry( "Count", 0 );
385 for ( int i = 0; i < count; i++ ) { 417 for ( int i = 0; i < count; i++ ) {
386 cfgka.setGroup("Filter_"+QString::number( i ) ); 418 cfgka.setGroup("Filter_"+QString::number( i ) );
@@ -464,24 +496,25 @@ void KSyncPrefsDialog::textChanged( const QString & s )
464 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 496 //qDebug("cur i %d ",mProfileBox-> currentItem () );
465 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 497 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
466 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 498 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
467 prof->setName( s ); 499 prof->setName( s );
468 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 500 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
469} 501}
470void KSyncPrefsDialog::profileChanged( int item ) 502void KSyncPrefsDialog::profileChanged( int item )
471{ 503{
472 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 504 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
473 KSyncProfile* prof; 505 KSyncProfile* prof;
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) ;
478 511
479 mRemotePw->setText(prof->getRemotePw()); 512 mRemotePw->setText(prof->getRemotePw());
480 mRemoteIP->setText(prof->getRemoteIP()); 513 mRemoteIP->setText(prof->getRemoteIP());
481 mRemotePort->setText(prof->getRemotePort()); 514 mRemotePort->setText(prof->getRemotePort());
482 515
483 mRemotePwAB->setText(prof->getRemotePwAB()); 516 mRemotePwAB->setText(prof->getRemotePwAB());
484 mRemoteIPAB->setText(prof->getRemoteIPAB()); 517 mRemoteIPAB->setText(prof->getRemoteIPAB());
485 mRemotePortAB->setText(prof->getRemotePortAB()); 518 mRemotePortAB->setText(prof->getRemotePortAB());
486 519
487 mRemotePwPWM->setText(prof->getRemotePwPWM()); 520 mRemotePwPWM->setText(prof->getRemotePwPWM());
@@ -544,28 +577,39 @@ void KSyncPrefsDialog::profileChanged( int item )
544 case 5: 577 case 5:
545 f_rem->setChecked( true); 578 f_rem->setChecked( true);
546 break; 579 break;
547 case 6: 580 case 6:
548 //both->setChecked( true); 581 //both->setChecked( true);
549 break; 582 break;
550 default: 583 default:
551 break; 584 break;
552 } 585 }
553 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 586 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
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 ) {
562 localFileWidget->hide(); 606 localFileWidget->hide();
563 remoteFileWidget->hide(); 607 remoteFileWidget->hide();
564 phoneWidget->hide(); 608 phoneWidget->hide();
565 piWidget->hide(); 609 piWidget->hide();
566 610
567 } else 611 } else
568 kindChanged( prof->getIsLocalFileSync() ); 612 kindChanged( prof->getIsLocalFileSync() );
569} 613}
570 614
571void KSyncPrefsDialog::fillSSH() 615void KSyncPrefsDialog::fillSSH()
@@ -609,31 +653,39 @@ void KSyncPrefsDialog::kindChanged( bool b )
609 localFileWidget->hide(); 653 localFileWidget->hide();
610 654
611 if ( mIsNotLocal->isChecked () ) 655 if ( mIsNotLocal->isChecked () )
612 remoteFileWidget->show(); 656 remoteFileWidget->show();
613 else 657 else
614 remoteFileWidget->hide(); 658 remoteFileWidget->hide();
615 659
616 if ( mIsPhone->isChecked () ) { 660 if ( mIsPhone->isChecked () ) {
617 phoneWidget->show(); 661 phoneWidget->show();
618 } 662 }
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}
630void KSyncPrefsDialog::deleteProfile() 682void KSyncPrefsDialog::deleteProfile()
631{ 683{
632 //qDebug("KSyncPrefsDialog::deleteProfile() "); 684 //qDebug("KSyncPrefsDialog::deleteProfile() ");
633 if ( currentSelection >= 0 ) { 685 if ( currentSelection >= 0 ) {
634 if ( currentSelection < 3 ) { 686 if ( currentSelection < 3 ) {
635 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); 687 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
636 return; 688 return;
637 } 689 }
638 KSyncProfile* temp = mSyncProfiles.at(currentSelection); 690 KSyncProfile* temp = mSyncProfiles.at(currentSelection);
639 mSyncProfiles.remove( temp ); 691 mSyncProfiles.remove( temp );
@@ -675,37 +727,47 @@ void KSyncPrefsDialog::saveProfile()
675 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 727 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
676 prof->setAskForPreferences( mAskForPreferences->isChecked()); 728 prof->setAskForPreferences( mAskForPreferences->isChecked());
677 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 729 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
678 prof->setWriteBackFile( mWriteBackFile->isChecked()); 730 prof->setWriteBackFile( mWriteBackFile->isChecked());
679 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 731 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
680 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 732 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
681 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 733 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
682 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 734 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
683 prof->setSyncPrefs( syncprefs); 735 prof->setSyncPrefs( syncprefs);
684 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 736 prof->setIsLocalFileSync( mIsLocal->isChecked() );
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());
689 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 742 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
690 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); 743 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value());
691 if ( mWriteContactToSIM ) 744 if ( mWriteContactToSIM )
692 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 745 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
693 prof->setPhoneDevice( mPhoneDevice->text() ); 746 prof->setPhoneDevice( mPhoneDevice->text() );
694 prof->setPhoneConnection( mPhoneConnection->text() ); 747 prof->setPhoneConnection( mPhoneConnection->text() );
695 prof->setPhoneModel( mPhoneModel->text() ); 748 prof->setPhoneModel( mPhoneModel->text() );
696 prof->setFilterInCal ( mFilterInCal->currentText ()); 749 prof->setFilterInCal ( mFilterInCal->currentText ());
697 prof->setFilterOutCal ( mFilterOutCal ->currentText ()); 750 prof->setFilterOutCal ( mFilterOutCal ->currentText ());
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}
702 764
703void KSyncPrefsDialog::insertProfiles() 765void KSyncPrefsDialog::insertProfiles()
704{ 766{
705 int curItem = mProfileBox->currentItem(); 767 int curItem = mProfileBox->currentItem();
706 mProfileBox->blockSignals( true ); 768 mProfileBox->blockSignals( true );
707 mProfileBox->clear(); 769 mProfileBox->clear();
708 mProfileBox->insertStringList (mSyncProfileNames ); 770 mProfileBox->insertStringList (mSyncProfileNames );
709 int item = mSyncProfileNames.count() -1; 771 int item = mSyncProfileNames.count() -1;
710 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) 772 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
711 mProfileBox->setCurrentItem( curItem ); 773 mProfileBox->setCurrentItem( curItem );
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 24543e1..e8a9709 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -17,24 +17,26 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KSYNCPREFSDIALOG_H 23#ifndef _KSYNCPREFSDIALOG_H
24#define _KSYNCPREFSDIALOG_H 24#define _KSYNCPREFSDIALOG_H
25 25
26 26
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>
31 33
32class KColorButton; 34class KColorButton;
33class QSpinBox;; 35class QSpinBox;;
34class QRadioButton; 36class QRadioButton;
35class QCheckBox; 37class QCheckBox;
36class QSlider; 38class QSlider;
37class KURLRequester; 39class KURLRequester;
38class QComboBox; 40class QComboBox;
39class QButtonGroup; 41class QButtonGroup;
40class QLineEdit; 42class QLineEdit;
@@ -71,43 +73,51 @@ class KSyncPrefsDialog : public KDialog
71 void chooseFile(); 73 void chooseFile();
72 void chooseFileAB(); 74 void chooseFileAB();
73 void chooseFilePWM(); 75 void chooseFilePWM();
74 void slotOK(); 76 void slotOK();
75 void helpDevice(); 77 void helpDevice();
76 void helpModel(); 78 void helpModel();
77 void helpConnection(); 79 void helpConnection();
78 80
79 protected: 81 protected:
80 void usrWriteConfig(); 82 void usrWriteConfig();
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;
85 QPtrList<KSyncProfile> mSyncProfiles; 88 QPtrList<KSyncProfile> mSyncProfiles;
86 QStringList mSyncProfileNames; 89 QStringList mSyncProfileNames;
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;
91 QRadioButton* mIsLocal; 96 QRadioButton* mIsLocal;
92 QRadioButton* mIsNotLocal; 97 QRadioButton* mIsNotLocal;
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;
97 QCheckBox* mIncludeInRingPWM; 103 QCheckBox* mIncludeInRingPWM;
98 void addProfile ( KSyncProfile* ); 104 void addProfile ( KSyncProfile* );
99 void insertProfiles(); 105 void insertProfiles();
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;
104 QComboBox * mFilterInCal; 114 QComboBox * mFilterInCal;
105 QComboBox * mFilterOutAB; 115 QComboBox * mFilterOutAB;
106 QComboBox * mFilterInAB; 116 QComboBox * mFilterInAB;
107 117
108 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; 118 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both;
109 119
110 120
111 QLineEdit * mRemotePostcommand; 121 QLineEdit * mRemotePostcommand;
112 QLineEdit * mRemotePrecommand; 122 QLineEdit * mRemotePrecommand;
113 QLineEdit * mRemoteFile; 123 QLineEdit * mRemoteFile;
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 0d72fc9..d6620c8 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -123,24 +123,25 @@ void KSyncProfile::setDefault()
123 mWriteBackFuture = false; 123 mWriteBackFuture = false;
124 mWriteBackFutureWeeks = 12; 124 mWriteBackFutureWeeks = 12;
125 mWriteBackPastWeeks = 2; 125 mWriteBackPastWeeks = 2;
126 mWriteBackFile = true; 126 mWriteBackFile = true;
127 mIncludeInRingSync = false; 127 mIncludeInRingSync = false;
128 mIncludeInRingSyncAB = false; 128 mIncludeInRingSyncAB = false;
129 mIncludeInRingSyncPWM = false; 129 mIncludeInRingSyncPWM = false;
130 mSyncPrefs = SYNC_PREF_ASK; 130 mSyncPrefs = SYNC_PREF_ASK;
131 mIsLocalFileSync = true; 131 mIsLocalFileSync = true;
132 mName = "noName"; 132 mName = "noName";
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;
137 mPhoneDevice = "/dev/ircomm"; 138 mPhoneDevice = "/dev/ircomm";
138 mPhoneConnection = "irda"; 139 mPhoneConnection = "irda";
139 mPhoneModel = "6310i"; 140 mPhoneModel = "6310i";
140 mFilterInCal = "no filter"; 141 mFilterInCal = "no filter";
141 mFilterOutCal = "no filter"; 142 mFilterOutCal = "no filter";
142 mFilterInAB = "no filter"; 143 mFilterInAB = "no filter";
143 mFilterOutAB = "no filter"; 144 mFilterOutAB = "no filter";
144} 145}
145void KSyncProfile::readConfig(KConfig *config ) 146void KSyncProfile::readConfig(KConfig *config )
146{ 147{
@@ -186,30 +187,33 @@ void KSyncProfile::readConfig(KConfig *config )
186 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 187 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
187 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 188 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
188 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 189 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
189 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 190 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
190 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 191 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
191 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 192 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
192 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 193 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
193 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 194 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
194 mWriteBackPastWeeks = config->readNumEntry( "WriteBackPastWeeks", mWriteBackPastWeeks ); 195 mWriteBackPastWeeks = config->readNumEntry( "WriteBackPastWeeks", mWriteBackPastWeeks );
195 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 196 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
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
200 mFilterInCal = config->readEntry( "FilterInCal", mFilterInCal ); 202 mFilterInCal = config->readEntry( "FilterInCal", mFilterInCal );
201 mFilterOutCal = config->readEntry( "FilterOutCal", mFilterOutCal ); 203 mFilterOutCal = config->readEntry( "FilterOutCal", mFilterOutCal );
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 }
206 else 210 else
207 { 211 {
208 setDefault(); 212 setDefault();
209 } 213 }
210} 214}
211 215
212void KSyncProfile::deleteConfig(KConfig *config ) 216void KSyncProfile::deleteConfig(KConfig *config )
213{ 217{
214 config->deleteGroup( mName ); 218 config->deleteGroup( mName );
215} 219}
@@ -256,20 +260,23 @@ void KSyncProfile::writeConfig( KConfig * config )
256 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 260 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
257 config->writeEntry( "AskForPreferences",mAskForPreferences ); 261 config->writeEntry( "AskForPreferences",mAskForPreferences );
258 config->writeEntry( "WriteBackExisting",mWriteBackExisting ); 262 config->writeEntry( "WriteBackExisting",mWriteBackExisting );
259 config->writeEntry( "WriteBackFuture",mWriteBackFuture ); 263 config->writeEntry( "WriteBackFuture",mWriteBackFuture );
260 config->writeEntry( "WriteBackFile",mWriteBackFile ); 264 config->writeEntry( "WriteBackFile",mWriteBackFile );
261 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); 265 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
262 config->writeEntry( "SyncPrefs", mSyncPrefs ); 266 config->writeEntry( "SyncPrefs", mSyncPrefs );
263 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); 267 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
264 config->writeEntry( "WriteBackPastWeeks", mWriteBackPastWeeks); 268 config->writeEntry( "WriteBackPastWeeks", mWriteBackPastWeeks);
265 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); 269 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
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 );
270 config->writeEntry( "FilterOutCal", mFilterOutCal ); 275 config->writeEntry( "FilterOutCal", mFilterOutCal );
271 config->writeEntry( "FilterInAB", mFilterInAB ); 276 config->writeEntry( "FilterInAB", mFilterInAB );
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
@@ -135,27 +135,35 @@ class KSyncProfile : public QObject {
135 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;} 135 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;}
136 void setSyncPrefs( int n ) { mSyncPrefs= n;} 136 void setSyncPrefs( int n ) { mSyncPrefs= n;}
137 int getSyncPrefs( ) { return mSyncPrefs;} 137 int getSyncPrefs( ) { return mSyncPrefs;}
138 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} 138 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
139 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} 139 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
140 void setWriteBackPastWeeks( int n ) { mWriteBackPastWeeks= n;} 140 void setWriteBackPastWeeks( int n ) { mWriteBackPastWeeks= n;}
141 int getWriteBackPastWeeks( ) { return mWriteBackPastWeeks;} 141 int getWriteBackPastWeeks( ) { return mWriteBackPastWeeks;}
142 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} 142 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
143 bool getIsLocalFileSync( ) { return mIsLocalFileSync;} 143 bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
144 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} 144 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
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;
152 QString mPreSyncCommand; 160 QString mPreSyncCommand;
153 QString mPostSyncCommand; 161 QString mPostSyncCommand;
154 QString mLocalTempFile; 162 QString mLocalTempFile;
155 QString mRemoteFileName; 163 QString mRemoteFileName;
156 QString mPreSyncCommandAB; 164 QString mPreSyncCommandAB;
157 QString mPostSyncCommandAB; 165 QString mPostSyncCommandAB;
158 QString mLocalTempFileAB; 166 QString mLocalTempFileAB;
159 QString mRemoteFileNameAB; 167 QString mRemoteFileNameAB;
160 QString mPreSyncCommandPWM; 168 QString mPreSyncCommandPWM;
161 QString mPostSyncCommandPWM; 169 QString mPostSyncCommandPWM;
@@ -190,16 +198,19 @@ class KSyncProfile : public QObject {
190 bool mWriteBackFile; 198 bool mWriteBackFile;
191 bool mWriteBackExisting; 199 bool mWriteBackExisting;
192 bool mWriteBackFuture; 200 bool mWriteBackFuture;
193 int mWriteBackFutureWeeks; 201 int mWriteBackFutureWeeks;
194 int mWriteBackPastWeeks; 202 int mWriteBackPastWeeks;
195 bool mAskForPreferences; 203 bool mAskForPreferences;
196 bool mShowSummaryAfterSync; 204 bool mShowSummaryAfterSync;
197 bool mIsLocalFileSync; 205 bool mIsLocalFileSync;
198 bool mIsPhoneSync; 206 bool mIsPhoneSync;
199 bool mWriteContactToSIM; 207 bool mWriteContactToSIM;
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
205#endif 216#endif