diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-05-24 21:50:17 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-06-15 11:20:49 -0700 |
commit | e329a53aabb3a0728204c27df359cb894c547c91 (patch) | |
tree | 2e8457bb5ffe08435c639452537633c434c8eca3 /desktop-widgets/tab-widgets | |
parent | a20c22d9072f1a4fcb2b346a934c138df9f14a47 (diff) | |
download | subsurface-e329a53aabb3a0728204c27df359cb894c547c91.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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())); |