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
@@ -788,2 +788,22 @@
{ "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
@@ -959,3 +959,2 @@
{ "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:" },
@@ -1508,3 +1507,22 @@
{ "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
@@ -450,3 +450,3 @@ void CalendarView::init()
#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 );
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index fc0ac6b..f2ee0ab 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -355,3 +355,3 @@ void KSyncManager::enableQuick( bool ask )
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);
@@ -417,7 +417,9 @@ void KSyncManager::enableQuick( bool ask )
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);
@@ -426,3 +428,3 @@ void KSyncManager::enableQuick( bool ask )
if ( !mServerSocket->ok() ) {
- KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!"));
+ QTimer::singleShot( 2000, this, SLOT ( displayErrorPort() ) );
delete mServerSocket;
@@ -438,3 +440,6 @@ void KSyncManager::enableQuick( bool ask )
}
-
+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()
@@ -798,3 +803,3 @@ bool KSyncManager::edit_pisync_options()
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 );
@@ -1190,4 +1195,6 @@ void KSyncManager::readFileFromSocket()
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 {
@@ -1294,3 +1301,3 @@ 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;
@@ -1298,3 +1305,3 @@ void KServerSocket::displayErrorMessage()
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;
@@ -1468,3 +1475,6 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
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;
}
@@ -1474,3 +1484,6 @@ void KCommandSocket::sendFileRequest()
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 );
@@ -1495,3 +1508,4 @@ void KCommandSocket::readFile( QString fn )
tlw->setCaption( i18n("Trying to connect to remote...") );
- mTimerSocket->start( 20000 );
+ mConnectCount = 30;mConnectMax = 30;
+ mTimerSocket->start( 1000, true );
mSocket->connectToHost( mHost, mPort );
@@ -1499,3 +1513,21 @@ void KCommandSocket::readFile( QString fn )
}
-
+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 )
@@ -1508,3 +1540,4 @@ void KCommandSocket::writeFile( QString fileName )
mFileName = fileName ;
- mTimerSocket->start( 20000 );
+ mConnectCount = 30;mConnectMax = 30;
+ mTimerSocket->start( 1000, true );
mSocket->connectToHost( mHost, mPort );
@@ -1516,2 +1549,4 @@ void KCommandSocket::writeFileToSocket()
if (!file2.open( IO_ReadOnly ) ) {
+ mConnectProgress.hide();
+ mConnectCount = -1;
mRetVal= errorW;
@@ -1522,2 +1557,8 @@ void KCommandSocket::writeFileToSocket()
}
+ 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 );
@@ -1528,7 +1569,13 @@ void KCommandSocket::writeFileToSocket()
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();
@@ -1536,2 +1583,3 @@ void KCommandSocket::writeFileToSocket()
QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
+ mConnectProgress.blockSignals( false );
}
@@ -1556,4 +1604,4 @@ void KCommandSocket::startReadFileFromSocket()
return;
+ mConnectProgress.setLabelText( i18n("Receiving file from remote...") );
mFirst = false;
- mTimerSocket->stop();
mFileString = "";
@@ -1573,2 +1621,4 @@ void KCommandSocket::readFileFromSocket()
if ( line.left( 6 ) == "ERROR_" ) {
+ mTimerSocket->stop();
+ mConnectCount = -1;
if ( line.left( 8 ) == "ERROR_PW" ) {
@@ -1607,2 +1657,5 @@ void KCommandSocket::readFileFromSocket()
}
+ mTimerSocket->stop();
+ mConnectCount = -1;
+ mConnectProgress.hide();
QString fileName = mFileName;
@@ -1634,3 +1687,5 @@ void KCommandSocket::deleteSocket()
//qDebug("KCommandSocket::deleteSocket() ");
- if ( mTimerSocket->isActive () ) {
+ mConnectProgress.hide();
+
+ if ( mConnectCount >= 0 ) {
mTimerSocket->stop();
@@ -1645,3 +1700,6 @@ void KCommandSocket::deleteSocket()
}
+ 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 );
@@ -1653,2 +1711,3 @@ void KCommandSocket::deleteSocket()
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
@@ -31,2 +31,3 @@
#include <qregexp.h>
+#include <qprogressdialog.h>
@@ -88,2 +89,3 @@ class KCommandSocket : public QObject
void sendFileRequest();
+ void updateConnectDialog();
@@ -97,2 +99,5 @@ class KCommandSocket : public QObject
private :
+ int mConnectCount;
+ int mConnectMax;
+ QProgressDialog mConnectProgress;
QWidget* tlw;
@@ -207,2 +212,3 @@ class KSyncManager : public QObject
private slots:
+ void displayErrorPort();
void confSync();