summaryrefslogtreecommitdiff
path: root/noncore/settings/backup/backuprestore.cpp
authorar <ar>2004-10-20 22:13:02 (UTC)
committer ar <ar>2004-10-20 22:13:02 (UTC)
commit24b27cb83dfc2a23c26e6edcda84fe26a9e9d685 (patch) (side-by-side diff)
tree74a0f718dc4199051c4e485d2d6c214a98ac6af6 /noncore/settings/backup/backuprestore.cpp
parentc0ea353593cd6beed183ee0f9b58a16a869a0308 (diff)
downloadopie-24b27cb83dfc2a23c26e6edcda84fe26a9e9d685.zip
opie-24b27cb83dfc2a23c26e6edcda84fe26a9e9d685.tar.gz
opie-24b27cb83dfc2a23c26e6edcda84fe26a9e9d685.tar.bz2
- use busy indicator when backing up and restore
Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp20
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
@@ -5,12 +5,13 @@
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/ostorageinfo.h>
using namespace Opie::Core;
#include <opie2/ofiledialog.h>
+#include <opie2/owait.h>
using namespace Opie::Ui;
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
@@ -248,13 +249,17 @@ void BackupAndRestore::backup()
{
QMessageBox::critical(this, "Message",
"No items selected.",QString("Ok") );
return;
}
- setCaption(tr("Backup and Restore... working..."));
+ OWait *owait = new OWait();
+ Global::statusMessage( tr( "Backing up..." ) );
+ owait->show();
+ qApp->processEvents();
+
QString outputFile = backupLocations[storeToLocation->currentText()];
QDateTime datetime = QDateTime::currentDateTime();
QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') +
QString::number( datetime.date().day() ).rightJustify(2, '0');
@@ -281,12 +286,16 @@ void BackupAndRestore::backup()
.arg( tempFileName.latin1() );
odebug << commandLine << oendl;
int r = system( commandLine );
+ owait->hide();
+ delete owait;
+
+ //Error-Handling
if(r != 0)
{
perror("Error: ");
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
@@ -431,13 +440,17 @@ void BackupAndRestore::restore()
if(!restoreItem)
{
QMessageBox::critical(this, tr( "Message" ),
tr( "Please select something to restore." ),QString( tr( "Ok") ) );
return;
}
- setCaption(tr("Backup and Restore... working..."));
+
+ OWait *owait = new OWait();
+ Global::statusMessage( tr( "Restore Backup..." ) );
+ owait->show();
+ qApp->processEvents();
QString restoreFile = backupLocations[restoreSource->currentText()];
restoreFile += "/" + restoreItem->text(0);
odebug << restoreFile << oendl;
@@ -464,12 +477,15 @@ void BackupAndRestore::restore()
.arg( tempFileName.latin1() );
odebug << commandLine << oendl;
r = system( commandLine );
+ owait->hide();
+ delete owait;
+
//error handling
if(r != 0)
{
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
+ errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )