Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 98 |
1 files changed, 92 insertions, 6 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 355c05d..c6c5ff8 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -189,9 +189,36 @@ void KSyncPrefsDialog::setupSyncAlgTab() 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) ) ); + + + phoneWidget = new QVBox( topFrame); + topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); + ++iii; + QHBox* temphb = new QHBox( phoneWidget ); + new QLabel( i18n("I/O device: "), temphb ); + mPhoneDevice = new QLineEdit( temphb); + button = new QPushButton( i18n("Help..."), temphb ); + connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); + + + temphb = new QHBox( phoneWidget ); + new QLabel( i18n("Connection: "), temphb ); + mPhoneConnection = new QLineEdit( temphb); + button = new QPushButton( i18n("Help..."), temphb ); + connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); + + + temphb = new QHBox( phoneWidget ); + new QLabel( i18n("Model(opt.): "), temphb ); + mPhoneModel = new QLineEdit( temphb); + button = new QPushButton( i18n("Help..."), temphb ); + connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); + // *** local localFileWidget = new QVBox( topFrame); topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); ++iii; - QHBox* temphb = new QHBox( localFileWidget ); + temphb = new QHBox( localFileWidget ); lab = new QLabel( i18n("Local file Cal:"), temphb ); @@ -313,4 +340,9 @@ void KSyncPrefsDialog::profileChanged( int item ) mLocalTempFileAB->setText(prof->getLocalTempFileAB()); mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; + + mPhoneDevice->setText(prof->getPhoneDevice()); + mPhoneConnection->setText(prof->getPhoneConnection()); + mPhoneModel->setText(prof->getPhoneModel()); + mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); mAskForPreferences->setChecked( prof->getAskForPreferences()); @@ -348,9 +380,11 @@ void KSyncPrefsDialog::profileChanged( int item ) } mIsLocal->setChecked(prof->getIsLocalFileSync()) ; - mIsNotLocal->setChecked(!prof->getIsLocalFileSync()); + mIsPhone->setChecked(prof->getIsPhoneSync()) ; + mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); proGr->setEnabled( item > 2 ); if ( item < 3 ) { - localFileWidget->setEnabled(false); - remoteFileWidget->setEnabled(false); + localFileWidget->hide(); + remoteFileWidget->hide(); + phoneWidget->hide(); } else @@ -380,6 +414,20 @@ void KSyncPrefsDialog::kindChanged( bool b ) { - localFileWidget->setEnabled(b); - remoteFileWidget->setEnabled(!b); + if ( mIsLocal->isChecked () ) + localFileWidget->show(); + else + localFileWidget->hide(); + + if ( mIsNotLocal->isChecked () ) + remoteFileWidget->show(); + else + remoteFileWidget->hide(); + + if ( mIsPhone->isChecked () ) { + phoneWidget->show(); + } + else { + phoneWidget->hide(); + } } @@ -421,6 +469,11 @@ void KSyncPrefsDialog::saveProfile() prof->setSyncPrefs( syncprefs); prof->setIsLocalFileSync( mIsLocal->isChecked() ); + prof->setIsPhoneSync( mIsPhone->isChecked() ); prof->setWriteBackFuture(mWriteBackFuture->isChecked()); prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); + prof->setPhoneDevice( mPhoneDevice->text() ); + prof->setPhoneConnection( mPhoneConnection->text() ); + prof->setPhoneModel( mPhoneModel->text() ); + } @@ -528,2 +581,35 @@ void KSyncPrefsDialog::usrWriteConfig() } +void KSyncPrefsDialog::helpDevice() +{ + QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); +#ifdef _WIN32_ + hint += "leave empty for Irda\n" + "com1:\n(first serial port)\n" + "usb not supported\n" + "???\n(bluetooth device address)\n"; + +#else + hint += "/dev/ircomm\n(Irda)\n" + "/dev/ttyS0\n(first serial port)\n" + "/dev/ttyUSB0\n(first device usb port)\n" + "???\n(bluetooth device address)\n"; +#endif + KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); +} +void KSyncPrefsDialog::helpModel() +{ + QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); + hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; + KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); + +} +void KSyncPrefsDialog::helpConnection() +{ + QString hint = i18n("Insert kind of connection,e.g.:\n"); + hint += "irda | Nokia FBUS over infrared\n" + "irdaat | AT commands infrared\n(Siemens/Sony-Erricsson)\n" + "irdaobex | set model obex\n" + "fbus | Nokia FBUS2 serial\n"; + KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); +} |