-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 36b101c..1748e8d 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -7,8 +7,9 @@ | |||
7 | #include <opie2/ostorageinfo.h> | 7 | #include <opie2/ostorageinfo.h> |
8 | using namespace Opie::Core; | 8 | using namespace Opie::Core; |
9 | 9 | ||
10 | #include <opie2/ofiledialog.h> | 10 | #include <opie2/ofiledialog.h> |
11 | #include <opie2/owait.h> | ||
11 | using namespace Opie::Ui; | 12 | using namespace Opie::Ui; |
12 | 13 | ||
13 | #include <qpe/qpeapplication.h> | 14 | #include <qpe/qpeapplication.h> |
14 | #include <qpe/resource.h> | 15 | #include <qpe/resource.h> |
@@ -250,9 +251,13 @@ void BackupAndRestore::backup() | |||
250 | "No items selected.",QString("Ok") ); | 251 | "No items selected.",QString("Ok") ); |
251 | return; | 252 | return; |
252 | } | 253 | } |
253 | 254 | ||
254 | setCaption(tr("Backup and Restore... working...")); | 255 | OWait *owait = new OWait(); |
256 | Global::statusMessage( tr( "Backing up..." ) ); | ||
257 | owait->show(); | ||
258 | qApp->processEvents(); | ||
259 | |||
255 | QString outputFile = backupLocations[storeToLocation->currentText()]; | 260 | QString outputFile = backupLocations[storeToLocation->currentText()]; |
256 | 261 | ||
257 | QDateTime datetime = QDateTime::currentDateTime(); | 262 | QDateTime datetime = QDateTime::currentDateTime(); |
258 | QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + | 263 | QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + |
@@ -283,8 +288,12 @@ void BackupAndRestore::backup() | |||
283 | odebug << commandLine << oendl; | 288 | odebug << commandLine << oendl; |
284 | 289 | ||
285 | int r = system( commandLine ); | 290 | int r = system( commandLine ); |
286 | 291 | ||
292 | owait->hide(); | ||
293 | delete owait; | ||
294 | |||
295 | //Error-Handling | ||
287 | if(r != 0) | 296 | if(r != 0) |
288 | { | 297 | { |
289 | perror("Error: "); | 298 | perror("Error: "); |
290 | QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); | 299 | QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); |
@@ -433,9 +442,13 @@ void BackupAndRestore::restore() | |||
433 | QMessageBox::critical(this, tr( "Message" ), | 442 | QMessageBox::critical(this, tr( "Message" ), |
434 | tr( "Please select something to restore." ),QString( tr( "Ok") ) ); | 443 | tr( "Please select something to restore." ),QString( tr( "Ok") ) ); |
435 | return; | 444 | return; |
436 | } | 445 | } |
437 | setCaption(tr("Backup and Restore... working...")); | 446 | |
447 | OWait *owait = new OWait(); | ||
448 | Global::statusMessage( tr( "Restore Backup..." ) ); | ||
449 | owait->show(); | ||
450 | qApp->processEvents(); | ||
438 | 451 | ||
439 | QString restoreFile = backupLocations[restoreSource->currentText()]; | 452 | QString restoreFile = backupLocations[restoreSource->currentText()]; |
440 | 453 | ||
441 | restoreFile += "/" + restoreItem->text(0); | 454 | restoreFile += "/" + restoreItem->text(0); |
@@ -466,8 +479,11 @@ void BackupAndRestore::restore() | |||
466 | odebug << commandLine << oendl; | 479 | odebug << commandLine << oendl; |
467 | 480 | ||
468 | r = system( commandLine ); | 481 | r = system( commandLine ); |
469 | 482 | ||
483 | owait->hide(); | ||
484 | delete owait; | ||
485 | |||
470 | //error handling | 486 | //error handling |
471 | if(r != 0) | 487 | if(r != 0) |
472 | { | 488 | { |
473 | QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); | 489 | QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); |