summaryrefslogtreecommitdiffabout
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
parentdfc6d084410456037bf6f26f741e7b938085de88 (diff)
downloadkdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.zip
kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.gz
kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.bz2
added option to sync config dialog
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp66
-rw-r--r--libkdepim/ksyncprefsdialog.h15
-rw-r--r--libkdepim/ksyncprofile.cpp49
-rw-r--r--libkdepim/ksyncprofile.h37
4 files changed, 167 insertions, 0 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 28aac45..f05c846 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -190,6 +190,8 @@ void KSyncPrefsDialog::setupSyncAlgTab()
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 );
@@ -277,8 +279,39 @@ void KSyncPrefsDialog::setupSyncAlgTab()
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" ) {
@@ -353,6 +386,19 @@ void KSyncPrefsDialog::profileChanged( int item )
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());
@@ -416,6 +462,7 @@ void KSyncPrefsDialog::profileChanged( int item )
localFileWidget->hide();
remoteFileWidget->hide();
phoneWidget->hide();
+ piWidget->hide();
} else
kindChanged( prof->getIsLocalFileSync() );
@@ -466,6 +513,12 @@ void KSyncPrefsDialog::kindChanged( bool b )
else {
phoneWidget->hide();
}
+ if ( mIsPi->isChecked () ) {
+ piWidget->show();
+ }
+ else {
+ piWidget->hide();
+ }
}
void KSyncPrefsDialog::deleteProfile()
@@ -488,6 +541,19 @@ 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());
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 8094bdd..d3f8f4c 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -90,6 +90,7 @@ class KSyncPrefsDialog : public KDialog
QRadioButton* mIsLocal;
QRadioButton* mIsNotLocal;
QRadioButton* mIsPhone;
+ QRadioButton* mIsPi;
QCheckBox* mIncludeInRing;
QCheckBox* mIncludeInRingAB;
QCheckBox* mIncludeInRingPWM;
@@ -116,6 +117,19 @@ class KSyncPrefsDialog : public KDialog
QLineEdit * mRemoteFilePWM;
QLineEdit * mLocalTempFilePWM;
+
+ QLineEdit * mRemotePw;
+ QLineEdit * mRemoteIP;
+ QLineEdit * mRemotePort;
+
+ QLineEdit * mRemotePwAB;
+ QLineEdit * mRemoteIPAB;
+ QLineEdit * mRemotePortAB;
+
+ QLineEdit * mRemotePwPWM;
+ QLineEdit * mRemoteIPPWM;
+ QLineEdit * mRemotePortPWM;
+
QLineEdit * mPhoneDevice;
QLineEdit * mPhoneConnection;
QLineEdit * mPhoneModel;
@@ -124,6 +138,7 @@ class KSyncPrefsDialog : public KDialog
QVBox* localFileWidget;
QVBox* remoteFileWidget;
QVBox* phoneWidget;
+ QVBox* piWidget;
QCheckBox* mWriteBackFile;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 2bf4e6c..76dfe00 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -43,6 +43,15 @@ KSyncProfile::~KSyncProfile()
KSyncProfile* KSyncProfile::clone()
{
KSyncProfile* myClone = new KSyncProfile();
+ myClone->setRemotePw(mRemotePw);
+ myClone->setRemoteIP(mRemoteIP);
+ myClone->setRemotePort(mRemotePort);
+ myClone->setRemotePwAB(mRemotePwAB);
+ myClone->setRemoteIPAB(mRemoteIPAB);
+ myClone->setRemotePortAB(mRemotePortAB);
+ myClone->setRemotePwPWM(mRemotePwPWM);
+ myClone->setRemoteIPPWM(mRemoteIPPWM);
+ myClone->setRemotePortPWM (mRemotePortPWM);
myClone->setPreSyncCommand( mPreSyncCommand );
myClone->setPostSyncCommand( mPostSyncCommand );
myClone->setLocalTempFile( mLocalTempFile);
@@ -67,6 +76,7 @@ KSyncProfile* KSyncProfile::clone()
myClone->setSyncPrefs( mSyncPrefs);
myClone->setIsLocalFileSync( mIsLocalFileSync );
myClone->setIsPhoneSync( mIsPhoneSync );
+ myClone->setIsPiSync( mIsPiSync );
myClone->setWriteContactToSIM( mWriteContactToSIM );
myClone->setName( "noName" );
//myClone->setIdentifier( "noID" );
@@ -88,6 +98,19 @@ void KSyncProfile::setDefault()
mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
mLocalTempFilePWM = "/tmp/passwords.pwm";
mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
+
+ mRemotePw = "abc";
+ mRemoteIP = "192.168.0.99";
+ mRemotePort = "9197";
+
+ mRemotePwAB = "abc";
+ mRemoteIPAB = "192.168.0.99";
+ mRemotePortAB = "9198";
+
+ mRemotePwPWM = "abc";
+ mRemoteIPPWM = "192.168.0.99";
+ mRemotePortPWM = "9199";
+
mShowSummaryAfterSync = true;
mAskForPreferences = true;
mWriteBackExisting = false;
@@ -101,6 +124,7 @@ void KSyncProfile::setDefault()
mIsLocalFileSync = true;
mName = "noName";
mIsPhoneSync = false;
+ mIsPiSync = false;
mWriteContactToSIM = false;
mPhoneDevice = "/dev/ircomm";
mPhoneConnection = "irda";
@@ -114,6 +138,17 @@ void KSyncProfile::readConfig(KConfig *config )
config->setGroup( mName );
mName = config->readEntry( "Name", mName );
+
+ mRemotePw = config->readEntry( "RemotePw",mRemotePw );
+ mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP );
+ mRemotePort = config->readEntry( "RemotePort", mRemotePort );
+ mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB );
+ mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB );
+ mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB );
+ mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM );
+ mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM );
+ mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM );
+
mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
@@ -146,6 +181,7 @@ void KSyncProfile::readConfig(KConfig *config )
mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
+ mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
}
else
{
@@ -162,6 +198,18 @@ void KSyncProfile::writeConfig( KConfig * config )
{
config->setGroup(mName);
+ config->writeEntry( "RemotePw", mRemotePw);
+ config->writeEntry( "RemoteIP", mRemoteIP);
+ config->writeEntry( "RemotePort", mRemotePort);
+
+ config->writeEntry( "RemotePwAB", mRemotePwAB);
+ config->writeEntry( "RemoteIPAB", mRemoteIPAB);
+ config->writeEntry( "RemotePortAB", mRemotePortAB);
+
+ config->writeEntry( "RemotePwPWM", mRemotePwPWM);
+ config->writeEntry( "RemoteIPPWM", mRemoteIPPWM);
+ config->writeEntry( "RemotePortPWM", mRemotePortPWM);
+
config->writeEntry( "Name", mName );
config->writeEntry( "PreSyncCommand",mPreSyncCommand );
config->writeEntry( "PostSyncCommand", mPostSyncCommand );
@@ -195,5 +243,6 @@ void KSyncProfile::writeConfig( KConfig * config )
config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
config->writeEntry( "IsPhoneSync", mIsPhoneSync );
+ config->writeEntry( "IsPiSync", mIsPiSync );
}
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index a81a9ad..6a68bd7 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -45,6 +45,27 @@ class KSyncProfile : public QObject {
void writeConfig(KConfig *);
void deleteConfig(KConfig *);
+ void setRemotePw( const QString& n ) {mRemotePw = n;}
+ QString getRemotePw( ) { return mRemotePw; }
+ void setRemotePwAB( const QString& n ) {mRemotePwAB = n;}
+ QString getRemotePwAB( ) { return mRemotePwAB; }
+ void setRemotePwPWM( const QString& n ) {mRemotePwPWM = n;}
+ QString getRemotePwPWM( ) { return mRemotePwPWM; }
+
+ void setRemoteIP( const QString& n ) {mRemoteIP = n;}
+ QString getRemoteIP( ) { return mRemoteIP; }
+ void setRemoteIPAB( const QString& n ) {mRemoteIPAB = n;}
+ QString getRemoteIPAB( ) { return mRemoteIPAB; }
+ void setRemoteIPPWM( const QString& n ) {mRemoteIPPWM = n;}
+ QString getRemoteIPPWM( ) { return mRemoteIPPWM; }
+
+ void setRemotePort( const QString& n ) {mRemotePort = n;}
+ QString getRemotePort( ) { return mRemotePort; }
+ void setRemotePortAB( const QString& n ) {mRemotePortAB = n;}
+ QString getRemotePortAB( ) { return mRemotePortAB; }
+ void setRemotePortPWM( const QString& n ) {mRemotePortPWM = n;}
+ QString getRemotePortPWM( ) { return mRemotePortPWM; }
+
void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;}
QString getPreSyncCommand( ) { return mPreSyncCommand; }
void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;}
@@ -111,6 +132,8 @@ class KSyncProfile : public QObject {
bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
bool getIsPhoneSync( ) { return mIsPhoneSync;}
+ void setIsPiSync( bool b ) { mIsPiSync= b;}
+ bool getIsPiSync( ) { return mIsPiSync;}
private:
QString mName;
QString mPreSyncCommand;
@@ -126,6 +149,18 @@ class KSyncProfile : public QObject {
QString mLocalTempFilePWM;
QString mRemoteFileNamePWM;
+ QString mRemotePw;
+ QString mRemoteIP;
+ QString mRemotePort;
+
+ QString mRemotePwAB;
+ QString mRemoteIPAB;
+ QString mRemotePortAB;
+
+ QString mRemotePwPWM;
+ QString mRemoteIPPWM;
+ QString mRemotePortPWM;
+
QString mPhoneDevice;
QString mPhoneConnection;
QString mPhoneModel;
@@ -143,6 +178,8 @@ class KSyncProfile : public QObject {
bool mIsLocalFileSync;
bool mIsPhoneSync;
bool mWriteContactToSIM;
+
+ bool mIsPiSync;
};
#endif