summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
authorzautrix <zautrix>2004-10-21 22:20:39 (UTC)
committer zautrix <zautrix>2004-10-21 22:20:39 (UTC)
commitd6f9bd535e8cabe653bdff329500f9153e5e11fb (patch) (unidiff)
tree6f83c692713c41896a165e399f259a744f125e5c /kaddressbook/kabcore.cpp
parentbb235c5a639b914574e1e247d2de6e479517585f (diff)
downloadkdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.zip
kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.gz
kdepimpi-d6f9bd535e8cabe653bdff329500f9153e5e11fb.tar.bz2
small fixes
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1074a62..c4382d6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -367,48 +367,50 @@ void KABCore::toggleBeamReceive( )
367} 367}
368 368
369 369
370void KABCore::disableBR(bool b) 370void KABCore::disableBR(bool b)
371{ 371{
372#ifndef DESKTOP_VERSION 372#ifndef DESKTOP_VERSION
373 if ( b ) { 373 if ( b ) {
374 if ( infrared ) { 374 if ( infrared ) {
375 toggleBeamReceive( ); 375 toggleBeamReceive( );
376 } 376 }
377 mBRdisabled = true; 377 mBRdisabled = true;
378 } else { 378 } else {
379 if ( mBRdisabled ) { 379 if ( mBRdisabled ) {
380 mBRdisabled = false; 380 mBRdisabled = false;
381 //toggleBeamReceive( ); 381 //toggleBeamReceive( );
382 } 382 }
383 } 383 }
384#endif 384#endif
385 385
386} 386}
387void KABCore::recieve( QString fn ) 387void KABCore::recieve( QString fn )
388{ 388{
389 //qDebug("KABCore::recieve "); 389 //qDebug("KABCore::recieve ");
390 int count = mAddressBook->importFromFile( fn, true ); 390 int count = mAddressBook->importFromFile( fn, true );
391 if ( count )
392 setModified( true );
391 mViewManager->refreshView(); 393 mViewManager->refreshView();
392 message(i18n("%1 contact(s) received!").arg( count )); 394 message(i18n("%1 contact(s) received!").arg( count ));
393 topLevelWidget()->showMaximized(); 395 topLevelWidget()->showMaximized();
394 topLevelWidget()->raise(); 396 topLevelWidget()->raise();
395} 397}
396void KABCore::restoreSettings() 398void KABCore::restoreSettings()
397{ 399{
398 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 400 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
399 401
400 bool state; 402 bool state;
401 403
402 if (mMultipleViewsAtOnce) 404 if (mMultipleViewsAtOnce)
403 state = KABPrefs::instance()->mDetailsPageVisible; 405 state = KABPrefs::instance()->mDetailsPageVisible;
404 else 406 else
405 state = false; 407 state = false;
406 408
407 mActionDetails->setChecked( state ); 409 mActionDetails->setChecked( state );
408 setDetailsVisible( state ); 410 setDetailsVisible( state );
409 411
410 state = KABPrefs::instance()->mJumpButtonBarVisible; 412 state = KABPrefs::instance()->mJumpButtonBarVisible;
411 413
412 mActionJumpBar->setChecked( state ); 414 mActionJumpBar->setChecked( state );
413 setJumpButtonBarVisible( state ); 415 setJumpButtonBarVisible( state );
414/*US 416/*US
@@ -2858,46 +2860,48 @@ bool KABCore::syncPhone()
2858 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 2860 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
2859 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 2861 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
2860 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 2862 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
2861 if ( syncOK ) { 2863 if ( syncOK ) {
2862 if ( syncManager->mWriteBackFile ) { 2864 if ( syncManager->mWriteBackFile ) {
2863 abLocal.removeSyncAddressees( true ); 2865 abLocal.removeSyncAddressees( true );
2864 abLocal.saveABphone( fileName ); 2866 abLocal.saveABphone( fileName );
2865 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 2867 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
2866 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 2868 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
2867 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); 2869 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
2868 } 2870 }
2869 } 2871 }
2870 setModified(); 2872 setModified();
2871 } 2873 }
2872 if ( syncOK ) 2874 if ( syncOK )
2873 mViewManager->refreshView(); 2875 mViewManager->refreshView();
2874 return syncOK; 2876 return syncOK;
2875} 2877}
2876void KABCore::getFile( bool success ) 2878void KABCore::getFile( bool success )
2877{ 2879{
2878 if ( ! success ) { 2880 if ( ! success ) {
2879 message( i18n("Error receiving file. Nothing changed!") ); 2881 message( i18n("Error receiving file. Nothing changed!") );
2880 return; 2882 return;
2881 } 2883 }
2882 mAddressBook->importFromFile( sentSyncFile() , false, true ); 2884 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
2885 if ( count )
2886 setModified( true );
2883 message( i18n("Pi-Sync successful!") ); 2887 message( i18n("Pi-Sync successful!") );
2884 mViewManager->refreshView(); 2888 mViewManager->refreshView();
2885} 2889}
2886void KABCore::syncFileRequest() 2890void KABCore::syncFileRequest()
2887{ 2891{
2888 mAddressBook->export2File( sentSyncFile() ); 2892 mAddressBook->export2File( sentSyncFile() );
2889} 2893}
2890QString KABCore::sentSyncFile() 2894QString KABCore::sentSyncFile()
2891{ 2895{
2892#ifdef DESKTOP_VERSION 2896#ifdef DESKTOP_VERSION
2893 return locateLocal( "tmp", "copysyncab.vcf" ); 2897 return locateLocal( "tmp", "copysyncab.vcf" );
2894#else 2898#else
2895 return QString( "/tmp/copysyncab.vcf" ); 2899 return QString( "/tmp/copysyncab.vcf" );
2896#endif 2900#endif
2897} 2901}
2898 2902
2899void KABCore::setCaptionBack() 2903void KABCore::setCaptionBack()
2900{ 2904{
2901 mMessageTimer->stop(); 2905 mMessageTimer->stop();
2902 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 2906 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
2903} 2907}