summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
authorzautrix <zautrix>2004-08-01 16:27:04 (UTC)
committer zautrix <zautrix>2004-08-01 16:27:04 (UTC)
commitf968c6f5541463caadee98e200c2ba035fa20959 (patch) (side-by-side diff)
treee71549b7ba1312a55f0311ed74754943d22af22a /libkdepim/ksyncprefsdialog.cpp
parent3a4186926d078692ad3c2261b70406c391f27554 (diff)
downloadkdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.zip
kdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.tar.gz
kdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.tar.bz2
Extended the sync config dialog
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp77
1 files changed, 65 insertions, 12 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 7c04f48..355c05d 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -163,16 +163,24 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
+ ++iii;
+
+ mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
+ topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
++iii;
- mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame );
+ mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
++iii;
-
- mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame );
- topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
+
+ mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame );
+ topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
++iii;
-
+ topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0);
+ mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame);
+ topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
+ ++iii;
+
proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
gr = proGr;
topLayout->addMultiCellWidget(gr, iii,iii,0,1);
@@ -180,30 +188,46 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mIsLocal = new QRadioButton ( i18n("Local file"), gr );
mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
-
+ // *** local
localFileWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
++iii;
QHBox* temphb = new QHBox( localFileWidget );
- lab = new QLabel( i18n("Local file:"), temphb);
- mRemoteFile = new QLineEdit(localFileWidget);
+ lab = new QLabel( i18n("Local file Cal:"), temphb );
+ lab = new QLabel( i18n("Local file ABook:"), temphb );
+ temphb = new QHBox( localFileWidget );
button = new QPushButton( i18n("Choose..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
+ button = new QPushButton( i18n("Choose..."), temphb );
+ connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
+ temphb = new QHBox( localFileWidget );
+ mRemoteFile = new QLineEdit( temphb);
+ mRemoteFileAB = new QLineEdit( temphb);
+ // *** remote
remoteFileWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
++iii;
+ temphb = new QHBox( remoteFileWidget );
+ new QLabel( i18n("Calendar:"), temphb);
+ new QLabel( i18n("AddressBook:"), temphb);
+
lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
- mRemotePrecommand = new QLineEdit(remoteFileWidget);
+ temphb = new QHBox( remoteFileWidget );
+ mRemotePrecommand = new QLineEdit(temphb);
+ mRemotePrecommandAB = new QLineEdit(temphb);
lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
- mLocalTempFile = new QLineEdit(remoteFileWidget);
+ temphb = new QHBox( remoteFileWidget );
+ mLocalTempFile = new QLineEdit(temphb);
+ mLocalTempFileAB = new QLineEdit(temphb);
-
lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
- mRemotePostcommand = new QLineEdit(remoteFileWidget);
+ temphb = new QHBox( remoteFileWidget );
+ mRemotePostcommand = new QLineEdit(temphb );
+ mRemotePostcommandAB = new QLineEdit(temphb );
lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
temphb = new QHBox( remoteFileWidget );
@@ -245,6 +269,16 @@ void KSyncPrefsDialog::chooseFile()
mRemoteFile->setText( fn );
}
+void KSyncPrefsDialog::chooseFileAB()
+{
+ QString fn = QDir::homeDirPath();
+
+ fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
+ if ( fn == "" )
+ return;
+ mRemoteFileAB->setText( fn );
+}
+
void KSyncPrefsDialog::textChanged( const QString & s )
{
if ( mProfileBox->count() == 0 )
@@ -273,12 +307,19 @@ void KSyncPrefsDialog::profileChanged( int item )
mRemotePostcommand->setText(prof->getPostSyncCommand());
mLocalTempFile->setText(prof->getLocalTempFile());
mRemoteFile->setText(prof->getRemoteFileName()) ;
+
+ mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
+ mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
+ mLocalTempFileAB->setText(prof->getLocalTempFileAB());
+ mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
mAskForPreferences->setChecked( prof->getAskForPreferences());
mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
mWriteBackFile->setChecked( prof->getWriteBackFile());
mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
+ mWriteBackFuture->setChecked( prof->getWriteBackFuture());
+ mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
switch ( prof->getSyncPrefs() ) {
case 0:
@@ -321,12 +362,18 @@ void KSyncPrefsDialog::fillSSH()
mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
mLocalTempFile->setText("/tmp/mycalendar.ics" );
mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
+ mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
+ mLocalTempFileAB->setText("/tmp/std.vcf" );
+ mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
}
void KSyncPrefsDialog::fillFTP()
{
mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
mLocalTempFile->setText("/tmp/mycalendar.ics" );
mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
+ mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
+ mLocalTempFileAB->setText("/tmp/std.vcf" );
+ mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
}
void KSyncPrefsDialog::kindChanged( bool b )
@@ -360,6 +407,10 @@ void KSyncPrefsDialog::saveProfile()
prof->setPostSyncCommand( mRemotePostcommand->text() );
prof->setLocalTempFile( mLocalTempFile->text());
prof->setRemoteFileName( mRemoteFile->text() );
+ prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
+ prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
+ prof->setLocalTempFileAB( mLocalTempFileAB->text());
+ prof->setRemoteFileNameAB( mRemoteFileAB->text() );
prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
prof->setAskForPreferences( mAskForPreferences->isChecked());
prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
@@ -369,6 +420,8 @@ void KSyncPrefsDialog::saveProfile()
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() );
+ prof->setWriteBackFuture(mWriteBackFuture->isChecked());
+ prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
}
}