summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 3df2a3b..7c04f48 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -119,51 +119,54 @@ void KSyncPrefsDialog::setupSyncAlgTab()
++iii;
QHBox* buttonbox = new QHBox( topFrame);
topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1);
++iii;
button = new QPushButton( i18n("New profile"), buttonbox );
connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) );
button = new QPushButton( i18n("Clone profile"), buttonbox );
connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) );
button = new QPushButton( i18n("Delete profile"), buttonbox );
connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) );
mProfileBox = new QComboBox(topFrame);
mProfileBox->setEditable ( true );
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 );
rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
// both = new QRadioButton ( i18n("Take both on conflict"), gr );
mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
++iii;
mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame );
topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
++iii;
mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame );
@@ -254,48 +257,49 @@ void KSyncPrefsDialog::textChanged( const QString & s )
return;
}
//qDebug("cur i %d ",mProfileBox-> currentItem () );
mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
prof->setName( s );
mSyncProfileNames[mProfileBox-> currentItem ()] = s;
}
void KSyncPrefsDialog::profileChanged( int item )
{
//qDebug("KSyncPrefsDialog::profileChanged %d ", item );
KSyncProfile* prof;
saveProfile();
currentSelection = item;
prof = mSyncProfiles.at(item) ;
mRemotePrecommand->setText(prof->getPreSyncCommand());
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;
case 2:
newest->setChecked( true);
break;
case 3:
ask->setChecked( true);
break;
case 4:
f_loc->setChecked( true);
break;
case 5:
f_rem->setChecked( true);
break;
case 6:
//both->setChecked( true);
break;
default:
@@ -340,48 +344,49 @@ void KSyncPrefsDialog::deleteProfile()
KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
return;
}
KSyncProfile* temp = mSyncProfiles.at(currentSelection);
mSyncProfiles.remove( temp );
mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection ));
insertProfiles();
}
}
void KSyncPrefsDialog::saveProfile()
{
KSyncProfile* prof;
if ( currentSelection >= 0 ) {
prof = mSyncProfiles.at(currentSelection) ;
prof->setPreSyncCommand( mRemotePrecommand->text());
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()
{
int curItem = mProfileBox->currentItem();
mProfileBox->blockSignals( true );
mProfileBox->clear();
mProfileBox->insertStringList (mSyncProfileNames );
int item = mSyncProfileNames.count() -1;
if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
mProfileBox->setCurrentItem( curItem );
else if ( item >= 0 ) {
mProfileBox->setCurrentItem( item );
}
currentSelection = -1;
if ( mSyncProfileNames.count() > 0 ) {
//qDebug(" profileChanged( mProfileBox->currentItem() ");
profileChanged( mProfileBox->currentItem() );
currentSelection = mProfileBox->currentItem();