summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp98
-rw-r--r--libkdepim/ksyncprefsdialog.h8
-rw-r--r--libkdepim/ksyncprofile.cpp17
-rw-r--r--libkdepim/ksyncprofile.h14
4 files changed, 131 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
@@ -190,2 +190,29 @@ void KSyncPrefsDialog::setupSyncAlgTab()
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
@@ -194,3 +221,3 @@ void KSyncPrefsDialog::setupSyncAlgTab()
++iii;
- QHBox* temphb = new QHBox( localFileWidget );
+ temphb = new QHBox( localFileWidget );
@@ -314,2 +341,7 @@ void KSyncPrefsDialog::profileChanged( int item )
mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
+
+ mPhoneDevice->setText(prof->getPhoneDevice());
+ mPhoneConnection->setText(prof->getPhoneConnection());
+ mPhoneModel->setText(prof->getPhoneModel());
+
mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
@@ -349,7 +381,9 @@ 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();
@@ -381,4 +415,18 @@ 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();
+ }
@@ -422,4 +470,9 @@ void KSyncPrefsDialog::saveProfile()
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() );
+
}
@@ -529 +582,34 @@ 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"));
+}
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 8c2c59c..3060e78 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -73,2 +73,5 @@ class KSyncPrefsDialog : public KDialog
void slotOK();
+ void helpDevice();
+ void helpModel();
+ void helpConnection();
@@ -87,2 +90,3 @@ class KSyncPrefsDialog : public KDialog
QRadioButton* mIsNotLocal;
+ QRadioButton* mIsPhone;
QCheckBox* mIncludeInRing;
@@ -107,2 +111,5 @@ class KSyncPrefsDialog : public KDialog
+ QLineEdit * mPhoneDevice;
+ QLineEdit * mPhoneConnection;
+ QLineEdit * mPhoneModel;
@@ -111,2 +118,3 @@ class KSyncPrefsDialog : public KDialog
QVBox* remoteFileWidget;
+ QVBox* phoneWidget;
QCheckBox* mWriteBackFile;
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index f34c309..425285e 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -63,2 +63,3 @@ KSyncProfile* KSyncProfile::clone()
myClone->setIsLocalFileSync( mIsLocalFileSync );
+ myClone->setIsPhoneSync( mIsPhoneSync );
myClone->setName( "noName" );
@@ -89,2 +90,6 @@ void KSyncProfile::setDefault()
mIsLocalFileSync = true;
+ mIsPhoneSync = false;
+ mPhoneDevice = "/dev/ircomm";
+ mPhoneConnection = "irda";
+ mPhoneModel = "6310i";
@@ -106,2 +111,7 @@ void KSyncProfile::readConfig(KConfig *config )
+
+ mPhoneDevice = config->readEntry( prefix+ "PhoneDevice", mPhoneDevice );
+ mPhoneConnection = config->readEntry( prefix+ "PhoneConnection", mPhoneConnection );
+ mPhoneModel = config->readEntry( prefix+ "PhoneModel", mPhoneModel );
+
mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
@@ -115,2 +125,3 @@ void KSyncProfile::readConfig(KConfig *config )
mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
+ mIsPhoneSync= config->readBoolEntry( prefix+ "IsPhoneSync", mIsPhoneSync );
}
@@ -130,2 +141,7 @@ void KSyncProfile::writeConfig( KConfig * config )
config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB );
+
+ config->writeEntry( prefix+ "PhoneDevice", mPhoneDevice );
+ config->writeEntry( prefix+ "PhoneConnection", mPhoneConnection );
+ config->writeEntry( prefix+ "PhoneModel", mPhoneModel );
+
config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
@@ -139,2 +155,3 @@ void KSyncProfile::writeConfig( KConfig * config )
config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
+ config->writeEntry( prefix+ "IsPhoneSync", mIsPhoneSync );
}
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 80094b1..300f70f 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -75,2 +75,8 @@ class KSyncProfile : public QObject {
+ void setPhoneDevice( const QString& n ) { mPhoneDevice = n;}
+ QString getPhoneDevice( ) { return mPhoneDevice;}
+ void setPhoneConnection( const QString& n ) { mPhoneConnection = n;}
+ QString getPhoneConnection( ) { return mPhoneConnection;}
+ void setPhoneModel( const QString& n ) { mPhoneModel = n;}
+ QString getPhoneModel( ) { return mPhoneModel;}
/*
@@ -100,2 +106,4 @@ class KSyncProfile : public QObject {
bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
+ void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
+ bool getIsPhoneSync( ) { return mIsPhoneSync;}
@@ -111,2 +119,7 @@ class KSyncProfile : public QObject {
QString mRemoteFileNameAB;
+
+ QString mPhoneDevice;
+ QString mPhoneConnection;
+ QString mPhoneModel;
+
bool mIncludeInRingSync;
@@ -121,2 +134,3 @@ class KSyncProfile : public QObject {
bool mIsLocalFileSync;
+ bool mIsPhoneSync;
};