summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp56
-rw-r--r--libkdepim/ksyncmanager.h1
2 files changed, 46 insertions, 11 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index b3e266a..0faa24d 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -610,9 +610,39 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
return;
}
+void KSyncManager::edit_pisync_options()
+{
+ QDialog dia( mParent, "dia", true );
+ dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice );
+ QVBoxLayout lay ( &dia );
+ lay.setSpacing( 5 );
+ lay.setMargin( 3 );
+ QLabel lab1 ( i18n("Password for remote access:"), &dia);
+ lay.addWidget( &lab1 );
+ QLineEdit le1 (&dia );
+ lay.addWidget( &le1 );
+ QLabel lab2 ( i18n("Remote IP address:"), &dia);
+ lay.addWidget( &lab2 );
+ QLineEdit le2 (&dia );
+ lay.addWidget( &le2 );
+ QLabel lab3 ( i18n("Remote port number:"), &dia);
+ lay.addWidget( &lab3 );
+ QLineEdit le3 (&dia );
+ lay.addWidget( &le3 );
+ QPushButton pb ( "OK", &dia);
+ lay.addWidget( &pb );
+ connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
+ le1.setText( mPassWordPiSync );
+ le2.setText( mActiveSyncIP );
+ le3.setText( mActiveSyncPort );
+ if ( dia.exec() ) {
+ mPassWordPiSync = le1.text();
+ mActiveSyncPort = le3.text();
+ mActiveSyncIP = le2.text();
+ }
+}
void KSyncManager::edit_sync_options()
{
- //mDialogManager->showSyncOptions();
- //mSyncAlgoPrefs
+
QDialog dia( mParent, "dia", true );
dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice );
@@ -786,8 +816,9 @@ QString KSyncManager::syncFileName()
}
-
void KSyncManager::syncPi()
{
qApp->processEvents();
+ if ( mAskForPreferences )
+ edit_pisync_options();
bool ok;
Q_UINT16 port = mActiveSyncPort.toUInt(&ok);
@@ -898,5 +929,5 @@ void KServerSocket::readClient()
send_file();
else {
- KMessageBox::information( 0, i18n("ERROR:\nGot send file request\nwith invalid password"));
+ KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"));
qDebug("password %s, invalid password %s ",mPassWord.latin1(), tokens[1].latin1() );
}
@@ -909,5 +940,5 @@ void KServerSocket::readClient()
}
else {
- KMessageBox::information( 0, i18n("ERROR:\nGot receive file request\nwith invalid password"));
+ KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"));
qDebug("password %s, invalid password %s ",mPassWord.latin1(), tokens[1].latin1() );
}
@@ -1156,13 +1187,19 @@ void KCommandSocket::readFileFromSocket()
void KCommandSocket::deleteSocket()
{
+ //qDebug("KCommandSocket::deleteSocket() ");
if ( mTimerSocket->isActive () ) {
mTimerSocket->stop();
mRetVal = errorTO;
+ qDebug("Connection to remote host timed out");
if ( mSocket ) {
mSocket->close();
- if ( mSocket->state() == QSocket::Idle )
- deleteSocket();
- return;
+ //if ( mSocket->state() == QSocket::Idle )
+ // deleteSocket();
+ delete mSocket;
+ mSocket = 0;
}
+ KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host? "));
+ emit commandFinished( this, mRetVal );
+ return;
}
//qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
@@ -1170,7 +1207,4 @@ void KCommandSocket::deleteSocket()
delete mSocket;
mSocket = 0;
- if ( mRetVal == errorTO)
- KMessageBox::information( 0, i18n("ERROR:\nConnection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host? "));
-
emit commandFinished( this, mRetVal );
}
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 1f7c7e7..5b05383 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -174,4 +174,5 @@ class KSyncManager : public QObject
void syncRemote( KSyncProfile* prof, bool ask = true);
void edit_sync_options();
+ void edit_pisync_options();
int ringSync();
QString getPassword( );