author | ulf69 <ulf69> | 2004-10-03 23:29:56 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-03 23:29:56 (UTC) |
commit | aaea91151fe9a747e9eddfb8ba7d5896744faf30 (patch) (unidiff) | |
tree | b2b064757d65bc83427e7a86692601364051b631 /kaddressbook | |
parent | a5c204da5a2dba950fc5ad2c45861dbe56849c09 (diff) | |
download | kdepimpi-aaea91151fe9a747e9eddfb8ba7d5896744faf30.zip kdepimpi-aaea91151fe9a747e9eddfb8ba7d5896744faf30.tar.gz kdepimpi-aaea91151fe9a747e9eddfb8ba7d5896744faf30.tar.bz2 |
moved sync related progressbar management to ksyncmanager, and proceeded with
the sync implementation of pwmanager
-rw-r--r-- | kaddressbook/kabcore.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index f222234..f8359de 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1080,5 +1080,6 @@ void KABCore::save() | |||
1080 | return; | 1080 | return; |
1081 | syncManager->setBlockSave(true); | ||
1082 | if ( !mModified ) | 1081 | if ( !mModified ) |
1083 | return; | 1082 | return; |
1083 | |||
1084 | syncManager->setBlockSave(true); | ||
1084 | QString text = i18n( "There was an error while attempting to save\n the " | 1085 | QString text = i18n( "There was an error while attempting to save\n the " |
@@ -2336,13 +2337,5 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2336 | Addressee inL; | 2337 | Addressee inL; |
2337 | QProgressBar bar( er.count(),0 ); | 2338 | |
2338 | bar.setCaption (i18n("Syncing - close to abort!") ); | 2339 | syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); |
2339 | 2340 | ||
2340 | int w = 300; | ||
2341 | if ( QApplication::desktop()->width() < 320 ) | ||
2342 | w = 220; | ||
2343 | int h = bar.sizeHint().height() ; | ||
2344 | int dw = QApplication::desktop()->width(); | ||
2345 | int dh = QApplication::desktop()->height(); | ||
2346 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
2347 | bar.show(); | ||
2348 | int modulo = (er.count()/10)+1; | 2341 | int modulo = (er.count()/10)+1; |
@@ -2350,6 +2343,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2350 | while ( incCounter < er.count()) { | 2343 | while ( incCounter < er.count()) { |
2351 | if ( ! bar.isVisible() ) | 2344 | if (syncManager->isProgressBarCanceled()) |
2352 | return false; | 2345 | return false; |
2353 | if ( incCounter % modulo == 0 ) | 2346 | if ( incCounter % modulo == 0 ) |
2354 | bar.setProgress( incCounter ); | 2347 | syncManager->showProgressBar(incCounter); |
2348 | |||
2355 | uid = er[ incCounter ]; | 2349 | uid = er[ incCounter ]; |
@@ -2445,5 +2439,4 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2445 | modulo = (el.count()/10)+1; | 2439 | modulo = (el.count()/10)+1; |
2446 | bar.setCaption (i18n("Add / remove addressees") ); | 2440 | |
2447 | bar.setTotalSteps ( el.count() ) ; | 2441 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); |
2448 | bar.show(); | ||
2449 | incCounter = 0; | 2442 | incCounter = 0; |
@@ -2451,6 +2444,6 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2451 | qApp->processEvents(); | 2444 | qApp->processEvents(); |
2452 | if ( ! bar.isVisible() ) | 2445 | if (syncManager->isProgressBarCanceled()) |
2453 | return false; | 2446 | return false; |
2454 | if ( incCounter % modulo == 0 ) | 2447 | if ( incCounter % modulo == 0 ) |
2455 | bar.setProgress( incCounter ); | 2448 | syncManager->showProgressBar(incCounter); |
2456 | uid = el[ incCounter ]; | 2449 | uid = el[ incCounter ]; |
@@ -2501,3 +2494,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2501 | el.clear(); | 2494 | el.clear(); |
2502 | bar.hide(); | 2495 | syncManager->hideProgressBar(); |
2503 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 2496 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |