aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-25 20:03:49 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-12 15:52:40 -0800
commit0ea5374f62eeccbb7b8c617390d6ce733db4e416 (patch)
treeb7b295db538b8ead878a4f5929fff6e88b9f1280
parent41751a5899772092dfcf6d33c4015ce27e92b007 (diff)
downloadsubsurface-0ea5374f62eeccbb7b8c617390d6ce733db4e416.tar.gz
profile: move connect() calls to profile
The mainwindow was connecting preferences changes to the profile. Do this directly in the profile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--desktop-widgets/mainwindow.cpp19
-rw-r--r--profile-widget/profilewidget2.cpp21
2 files changed, 21 insertions, 19 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 933d02527..807bbe95d 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -284,25 +284,6 @@ MainWindow::MainWindow() : QMainWindow(),
connect(ui.profPn2, &QAction::triggered, pp_gas, &qPrefPartialPressureGas::set_pn2);
connect(ui.profPO2, &QAction::triggered, pp_gas, &qPrefPartialPressureGas::set_po2);
- connect(tec, &qPrefTechnicalDetails::calcalltissuesChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::calcceilingChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::dcceilingChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::eadChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::calcceiling3mChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::modChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::calcndlttsChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::hrgraphChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::rulergraphChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::show_sacChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::zoomed_plotChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::show_pictures_in_profileChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::tankbarChanged , graphics, &ProfileWidget2::actionRequestedReplot);
- connect(tec, &qPrefTechnicalDetails::percentagegraphChanged , graphics, &ProfileWidget2::actionRequestedReplot);
-
- connect(pp_gas, &qPrefPartialPressureGas::pheChanged, graphics, &ProfileWidget2::actionRequestedReplot);
- connect(pp_gas, &qPrefPartialPressureGas::pn2Changed, graphics, &ProfileWidget2::actionRequestedReplot);
- connect(pp_gas, &qPrefPartialPressureGas::po2Changed, graphics, &ProfileWidget2::actionRequestedReplot);
-
// now let's set up some connections
connect(graphics, &ProfileWidget2::enableToolbar ,this, &MainWindow::setEnabledToolbar);
connect(graphics, &ProfileWidget2::disableShortcuts, this, &MainWindow::disableShortcuts);
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 61764fb6f..09d1dc135 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -178,6 +178,27 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
diveDepthTableView->setModel(dataModel);
diveDepthTableView->show();
#endif
+
+ auto tec = qPrefTechnicalDetails::instance();
+ connect(tec, &qPrefTechnicalDetails::calcalltissuesChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::calcceilingChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::dcceilingChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::eadChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::calcceiling3mChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::modChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::calcndlttsChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::hrgraphChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::rulergraphChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::show_sacChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::zoomed_plotChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::show_pictures_in_profileChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::tankbarChanged , this, &ProfileWidget2::actionRequestedReplot);
+ connect(tec, &qPrefTechnicalDetails::percentagegraphChanged , this, &ProfileWidget2::actionRequestedReplot);
+
+ auto pp_gas = qPrefPartialPressureGas::instance();
+ connect(pp_gas, &qPrefPartialPressureGas::pheChanged, this, &ProfileWidget2::actionRequestedReplot);
+ connect(pp_gas, &qPrefPartialPressureGas::pn2Changed, this, &ProfileWidget2::actionRequestedReplot);
+ connect(pp_gas, &qPrefPartialPressureGas::po2Changed, this, &ProfileWidget2::actionRequestedReplot);
}
ProfileWidget2::~ProfileWidget2()