summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index db815d6..038e032 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -500,56 +500,58 @@ bool KSyncManager::syncWithFile( QString fn , bool quick )
500 if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) 500 if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) )
501 mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); 501 mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") );
502 else 502 else
503 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 503 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
504 if ( ! quick ) 504 if ( ! quick )
505 mPrefs->mLastSyncedLocalFile = fn; 505 mPrefs->mLastSyncedLocalFile = fn;
506 } 506 }
507 return ret; 507 return ret;
508} 508}
509 509
510void KSyncManager::quickSyncLocalFile() 510void KSyncManager::quickSyncLocalFile()
511{ 511{
512 512
513 if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { 513 if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) {
514 qDebug("KSM::quick syncLocalFile() successful "); 514 qDebug("KSM::quick syncLocalFile() successful ");
515 515
516 } 516 }
517} 517}
518 518
519void KSyncManager::multiSync( bool askforPrefs ) 519void KSyncManager::multiSync( bool askforPrefs )
520{ 520{
521 if (blockSave()) 521 if (blockSave())
522 return; 522 return;
523 setBlockSave(true); 523 setBlockSave(true);
524 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 524 if ( askforPrefs ) {
525 if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), 525 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
526 question, 526 if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"),
527 i18n("Yes"), i18n("No"), 527 question,
528 0, 0 ) != 0 ) { 528 i18n("Yes"), i18n("No"),
529 setBlockSave(false); 529 0, 0 ) != 0 ) {
530 mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); 530 setBlockSave(false);
531 return; 531 mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!"));
532 return;
533 }
532 } 534 }
533 mCurrentSyncDevice = i18n("Multiple profiles") ; 535 mCurrentSyncDevice = i18n("Multiple profiles") ;
534 mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; 536 mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs;
535 if ( askforPrefs ) { 537 if ( askforPrefs ) {
536 if ( !edit_sync_options()) { 538 if ( !edit_sync_options()) {
537 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); 539 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") );
538 return; 540 return;
539 } 541 }
540 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; 542 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs;
541 } 543 }
542 mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); 544 mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") );
543 qApp->processEvents(); 545 qApp->processEvents();
544 int num = ringSync() ; 546 int num = ringSync() ;
545 if ( num > 1 ) 547 if ( num > 1 )
546 ringSync(); 548 ringSync();
547 setBlockSave(false); 549 setBlockSave(false);
548 if ( num ) 550 if ( num )
549 emit save(); 551 emit save();
550 if ( num ) 552 if ( num )
551 mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); 553 mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) );
552 else 554 else
553 mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); 555 mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
554 return; 556 return;
555} 557}