summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h2
2 files changed, 28 insertions, 7 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d393660..42e147f 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1374,8 +1374,8 @@ void KABCore::save()
1374 QString text = i18n( "There was an error while attempting to save\n the " 1374 QString text = i18n( "There was an error while attempting to save\n the "
1375 "address book. Please check that some \nother application is " 1375 "address book. Please check that some \nother application is "
1376 "not using it. " ); 1376 "not using it. " );
1377 message(i18n("Saving ... please wait! ")); 1377 message(i18n("Saving ... please wait! "), false);
1378 qApp->processEvents(); 1378 //qApp->processEvents();
1379#ifndef KAB_EMBEDDED 1379#ifndef KAB_EMBEDDED
1380 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 1380 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
1381 if ( !b || !b->save() ) { 1381 if ( !b || !b->save() ) {
@@ -2297,11 +2297,15 @@ void KABCore::manageCategories( )
2297 return; 2297 return;
2298 } 2298 }
2299 int count = 0; 2299 int count = 0;
2300 int cc = 0;
2300 message( i18n("Please wait, processing categories...")); 2301 message( i18n("Please wait, processing categories..."));
2301 if ( cp->addCat() ) { 2302 if ( cp->addCat() ) {
2302 KABC::AddressBook::Iterator it; 2303 KABC::AddressBook::Iterator it;
2303 QStringList catList = KABPrefs::instance()->mCustomCategories; 2304 QStringList catList = KABPrefs::instance()->mCustomCategories;
2304 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2305 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2306 ++cc;
2307 if ( cc %10 == 0)
2308 message(i18n("Processing contact #%1").arg(cc));
2305 QStringList catIncList = (*it).categories(); 2309 QStringList catIncList = (*it).categories();
2306 int i; 2310 int i;
2307 for( i = 0; i< catIncList.count(); ++i ) { 2311 for( i = 0; i< catIncList.count(); ++i ) {
@@ -2322,6 +2326,9 @@ void KABCore::manageCategories( )
2322 QStringList newCatList; 2326 QStringList newCatList;
2323 KABC::AddressBook::Iterator it; 2327 KABC::AddressBook::Iterator it;
2324 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2328 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2329 ++cc;
2330 if ( cc %10 == 0)
2331 message(i18n("Processing contact #%1").arg(cc));
2325 QStringList catIncList = (*it).categories(); 2332 QStringList catIncList = (*it).categories();
2326 int i; 2333 int i;
2327 if ( catIncList.count() ) { 2334 if ( catIncList.count() ) {
@@ -2374,7 +2381,9 @@ void KABCore::setFormattedName()
2374 KABC::AddressBook::Iterator it; 2381 KABC::AddressBook::Iterator it;
2375 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2382 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2376 if ( (*it).tagged() ) { 2383 if ( (*it).tagged() ) {
2377 message(i18n("Changing contact #%1").arg( ++count ) ); 2384 ++count;
2385 if ( count %10 == 0 )
2386 message(i18n("Changing contact #%1").arg( count ) );
2378 qApp->processEvents(); 2387 qApp->processEvents();
2379 QString fName; 2388 QString fName;
2380 if ( setpref.simple->isChecked() ) 2389 if ( setpref.simple->isChecked() )
@@ -2392,6 +2401,7 @@ void KABCore::setFormattedName()
2392 } 2401 }
2393 } 2402 }
2394 message(i18n("Refreshing view...") ); 2403 message(i18n("Refreshing view...") );
2404 qApp->processEvents();
2395 mViewManager->refreshView( "" ); 2405 mViewManager->refreshView( "" );
2396 Addressee add; 2406 Addressee add;
2397 mDetails->setAddressee( add ); 2407 mDetails->setAddressee( add );
@@ -3189,15 +3199,20 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3189 3199
3190 AddressBook abLocal( resource,"syncContact"); 3200 AddressBook abLocal( resource,"syncContact");
3191 bool syncOK = false; 3201 bool syncOK = false;
3202 message(i18n("Loading DTM address data..."), false);
3192 if ( abLocal.load() ) { 3203 if ( abLocal.load() ) {
3193 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3204 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3194 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3205 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3206 message(i18n("Sync preprocessing..."),false);
3195 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3207 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3208 message(i18n("Synchronizing..."),false);
3196 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3209 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3197 if ( syncOK ) { 3210 if ( syncOK ) {
3198 if ( syncManager->mWriteBackFile ) { 3211 if ( syncManager->mWriteBackFile ) {
3199 abLocal.removeSyncAddressees( false ); 3212 abLocal.removeSyncAddressees( false );
3213 message(i18n("Saving DTM address data..."),false);
3200 abLocal.saveAB(); 3214 abLocal.saveAB();
3215 message(i18n("Sync postprocessing..."),false);
3201 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3216 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3202 } 3217 }
3203 } else 3218 } else
@@ -3205,16 +3220,22 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3205 setModified(); 3220 setModified();
3206 } 3221 }
3207 abLocal.removeResources(); 3222 abLocal.removeResources();
3208 if ( syncOK ) 3223 if ( syncOK ) {
3209 mViewManager->refreshView(); 3224 mViewManager->refreshView();
3225 message(i18n("DTM syncing finished."));
3226 }
3210 disableBR( false ); 3227 disableBR( false );
3211 return syncOK; 3228 return syncOK;
3212 3229
3213} 3230}
3214void KABCore::message( QString m ) 3231void KABCore::message( QString m, bool startTimer)
3215{ 3232{
3216 topLevelWidget()->setCaption( m ); 3233 topLevelWidget()->setCaption( m );
3217 mMessageTimer->start( 20000, true ); 3234 qApp->processEvents();
3235 if ( startTimer )
3236 mMessageTimer->start( 15000, true );
3237 else
3238 mMessageTimer->stop();
3218} 3239}
3219bool KABCore::syncPhone() 3240bool KABCore::syncPhone()
3220{ 3241{
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index ecfe6e9..786549a 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -500,7 +500,7 @@ class KABCore : public QWidget, public KSyncInterface
500 virtual bool syncExternal(KSyncManager* manager, QString resource); 500 virtual bool syncExternal(KSyncManager* manager, QString resource);
501 virtual void removeSyncInfo( QString syncProfile); 501 virtual void removeSyncInfo( QString syncProfile);
502 bool syncPhone(); 502 bool syncPhone();
503 void message( QString m ); 503 void message( QString m , bool startTimer = true);
504 504
505 // LR ******************************* 505 // LR *******************************
506 // sync stuff! 506 // sync stuff!