summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/mainwindow.cpp17
-rw-r--r--qt-ui/mainwindow.h1
-rw-r--r--qt-ui/profile/profilewidget2.cpp2
3 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index ccba66d70..34ff4baf4 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -166,6 +166,23 @@ void MainWindow::cleanUpEmpty()
setTitle(MWTF_DEFAULT);
}
+void MainWindow::setToolButtonsEnabled(bool enabled)
+{
+ ui.profPO2->setEnabled(enabled);
+ ui.profPn2->setEnabled(enabled);
+ ui.profPhe->setEnabled(enabled);
+ ui.profDcCeiling->setEnabled(enabled);
+ ui.profCalcCeiling->setEnabled(enabled);
+ ui.profCalcAllTissues->setEnabled(enabled);
+ ui.profIncrement3m->setEnabled(enabled);
+ ui.profMod->setEnabled(enabled);
+ ui.profEad->setEnabled(enabled);
+ ui.profNdl_tts->setEnabled(enabled);
+ ui.profSAC->setEnabled(enabled);
+ ui.profRuler->setEnabled(enabled);
+ ui.profScaled->setEnabled(enabled);
+}
+
void MainWindow::on_actionClose_triggered()
{
if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 40f22dd61..70b9793f7 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -76,6 +76,7 @@ public:
void loadFiles(const QStringList files);
void importFiles(const QStringList importFiles);
void cleanUpEmpty();
+ void setToolButtonsEnabled(bool enabled);
ProfileWidget2 *graphics() const;
private
slots:
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 822f1bc7f..d03d0dc83 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -544,6 +544,7 @@ void ProfileWidget2::setEmptyState()
dataModel->clear();
currentState = EMPTY;
+ MainWindow::instance()->setToolButtonsEnabled(false);
backgroundFile = QString(":poster");
fixBackgroundPos();
@@ -577,6 +578,7 @@ void ProfileWidget2::setProfileState()
return;
currentState = PROFILE;
+ MainWindow::instance()->setToolButtonsEnabled(true);
toolTipItem->readPos();
setBackgroundBrush(getColor(::BACKGROUND));