From e329a53aabb3a0728204c27df359cb894c547c91 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 24 May 2019 21:50:17 +0200 Subject: Undo: add undo button to multi-dive-edited warning message Simply connect the button the the undo-action and the hide-message action. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 407436b17..ad39c433e 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -98,6 +98,11 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), connect(action, &QAction::triggered, this, &MainTab::closeWarning); ui.multiDiveWarningMessage->addAction(action); + action = new QAction(tr("Undo"), this); + connect(action, &QAction::triggered, Command::undoAction(this), &QAction::trigger); + connect(action, &QAction::triggered, this, &MainTab::closeWarning); + ui.multiDiveWarningMessage->addAction(action); + QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this); connect(closeKey, SIGNAL(activated()), this, SLOT(escDetected())); -- cgit v1.2.3-70-g09d2