summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-30 11:58:45 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-30 11:58:45 +0200
commitbed847a655763925311029acd7080543b7fcf352 (patch)
tree9ed36cfba88e7c70a5c626a1f4fd0aff32d22c38 /rbutil
parent6db53f4ef8e18ae0843eb247a94ec49fdcf27662 (diff)
Backup dialog: check if the backup file already exists.
Give the user a chance to cancel the backup if the selected file already exists. Since the filename is automatically generated from the installation version information this can happen when trying to create a second backup of the installation. Change-Id: Iee34e576c4b3b94a4ccf99836741806b52a8affd
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/gui/backupdialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/gui/backupdialog.cpp b/rbutil/rbutilqt/gui/backupdialog.cpp
index 5d04b322ed..a6895dac2b 100644
--- a/rbutil/rbutilqt/gui/backupdialog.cpp
+++ b/rbutil/rbutilqt/gui/backupdialog.cpp
@@ -108,6 +108,13 @@ void BackupDialog::updateSizeInfo(void)
void BackupDialog::backup(void)
{
+ if(QFileInfo(m_backupName).isFile()) {
+ if(QMessageBox::warning(this, tr("File exists"),
+ tr("The selected backup file already exists. Overwrite?"),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
+ return;
+ }
+ }
m_logger = new ProgressLoggerGui(this);
connect(m_logger, SIGNAL(closed()), this, SLOT(close()));
m_logger->show();