summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
authorzautrix <zautrix>2004-10-04 21:21:00 (UTC)
committer zautrix <zautrix>2004-10-04 21:21:00 (UTC)
commitf53ef630b9299ceae666e64da8ce022813795ed6 (patch) (side-by-side diff)
tree26dc94a83f42c2174195817c505c34941246d2e3 /libkdepim/ksyncprefsdialog.cpp
parentdfc6d084410456037bf6f26f741e7b938085de88 (diff)
downloadkdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.zip
kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.gz
kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.bz2
added option to sync config dialog
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp70
1 files changed, 68 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 28aac45..f05c846 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -187,16 +187,18 @@ void KSyncPrefsDialog::setupSyncAlgTab()
proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
gr = proGr;
topLayout->addMultiCellWidget(gr, iii,iii,0,1);
++iii;
mIsLocal = new QRadioButton ( i18n("Local file"), gr );
+ mIsPi = new QRadioButton ( i18n("Quick Pi-Sync"), gr );
+ connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
- connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
+ connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
phoneWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
++iii;
mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
@@ -273,15 +275,46 @@ void KSyncPrefsDialog::setupSyncAlgTab()
temphb = new QHBox( remoteFileWidget );
button = new QPushButton( i18n("ssh/scp"), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
button = new QPushButton( i18n("ftp"), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
-
+
+ // *** pi-sync
+ piWidget = new QVBox( topFrame);
+ topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
+ ++iii;
+ temphb = new QHBox( piWidget );
+ new QLabel( i18n("Calendar:"), temphb);
+ new QLabel( i18n("AddressBook:"), temphb);
+ new QLabel( i18n("PWManager:"), temphb);
+
+ lab = new QLabel( i18n("Password for remote access:"), piWidget);
+ temphb = new QHBox( piWidget );
+ mRemotePw = new QLineEdit(temphb);
+ mRemotePwAB = new QLineEdit(temphb);
+ mRemotePwPWM = new QLineEdit(temphb);
+
+ lab = new QLabel( i18n("Remote IP address:"), piWidget);
+ temphb = new QHBox( piWidget );
+ mRemoteIP = new QLineEdit(temphb);
+ mRemoteIPAB = new QLineEdit(temphb);
+ mRemoteIPPWM = new QLineEdit(temphb);
+
+ lab = new QLabel( i18n("Remote port number:"), piWidget);
+ temphb = new QHBox( piWidget );
+ mRemotePort = new QLineEdit(temphb);
+ mRemotePortAB = new QLineEdit(temphb);
+ mRemotePortPWM = new QLineEdit(temphb);
}
+
+
+
+
+
void KSyncPrefsDialog::slotOK()
{
if ( mMyMachineName->text() == "undefined" ) {
KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
return;
}
@@ -350,12 +383,25 @@ void KSyncPrefsDialog::profileChanged( int item )
{
//qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
KSyncProfile* prof;
saveProfile();
currentSelection = item;
prof = mSyncProfiles.at(item) ;
+
+ mRemotePw->setText(prof->getRemotePw());
+ mRemoteIP->setText(prof->getRemoteIP());
+ mRemotePort->setText(prof->getRemotePort());
+
+ mRemotePwAB->setText(prof->getRemotePwAB());
+ mRemoteIPAB->setText(prof->getRemoteIPAB());
+ mRemotePortAB->setText(prof->getRemotePortAB());
+
+ mRemotePwPWM->setText(prof->getRemotePwPWM());
+ mRemoteIPPWM->setText(prof->getRemoteIPPWM());
+ mRemotePortPWM->setText(prof->getRemotePortPWM());
+
mRemotePrecommand->setText(prof->getPreSyncCommand());
mRemotePostcommand->setText(prof->getPostSyncCommand());
mLocalTempFile->setText(prof->getLocalTempFile());
mRemoteFile->setText(prof->getRemoteFileName()) ;
mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
@@ -413,12 +459,13 @@ void KSyncPrefsDialog::profileChanged( int item )
mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() );
proGr->setEnabled( item > 2 );
if ( item < 3 ) {
localFileWidget->hide();
remoteFileWidget->hide();
phoneWidget->hide();
+ piWidget->hide();
} else
kindChanged( prof->getIsLocalFileSync() );
}
void KSyncPrefsDialog::fillSSH()
@@ -463,12 +510,18 @@ void KSyncPrefsDialog::kindChanged( bool b )
if ( mIsPhone->isChecked () ) {
phoneWidget->show();
}
else {
phoneWidget->hide();
}
+ if ( mIsPi->isChecked () ) {
+ piWidget->show();
+ }
+ else {
+ piWidget->hide();
+ }
}
void KSyncPrefsDialog::deleteProfile()
{
//qDebug("KSyncPrefsDialog::deleteProfile() ");
if ( currentSelection >= 0 ) {
@@ -485,12 +538,25 @@ void KSyncPrefsDialog::deleteProfile()
void KSyncPrefsDialog::saveProfile()
{
KSyncProfile* prof;
if ( currentSelection >= 0 ) {
prof = mSyncProfiles.at(currentSelection) ;
+
+ prof->setRemotePw( mRemotePw->text());
+ prof->setRemoteIP( mRemoteIP->text());
+ prof->setRemotePort( mRemotePort->text());
+
+ prof->setRemotePwAB( mRemotePwAB->text());
+ prof->setRemoteIPAB( mRemoteIPAB->text());
+ prof->setRemotePortAB( mRemotePortAB->text());
+
+ prof->setRemotePwPWM( mRemotePwPWM->text());
+ prof->setRemoteIPPWM( mRemoteIPPWM->text());
+ prof->setRemotePortPWM( mRemotePortPWM->text());
+
prof->setPreSyncCommand( mRemotePrecommand->text());
prof->setPostSyncCommand( mRemotePostcommand->text() );
prof->setLocalTempFile( mLocalTempFile->text());
prof->setRemoteFileName( mRemoteFile->text() );
prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );