From cfd4c42829025abefc8f8c4f9b77a18c52722b39 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sat, 17 Mar 2018 10:48:45 +0100 Subject: Profile heatmap/heartrate: Only enable max one of these at same time Only allow to enable maximum one of both items tissue heatmap or heartrate in profile. This is done by always switching off the other one at the moment you turn on one of the two items (heatmap or heartrate). Signed-off-by: Stefan Fuchs --- desktop-widgets/mainwindow.cpp | 19 +++++++++++++++++++ desktop-widgets/mainwindow.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index d0c5a0790..4027c6d61 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -292,6 +292,9 @@ MainWindow::MainWindow() : QMainWindow(), connect(ui.profTankbar, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setTankBar); connect(ui.profTissues, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setPercentageGraph); + connect(ui.profTissues, &QAction::triggered, this, &MainWindow::unsetProfHR); + connect(ui.profHR, &QAction::triggered, this, &MainWindow::unsetProfTissues); + connect(ui.profPhe, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPhe); connect(ui.profPn2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPn2); connect(ui.profPO2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPo2); @@ -2037,3 +2040,19 @@ void MainWindow::hideProgressBar() progressDialog = NULL; } } + +void MainWindow::unsetProfHR() +{ + SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance(); + + ui.profHR->setChecked(false); + sWrapper->techDetails->setHRgraph(false); +} + +void MainWindow::unsetProfTissues() +{ + SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance(); + + ui.profTissues->setChecked(false); + sWrapper->techDetails->setPercentageGraph(false); +} diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 09b1fd9da..03ebcf636 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -149,6 +149,8 @@ slots: void setDefaultState(); void setAutomaticTitle(); void cancelCloudStorageOperation(); + void unsetProfHR(); + void unsetProfTissues(); protected: void closeEvent(QCloseEvent *); -- cgit v1.2.3-70-g09d2