From db3434fe1ae3472517248496c8a14ffb8a8f3284 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 13 Jun 2014 23:09:22 +0100 Subject: [PATCH] Confirm popup on reset layout .. user might not have mean't it. --- src/MainWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 8cf0ee4f7..53d65ee94 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1031,7 +1031,16 @@ void MainWindow::showWorkoutWizard() void MainWindow::resetWindowLayout() { - currentTab->resetLayout(); + QMessageBox msgBox; + msgBox.setText(tr("You are about to reset all charts to the default setup")); + msgBox.setInformativeText("Do you want to continue?"); + msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); + msgBox.setDefaultButton(QMessageBox::Cancel); + msgBox.setIcon(QMessageBox::Warning); + msgBox.exec(); + + if(msgBox.clickedButton() == msgBox.button(QMessageBox::Ok)) + currentTab->resetLayout(); } void MainWindow::manualProcess(QString name)