summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-08 23:55:16 (UTC)
committer zautrix <zautrix>2005-07-08 23:55:16 (UTC)
commit1e11d41ecb6a912c4c0a2747eb1fa26626fdcca2 (patch) (side-by-side diff)
tree922c8080f9b9cc863e7d5637a5d9d775ee8c0355
parent3e94cf2e8a14c7d40aea28a0fe5538abcd211746 (diff)
downloadkdepimpi-1e11d41ecb6a912c4c0a2747eb1fa26626fdcca2.zip
kdepimpi-1e11d41ecb6a912c4c0a2747eb1fa26626fdcca2.tar.gz
kdepimpi-1e11d41ecb6a912c4c0a2747eb1fa26626fdcca2.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt20
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt22
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--libkdepim/ksyncmanager.cpp97
-rw-r--r--libkdepim/ksyncmanager.h6
5 files changed, 125 insertions, 22 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index f64bfda..4a5122f 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -786,6 +786,26 @@
{ "Show!","Anzeigen!" },
{ "Details","Details" },
{ "Search:","Suche:" },
+{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
+{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
+{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
+{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
+{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
+{ "Pi-Sync Error","Pi-Sync Fehler" },
+{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
+{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
+{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
+{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
+{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
+{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
+{ "Receiving file from remote...","Empfange entfernte Datei..." },
+{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
+{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
+{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
+{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
+{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
+{ "Writing back file ...","Schreibe Datei zurück..." },
+{ "Sending back file ...","Sende Datei zurück..." },
{ "","" },
{ "","" },
{ "","" },
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 34e9b7f..ff5e095 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -957,7 +957,6 @@
{ "KDE-Pim sync config","KDE-Pim sync Konfig" },
{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" },
{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" },
-{ "Port number (Default: %1)","Port Nummer (Default: %1)" },
{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
@@ -1506,7 +1505,26 @@
{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" },
{ "Show date","Zeige Datum" },
{ "No problem!","Null Problemo!" },
-{ "","" },
+{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
+{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
+{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
+{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
+{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
+{ "Pi-Sync Error","Pi-Sync Fehler" },
+{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
+{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
+{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
+{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
+{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
+{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
+{ "Receiving file from remote...","Empfange entfernte Datei..." },
+{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
+{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
+{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
+{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
+{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
+{ "Writing back file ...","Schreibe Datei zurück..." },
+{ "Sending back file ...","Sende Datei zurück..." },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 68d1bc6..940ea91 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -448,7 +448,7 @@ void CalendarView::init()
//QBoxLayout * leftFrameLayout;
topLayout->addWidget( mMainFrame );
#ifdef DESKTOP_VERSION
- mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
+ mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this );
topLayout->addWidget( mDateScrollBar );
connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
if ( QApplication::desktop()->width() < 800 )
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index fc0ac6b..f2ee0ab 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -353,7 +353,7 @@ void KSyncManager::enableQuick( bool ask )
lay.setMargin(7);
lay.setSpacing(7);
int po = 9197+mTargetApp;
- QLabel label ( i18n("Port number (Default: %1)").arg(po), &dia );
+ QLabel label ( i18n("Port number (Default: %1)\nValid range from 1 to 65535").arg(po), &dia );
lay.addWidget( &label);
lay.addWidget( &lab);
@@ -415,16 +415,18 @@ void KSyncManager::enableQuick( bool ask )
changed = true;
bool ok;
mPrefs->mPassiveSyncAutoStart = false;
- Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok);
- if ( ! ok ) {
- KMessageBox::information( 0, i18n("No valid port"));
+ Q_UINT32 port_t = mPrefs->mPassiveSyncPort.toUInt(&ok);
+ qDebug("%d ", port_t);
+ if ( ! ok || port_t > 65535 ) {
+ KMessageBox::information( 0, i18n("No valid port number:\n%1").arg ( mPrefs->mPassiveSyncPort ), i18n("Pi-Sync Port Error"));
return;
}
+ Q_UINT16 port = port_t;
//qDebug("port %d ", port);
mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 );
mServerSocket->setFileName( defaultFileName() );//bbb
if ( !mServerSocket->ok() ) {
- KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!"));
+ QTimer::singleShot( 2000, this, SLOT ( displayErrorPort() ) );
delete mServerSocket;
mServerSocket = 0;
return;
@@ -436,7 +438,10 @@ void KSyncManager::enableQuick( bool ask )
connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) );
connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) );
}
-
+void KSyncManager::displayErrorPort()
+{
+ KMessageBox::information( 0, i18n("<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?").arg( mPrefs->mPassiveSyncPort) , i18n("Pi-Sync Port Error"));
+}
void KSyncManager::syncLocalFile()
{
@@ -796,7 +801,7 @@ bool KSyncManager::edit_pisync_options()
lay.addWidget( &lab2 );
QLineEdit le2 (&dia );
lay.addWidget( &le2 );
- QLabel lab3 ( i18n("Remote port number:"), &dia);
+ QLabel lab3 ( i18n("Remote port number:\n(May be: 1 - 65535)"), &dia);
lay.addWidget( &lab3 );
QLineEdit le3 (&dia );
lay.addWidget( &le3 );
@@ -1188,8 +1193,10 @@ void KSyncManager::readFileFromSocket()
}
KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
- if ( mWriteBackFile && syncOK )
+ if ( mWriteBackFile && syncOK ) {
+ mParent->topLevelWidget()->setCaption( i18n("Sending back file ...") );
commandSocket->writeFile( fileName );
+ }
else {
commandSocket->sendStop();
if ( syncOK )
@@ -1292,11 +1299,11 @@ void KServerSocket::readClient()
void KServerSocket::displayErrorMessage()
{
if ( mErrorMessage == 1 ) {
- KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"));
+ KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"), i18n("Pi-Sync Error"));
mErrorMessage = 0;
}
else if ( mErrorMessage == 2 ) {
- KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"));
+ KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"), i18n("Pi-Sync Error"));
mErrorMessage = 0;
}
}
@@ -1466,13 +1473,19 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
tlw = cap;
mRetVal = quiet;
mTimerSocket = new QTimer ( this );
- connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( deleteSocket() ) );
+ connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( updateConnectDialog() ) );
+ mConnectProgress.setCaption( i18n("Pi-Sync") );
+ connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) );
+ mConnectCount = -1;
}
void KCommandSocket::sendFileRequest()
{
if ( tlw )
tlw->setCaption( i18n("Connected! Sending request for remote file ...") );
- mTimerSocket->start( 300000 );
+ mConnectProgress.hide();
+ mConnectCount = 300;mConnectMax = 300;
+ mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") );
+ mTimerSocket->start( 100, true );
QTextStream os( mSocket );
os.setEncoding( QTextStream::Latin1 );
@@ -1493,11 +1506,30 @@ void KCommandSocket::readFile( QString fn )
mFirst = true;
if ( tlw )
tlw->setCaption( i18n("Trying to connect to remote...") );
- mTimerSocket->start( 20000 );
+ mConnectCount = 30;mConnectMax = 30;
+ mTimerSocket->start( 1000, true );
mSocket->connectToHost( mHost, mPort );
qDebug("KSS: Waiting for connection");
}
-
+void KCommandSocket::updateConnectDialog()
+{
+
+ if ( mConnectCount == mConnectMax ) {
+ //qDebug("MAXX %d", mConnectMax);
+ mConnectProgress.setTotalSteps ( 30 );
+ mConnectProgress.show();
+ mConnectProgress.setLabelText( i18n("Trying to connect to remote...") );
+ }
+ //qDebug("updateConnectDialog() %d", mConnectCount);
+ mConnectProgress.raise();
+ mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 );
+ --mConnectCount;
+ if ( mConnectCount > 0 )
+ mTimerSocket->start( 1000, true );
+ else
+ deleteSocket();
+
+}
void KCommandSocket::writeFile( QString fileName )
{
if ( !mSocket ) {
@@ -1506,7 +1538,8 @@ void KCommandSocket::writeFile( QString fileName )
connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) );
}
mFileName = fileName ;
- mTimerSocket->start( 20000 );
+ mConnectCount = 30;mConnectMax = 30;
+ mTimerSocket->start( 1000, true );
mSocket->connectToHost( mHost, mPort );
}
void KCommandSocket::writeFileToSocket()
@@ -1514,26 +1547,41 @@ void KCommandSocket::writeFileToSocket()
mTimerSocket->stop();
QFile file2( mFileName );
if (!file2.open( IO_ReadOnly ) ) {
+ mConnectProgress.hide();
+ mConnectCount = -1;
mRetVal= errorW;
mSocket->close();
if ( mSocket->state() == QSocket::Idle )
QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
return ;
}
+ mConnectProgress.setTotalSteps ( file2.size() );
+ mConnectProgress.show();
+ int count = 0;
+ mConnectProgress.setLabelText( i18n("Sending back synced file...") );
+ mConnectProgress.setProgress( count );
+ mConnectProgress.blockSignals( true );
QTextStream ts2( &file2 );
ts2.setEncoding( QTextStream::Latin1 );
QTextStream os2( mSocket );
os2.setEncoding( QTextStream::Latin1 );
os2 << "PUT " << mPassWord << "\r\n\r\n";;
while ( ! ts2.atEnd() ) {
- os2 << ts2.readLine() << "\r\n";
+ qApp->processEvents();
+ mConnectProgress.setProgress( count );
+ QString temp = ts2.readLine();
+ count += temp.length();
+ os2 << temp << "\r\n";
}
+ file2.close();
+ mConnectProgress.hide();
+ mConnectCount = -1;
os2 << "\r\n";
mRetVal= successW;
- file2.close();
mSocket->close();
if ( mSocket->state() == QSocket::Idle )
QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
+ mConnectProgress.blockSignals( false );
}
void KCommandSocket::sendStop()
{
@@ -1554,8 +1602,8 @@ void KCommandSocket::startReadFileFromSocket()
{
if ( ! mFirst )
return;
+ mConnectProgress.setLabelText( i18n("Receiving file from remote...") );
mFirst = false;
- mTimerSocket->stop();
mFileString = "";
mTime.start();
mFirstLine = true;
@@ -1571,6 +1619,8 @@ void KCommandSocket::readFileFromSocket()
if ( mFirstLine ) {
mFirstLine = false;
if ( line.left( 6 ) == "ERROR_" ) {
+ mTimerSocket->stop();
+ mConnectCount = -1;
if ( line.left( 8 ) == "ERROR_PW" ) {
mRetVal = errorPW;
deleteSocket();
@@ -1605,6 +1655,9 @@ void KCommandSocket::readFileFromSocket()
QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) ));
return;
}
+ mTimerSocket->stop();
+ mConnectCount = -1;
+ mConnectProgress.hide();
QString fileName = mFileName;
QFile file ( fileName );
if (!file.open( IO_WriteOnly ) ) {
@@ -1632,7 +1685,9 @@ void KCommandSocket::readFileFromSocket()
void KCommandSocket::deleteSocket()
{
//qDebug("KCommandSocket::deleteSocket() ");
- if ( mTimerSocket->isActive () ) {
+ mConnectProgress.hide();
+
+ if ( mConnectCount >= 0 ) {
mTimerSocket->stop();
mRetVal = errorTO;
qDebug("KCS::Connection to remote host timed out");
@@ -1643,7 +1698,10 @@ void KCommandSocket::deleteSocket()
delete mSocket;
mSocket = 0;
}
+ if ( mConnectCount == 0 )
KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?"));
+ else if ( tlw )
+ tlw->setCaption( i18n("Connection to remote host cancelled!") );
emit commandFinished( this, mRetVal );
return;
}
@@ -1651,5 +1709,6 @@ void KCommandSocket::deleteSocket()
if ( mSocket)
delete mSocket;
mSocket = 0;
+ qDebug("commandFinished ");
emit commandFinished( this, mRetVal );
}
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 30ec1e6..e6738b6 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -29,6 +29,7 @@
#include <qserversocket.h>
#include <qtextstream.h>
#include <qregexp.h>
+#include <qprogressdialog.h>
class QPopupMenu;
class KSyncProfile;
@@ -86,6 +87,7 @@ class KCommandSocket : public QObject
private slots :
void sendFileRequest();
+ void updateConnectDialog();
signals:
void commandFinished( KCommandSocket*, int );
@@ -95,6 +97,9 @@ class KCommandSocket : public QObject
void deleteSocket();
void writeFileToSocket();
private :
+ int mConnectCount;
+ int mConnectMax;
+ QProgressDialog mConnectProgress;
QWidget* tlw;
QSocket* mSocket;
QString mPassWord;
@@ -205,6 +210,7 @@ class KSyncManager : public QObject
bool mSyncWithDesktop;
private slots:
+ void displayErrorPort();
void confSync();