-rw-r--r-- | libkdepim/ksyncmanager.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 9857e3e..9a1f2a9 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -350,8 +350,9 @@ void KSyncManager::enableQuick( bool ask ) autostart.setChecked( mPrefs->mPassiveSyncAutoStart ); #ifdef DESKTOP_VERSION #ifdef _WIN32_ QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia ); + syncdesktop.hide();// not implemented! #else QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia ); #endif lay.addWidget( &syncdesktop); @@ -572,15 +573,17 @@ int KSyncManager::ringSync() ++syncedProfiles; // mAskForPreferences = temp->getAskForPreferences(); mWriteBackFile = temp->getWriteBackFile(); mWriteBackExistingOnly = temp->getWriteBackExisting(); + mIsKapiFile = temp->getIsKapiFile(); mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); mShowSyncSummary = false; mCurrentSyncDevice = syncProfileNames[i] ; mCurrentSyncName = mLocalMachineName; if ( i == 0 ) { + mIsKapiFile = false; #ifdef DESKTOP_VERSION syncKDE(); #else syncSharp(); @@ -1020,8 +1023,9 @@ QString KSyncManager::syncFileName() } void KSyncManager::syncPi() { + mIsKapiFile = true; mPisyncFinished = false; qApp->processEvents(); if ( mAskForPreferences ) if ( !edit_pisync_options()) { @@ -1137,10 +1141,11 @@ void KServerSocket::readClient() if ( tokens[1] == mPassWord ) { //emit sendFile( mSocket ); bool ok = false; QDateTime dt = KGlobal::locale()->readDateTime( tokens[2], KLocale::ISODate, &ok); - if ( ok ) + if ( ok ) { KSyncManager::mRequestedSyncEvent = dt; + } else KSyncManager::mRequestedSyncEvent = QDateTime(); send_file(); } @@ -1182,9 +1187,29 @@ void KServerSocket::send_file() QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); lay->addWidget( label); lay->setMargin(7); lay->setSpacing(7); - mSyncActionDialog->setFixedSize( 230, 120); + if ( KSyncManager::mRequestedSyncEvent.isValid() ) { + int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent ); + //if ( secs > 30 ) + if ( true ) + { + QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs ); + QLabel* label = new QLabel( warning, mSyncActionDialog ); + if ( secs > 600 ) + { + QFont f = label->font(); + f. setBold (true ); + f.setPointSize ( f.pointSize() + 10); + label->setFont( f ); + } + lay->addWidget( label); + mSyncActionDialog->setFixedSize( 230, 200); + } else { + mSyncActionDialog->setFixedSize( 230, 120); + } + } else + mSyncActionDialog->setFixedSize( 230, 120); mSyncActionDialog->show(); mSyncActionDialog->raise(); emit request_file(); qApp->processEvents(); @@ -1297,9 +1322,9 @@ void KCommandSocket::readFile( QString fn ) mSocket->connectToHost( mHost, mPort ); QTextStream os( mSocket ); os.setEncoding( QTextStream::Latin1 ); - QString curDt = KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); + QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); os << "GET " << mPassWord << curDt <<"\r\n"; mTimerSocket->start( 20000 ); } |