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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-24 21:50:17 +02:00 committed by Dirk Hohndel
parent a20c22d907
commit e329a53aab

View file

@ -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()));