From bed847a655763925311029acd7080543b7fcf352 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 30 Jun 2012 11:58:45 +0200 Subject: [PATCH] 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 --- rbutil/rbutilqt/gui/backupdialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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(); -- 2.11.4.GIT