diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-30 11:58:45 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-30 11:58:45 +0200 |
commit | bed847a655763925311029acd7080543b7fcf352 (patch) | |
tree | 9ed36cfba88e7c70a5c626a1f4fd0aff32d22c38 | |
parent | 6db53f4ef8e18ae0843eb247a94ec49fdcf27662 (diff) | |
download | rockbox-bed847a655763925311029acd7080543b7fcf352.tar.gz rockbox-bed847a655763925311029acd7080543b7fcf352.zip |
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
-rw-r--r-- | rbutil/rbutilqt/gui/backupdialog.cpp | 7 |
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) | |||
108 | 108 | ||
109 | void BackupDialog::backup(void) | 109 | void BackupDialog::backup(void) |
110 | { | 110 | { |
111 | if(QFileInfo(m_backupName).isFile()) { | ||
112 | if(QMessageBox::warning(this, tr("File exists"), | ||
113 | tr("The selected backup file already exists. Overwrite?"), | ||
114 | QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { | ||
115 | return; | ||
116 | } | ||
117 | } | ||
111 | m_logger = new ProgressLoggerGui(this); | 118 | m_logger = new ProgressLoggerGui(this); |
112 | connect(m_logger, SIGNAL(closed()), this, SLOT(close())); | 119 | connect(m_logger, SIGNAL(closed()), this, SLOT(close())); |
113 | m_logger->show(); | 120 | m_logger->show(); |