author | zautrix <zautrix> | 2005-11-25 18:35:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-25 18:35:16 (UTC) |
commit | 231e6f8215bbc4f7e301965f8f3c650e44586ec9 (patch) (side-by-side diff) | |
tree | 4c221ec7ac9909b5f0d192c68558739b4dcc1f48 /libkdepim/ksyncprefsdialog.cpp | |
parent | 279e183c0325cd9565605f60af0215bb9bfdc825 (diff) | |
download | kdepimpi-231e6f8215bbc4f7e301965f8f3c650e44586ec9.zip kdepimpi-231e6f8215bbc4f7e301965f8f3c650e44586ec9.tar.gz kdepimpi-231e6f8215bbc4f7e301965f8f3c650e44586ec9.tar.bz2 |
sync
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 27f7932..744a914 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -498,200 +498,202 @@ void KSyncPrefsDialog::textChanged( const QString & s ) KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; prof->setName( s ); mSyncProfileNames[mProfileBox-> currentItem ()] = s; } void KSyncPrefsDialog::profileChanged( int item ) { //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); KSyncProfile* prof; saveProfile(); readFilter(); readResources(); 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()); mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); mLocalTempFileAB->setText(prof->getLocalTempFileAB()); mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; if ( mWriteContactToSIM ) mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); mPhoneDevice->setText(prof->getPhoneDevice()); mPhoneConnection->setText(prof->getPhoneConnection()); mPhoneModel->setText(prof->getPhoneModel()); mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); mAskForPreferences->setChecked( prof->getAskForPreferences()); mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); mWriteBackFile->setChecked( prof->getWriteBackFile()); mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); mWriteBackFuture->setChecked( prof->getWriteBackFuture()); mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); 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: break; } mIsLocal->setChecked(prof->getIsLocalFileSync()) ; mIsPhone->setChecked(prof->getIsPhoneSync()) ; mIsPi->setChecked(prof->getIsPiSync()) ; mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ; mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; - QStringList res = QStringList::split( ":",prof->getResSpecKopi()); - int i= res.count()/2; - for ( ;i < res.count(); ++i ) { - mResTableKopi->setText( i, 0, res[i] ); + QStringList res = QStringList::split( ":",prof->getResSpecKopi(), true ); + int add = res.count()/2; + int i; + for ( i = 0;i < add ; ++i ) { + mResTableKopi->setText( i, 0, res[i+add] ); } - res = QStringList::split( ":",prof->getResSpecKapi()); - for ( i = 0;i < res.count(); ++i ) { - mResTableKapi->setText( i, 0, res[i] ); + res = QStringList::split( ":",prof->getResSpecKapi(), true); + add = res.count()/2; + for ( i = 0;i < add; ++i ) { + mResTableKapi->setText( i, 0, res[i+add] ); } mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec()); proGr->setEnabled( item > 2 ); if ( item < 3 ) { localFileWidget->hide(); remoteFileWidget->hide(); phoneWidget->hide(); piWidget->hide(); } else kindChanged( prof->getIsLocalFileSync() ); } 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" ); mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); } 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" ); mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); } void KSyncPrefsDialog::kindChanged( bool b ) { if ( mIsLocal->isChecked () ) { mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); } else { mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); } if ( mIsLocal->isChecked () ) localFileWidget->show(); else localFileWidget->hide(); if ( mIsNotLocal->isChecked () ) remoteFileWidget->show(); else remoteFileWidget->hide(); if ( mIsPhone->isChecked () ) { phoneWidget->show(); } else { phoneWidget->hide(); } if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) { piWidget->show(); if (mIsPiSpecific->isChecked () ) { mTableBox->show(); } else { mTableBox->hide(); } } else { piWidget->hide(); } } void KSyncPrefsDialog::deleteProfile() { //qDebug("KSyncPrefsDialog::deleteProfile() "); if ( currentSelection >= 0 ) { if ( currentSelection < 3 ) { 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() |