-rw-r--r-- | korganizer/mainwindow.cpp | 8 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 7 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 3 |
5 files changed, 18 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d0d1f3b..298fa82 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -853,24 +853,24 @@ void MainWindow::fillSyncMenu() } } int MainWindow::ringSync() { int syncedProfiles = 0; int i; QTime timer; - KConfig *config = KOGlobals::config(); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; KSyncProfile* temp = new KSyncProfile (); KOPrefs::instance()->mAskForPreferences = false; for ( i = 0; i < syncProfileNames.count(); ++i ) { mCurrentSyncProfile = i; temp->setName(syncProfileNames[mCurrentSyncProfile]); - temp->readConfig(config); + temp->readConfig(&config); if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); ++syncedProfiles; // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); KOPrefs::instance()->mShowSyncSummary = false; mView->setSyncDevice(syncProfileNames[i] ); @@ -951,20 +951,20 @@ void MainWindow::slotSyncMenu( int action ) } if (mBlockSaveFlag) return; mBlockSaveFlag = true; mCurrentSyncProfile = action - 1000 ; mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); - KConfig *config = KOGlobals::config(); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); KSyncProfile* temp = new KSyncProfile (); temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); - temp->readConfig(config); + temp->readConfig(&config); KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); if ( action == 1000 ) { syncSharp(); diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 3df2a3b..7c04f48 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -135,19 +135,22 @@ void KSyncPrefsDialog::setupSyncAlgTab() connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mProfileBox, iii,1); ++iii; - mIncludeInRing = new QCheckBox( i18n("Include in multiple sync"), topFrame ); + mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); ++iii; + mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); + topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); + ++iii; mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); ++iii; QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); topLayout->addMultiCellWidget(gr, iii,iii,0,1); ++iii; loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); @@ -270,16 +273,17 @@ void KSyncPrefsDialog::profileChanged( int item ) mRemotePostcommand->setText(prof->getPostSyncCommand()); mLocalTempFile->setText(prof->getLocalTempFile()); mRemoteFile->setText(prof->getRemoteFileName()) ; mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); mAskForPreferences->setChecked( prof->getAskForPreferences()); mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); mWriteBackFile->setChecked( prof->getWriteBackFile()); mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); + mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); switch ( prof->getSyncPrefs() ) { case 0: loc->setChecked( true); break; case 1: rem->setChecked( true ); break; @@ -356,16 +360,17 @@ void KSyncPrefsDialog::saveProfile() prof->setPostSyncCommand( mRemotePostcommand->text() ); prof->setLocalTempFile( mLocalTempFile->text()); prof->setRemoteFileName( mRemoteFile->text() ); prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); prof->setAskForPreferences( mAskForPreferences->isChecked()); prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); prof->setWriteBackFile( mWriteBackFile->isChecked()); prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); + prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; prof->setSyncPrefs( syncprefs); prof->setIsLocalFileSync( mIsLocal->isChecked() ); } } void KSyncPrefsDialog::insertProfiles() diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index 90fa286..c663d22 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h @@ -80,16 +80,17 @@ class KSyncPrefsDialog : public KDialog int currentSelection; QPtrList<KSyncProfile> mSyncProfiles; QStringList mSyncProfileNames; QLineEdit * mMyMachineName; QComboBox * mProfileBox; QRadioButton* mIsLocal; QRadioButton* mIsNotLocal; QCheckBox* mIncludeInRing; + QCheckBox* mIncludeInRingAB; void addProfile ( KSyncProfile* ); void insertProfiles(); void saveProfile(); QButtonGroup* proGr; QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index d6d8fa3..ea41a85 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp @@ -47,16 +47,17 @@ KSyncProfile* KSyncProfile::clone() myClone->setPostSyncCommand( mPostSyncCommand ); myClone->setLocalTempFile( mLocalTempFile); myClone->setRemoteFileName( mRemoteFileName ); myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); myClone->setAskForPreferences( mAskForPreferences); myClone->setWriteBackExisting(mWriteBackExisting ); myClone->setWriteBackFile( mWriteBackFile); myClone->setIncludeInRingSync( mIncludeInRingSync ); + myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); myClone->setSyncPrefs( mSyncPrefs); myClone->setIsLocalFileSync( mIsLocalFileSync ); myClone->setName( "noName" ); return myClone; } void KSyncProfile::setDefault() @@ -66,44 +67,47 @@ void KSyncProfile::setDefault() mPostSyncCommand = i18n("command for uploading local temp file to remote device"); mLocalTempFile = "/tmp/mycalendar.ics"; mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; mShowSummaryAfterSync = true; mAskForPreferences = true; mWriteBackExisting = false; mWriteBackFile = true; mIncludeInRingSync = false; + mIncludeInRingSyncAB = false; mSyncPrefs = SYNC_PREF_ASK; mIsLocalFileSync = true; } void KSyncProfile::readConfig(KConfig *config ) { config->setGroup("SyncProfiles"); QString prefix = "Profile_"+mName+"_"; //mName = config->readEntry( prefix+ "Name", mName ); mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); + mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); } void KSyncProfile::writeConfig( KConfig * config ) { config->setGroup("SyncProfiles"); QString prefix = "Profile_"+mName+"_"; // config->writeEntry( prefix+ "Name", mName ); config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); + config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); } diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 3f7f1ac..df1b49e 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h @@ -74,28 +74,31 @@ class KSyncProfile : public QObject { void setAskForPreferences( bool b ) { mAskForPreferences= b;} bool getAskForPreferences( ) { return mAskForPreferences;} void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} bool getWriteBackExisting( ) { return mWriteBackExisting;} void setWriteBackFile( bool b ) { mWriteBackFile= b;} bool getWriteBackFile( ) { return mWriteBackFile;} void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} bool getIncludeInRingSync( ) { return mIncludeInRingSync;} + void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} + bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} void setSyncPrefs( int n ) { mSyncPrefs= n;} int getSyncPrefs( ) { return mSyncPrefs;} void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} bool getIsLocalFileSync( ) { return mIsLocalFileSync;} private: QString mName; QString mPreSyncCommand; QString mPostSyncCommand; QString mLocalTempFile; QString mRemoteFileName; bool mIncludeInRingSync; + bool mIncludeInRingSyncAB; int mSyncPrefs; bool mWriteBackFile; bool mWriteBackExisting; bool mAskForPreferences; bool mShowSummaryAfterSync; bool mIsLocalFileSync; }; |