-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 ) | |||
350 | autostart.setChecked( mPrefs->mPassiveSyncAutoStart ); | 350 | autostart.setChecked( mPrefs->mPassiveSyncAutoStart ); |
351 | #ifdef DESKTOP_VERSION | 351 | #ifdef DESKTOP_VERSION |
352 | #ifdef _WIN32_ | 352 | #ifdef _WIN32_ |
353 | QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia ); | 353 | QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia ); |
354 | syncdesktop.hide();// not implemented! | ||
354 | #else | 355 | #else |
355 | QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia ); | 356 | QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia ); |
356 | #endif | 357 | #endif |
357 | lay.addWidget( &syncdesktop); | 358 | lay.addWidget( &syncdesktop); |
@@ -572,15 +573,17 @@ int KSyncManager::ringSync() | |||
572 | ++syncedProfiles; | 573 | ++syncedProfiles; |
573 | // mAskForPreferences = temp->getAskForPreferences(); | 574 | // mAskForPreferences = temp->getAskForPreferences(); |
574 | mWriteBackFile = temp->getWriteBackFile(); | 575 | mWriteBackFile = temp->getWriteBackFile(); |
575 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 576 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
577 | mIsKapiFile = temp->getIsKapiFile(); | ||
576 | mWriteBackInFuture = 0; | 578 | mWriteBackInFuture = 0; |
577 | if ( temp->getWriteBackFuture() ) | 579 | if ( temp->getWriteBackFuture() ) |
578 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 580 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
579 | mShowSyncSummary = false; | 581 | mShowSyncSummary = false; |
580 | mCurrentSyncDevice = syncProfileNames[i] ; | 582 | mCurrentSyncDevice = syncProfileNames[i] ; |
581 | mCurrentSyncName = mLocalMachineName; | 583 | mCurrentSyncName = mLocalMachineName; |
582 | if ( i == 0 ) { | 584 | if ( i == 0 ) { |
585 | mIsKapiFile = false; | ||
583 | #ifdef DESKTOP_VERSION | 586 | #ifdef DESKTOP_VERSION |
584 | syncKDE(); | 587 | syncKDE(); |
585 | #else | 588 | #else |
586 | syncSharp(); | 589 | syncSharp(); |
@@ -1020,8 +1023,9 @@ QString KSyncManager::syncFileName() | |||
1020 | } | 1023 | } |
1021 | 1024 | ||
1022 | void KSyncManager::syncPi() | 1025 | void KSyncManager::syncPi() |
1023 | { | 1026 | { |
1027 | mIsKapiFile = true; | ||
1024 | mPisyncFinished = false; | 1028 | mPisyncFinished = false; |
1025 | qApp->processEvents(); | 1029 | qApp->processEvents(); |
1026 | if ( mAskForPreferences ) | 1030 | if ( mAskForPreferences ) |
1027 | if ( !edit_pisync_options()) { | 1031 | if ( !edit_pisync_options()) { |
@@ -1137,10 +1141,11 @@ void KServerSocket::readClient() | |||
1137 | if ( tokens[1] == mPassWord ) { | 1141 | if ( tokens[1] == mPassWord ) { |
1138 | //emit sendFile( mSocket ); | 1142 | //emit sendFile( mSocket ); |
1139 | bool ok = false; | 1143 | bool ok = false; |
1140 | QDateTime dt = KGlobal::locale()->readDateTime( tokens[2], KLocale::ISODate, &ok); | 1144 | QDateTime dt = KGlobal::locale()->readDateTime( tokens[2], KLocale::ISODate, &ok); |
1141 | if ( ok ) | 1145 | if ( ok ) { |
1142 | KSyncManager::mRequestedSyncEvent = dt; | 1146 | KSyncManager::mRequestedSyncEvent = dt; |
1147 | } | ||
1143 | else | 1148 | else |
1144 | KSyncManager::mRequestedSyncEvent = QDateTime(); | 1149 | KSyncManager::mRequestedSyncEvent = QDateTime(); |
1145 | send_file(); | 1150 | send_file(); |
1146 | } | 1151 | } |
@@ -1182,9 +1187,29 @@ void KServerSocket::send_file() | |||
1182 | QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); | 1187 | QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); |
1183 | lay->addWidget( label); | 1188 | lay->addWidget( label); |
1184 | lay->setMargin(7); | 1189 | lay->setMargin(7); |
1185 | lay->setSpacing(7); | 1190 | lay->setSpacing(7); |
1186 | mSyncActionDialog->setFixedSize( 230, 120); | 1191 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
1192 | int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent ); | ||
1193 | //if ( secs > 30 ) | ||
1194 | if ( true ) | ||
1195 | { | ||
1196 | QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs ); | ||
1197 | QLabel* label = new QLabel( warning, mSyncActionDialog ); | ||
1198 | if ( secs > 600 ) | ||
1199 | { | ||
1200 | QFont f = label->font(); | ||
1201 | f. setBold (true ); | ||
1202 | f.setPointSize ( f.pointSize() + 10); | ||
1203 | label->setFont( f ); | ||
1204 | } | ||
1205 | lay->addWidget( label); | ||
1206 | mSyncActionDialog->setFixedSize( 230, 200); | ||
1207 | } else { | ||
1208 | mSyncActionDialog->setFixedSize( 230, 120); | ||
1209 | } | ||
1210 | } else | ||
1211 | mSyncActionDialog->setFixedSize( 230, 120); | ||
1187 | mSyncActionDialog->show(); | 1212 | mSyncActionDialog->show(); |
1188 | mSyncActionDialog->raise(); | 1213 | mSyncActionDialog->raise(); |
1189 | emit request_file(); | 1214 | emit request_file(); |
1190 | qApp->processEvents(); | 1215 | qApp->processEvents(); |
@@ -1297,9 +1322,9 @@ void KCommandSocket::readFile( QString fn ) | |||
1297 | mSocket->connectToHost( mHost, mPort ); | 1322 | mSocket->connectToHost( mHost, mPort ); |
1298 | QTextStream os( mSocket ); | 1323 | QTextStream os( mSocket ); |
1299 | os.setEncoding( QTextStream::Latin1 ); | 1324 | os.setEncoding( QTextStream::Latin1 ); |
1300 | 1325 | ||
1301 | QString curDt = KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); | 1326 | QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); |
1302 | os << "GET " << mPassWord << curDt <<"\r\n"; | 1327 | os << "GET " << mPassWord << curDt <<"\r\n"; |
1303 | mTimerSocket->start( 20000 ); | 1328 | mTimerSocket->start( 20000 ); |
1304 | } | 1329 | } |
1305 | 1330 | ||