aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-24 21:38:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-06-15 11:20:49 -0700
commita20c22d9072f1a4fcb2b346a934c138df9f14a47 (patch)
treec411cfaaa0cc3b8f9b9cd4fc0c4110800d8ecb73 /desktop-widgets/tab-widgets/maintab.cpp
parentf51e402e04bc1f15da7b9e4d4f57a4e4c5c28490 (diff)
downloadsubsurface-a20c22d9072f1a4fcb2b346a934c138df9f14a47.tar.gz
Undo: hide multi-dive-edit warning message on subsequent edit
When a different field is edited, hide any old multi-dive-edit warning message. The reason is that we might want to add an "undo" button to the message. But this will undo the wrong command if we don't hide the message. Sadly, this means that we can't use animated show / hide, because an animatedHide() followed immediately by an animatedShow() does not necessarily show the message. In other words, and animatedShow() does not interupt a started animatedHide()!? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.cpp')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 810d4574c..407436b17 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -80,6 +80,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &MainTab::divesChanged);
connect(&diveListNotifier, &DiveListNotifier::tripChanged, this, &MainTab::tripChanged);
connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &MainTab::diveSiteEdited);
+ connect(&diveListNotifier, &DiveListNotifier::commandExecuted, this, &MainTab::closeWarning);
connect(ui.editDiveSiteButton, &QToolButton::clicked, MainWindow::instance(), &MainWindow::startDiveSiteEdit);
connect(ui.location, &DiveLocationLineEdit::entered, MapWidget::instance(), &MapWidget::centerOnIndex);
@@ -200,7 +201,7 @@ void MainTab::closeMessage()
void MainTab::closeWarning()
{
- ui.multiDiveWarningMessage->animatedHide();
+ ui.multiDiveWarningMessage->hide();
}
void MainTab::displayMessage(QString str)
@@ -723,7 +724,7 @@ void MainTab::divesEdited(int i)
return;
ui.multiDiveWarningMessage->setCloseButtonVisible(false);
ui.multiDiveWarningMessage->setText(tr("Warning: edited %1 dives").arg(i));
- ui.multiDiveWarningMessage->animatedShow();
+ ui.multiDiveWarningMessage->show();
}
static QStringList stringToList(const QString &s)