summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/profilewidget2.cpp11
-rw-r--r--profile-widget/profilewidget2.h1
-rw-r--r--subsurface-desktop-main.cpp1
3 files changed, 9 insertions, 4 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 6177f5b97..178183d2e 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -24,6 +24,7 @@
#include <QInputDialog>
#include <QDebug>
#include <QWheelEvent>
+#include <QSettings>
#ifndef QT_NO_DEBUG
#include <QTableView>
@@ -690,11 +691,13 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
// OK, how long did this take us? Anything above the second is way too long,
// so if we are calculation TTS / NDL then let's force that off.
if (measureDuration.elapsed() > 1000 && prefs.calcndltts) {
- MainWindow::instance()->turnOffNdlTts();
- MainWindow::instance()->getNotificationWidget()->showNotification(tr("Show NDL / TTS was disabled because of excessive processing time"), KMessageWidget::Error);
+ prefs.calcndltts = false;
+ QSettings s;
+ s.beginGroup("TecDetails");
+ s.setValue("calcndltts", false);
+ report_error(qPrintable(tr("Show NDL / TTS was disabled because of excessive processing time")));
}
- MainWindow::instance()->getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
-
+ emit showError();
}
void ProfileWidget2::recalcCeiling()
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 812787b2d..8ac34f625 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -89,6 +89,7 @@ public:
signals:
void fontPrintScaleChanged(double scale);
void enableToolbar(bool enable);
+ void showError();
public
slots: // Necessary to call from QAction's signals.
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 725011fc2..23be242b6 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -87,6 +87,7 @@ int main(int argc, char **argv)
// now let's set up some connections
QObject::connect(m->graphics(), &ProfileWidget2::enableToolbar ,m, &MainWindow::setEnabledToolbar, Qt::AutoConnection);
+ QObject::connect(m->graphics(), &ProfileWidget2::showError, m, &MainWindow::showError, Qt::AutoConnection);
if (verbose > 0)
print_files();
if (!quit)