diff options
-rw-r--r-- | qt-ui/maintab.cpp | 3 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 5a6f7b537..652e8242e 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -270,6 +270,7 @@ void MainTab::enableEdition(EditMode newEditMode) return; } MainWindow::instance()->dive_list()->setEnabled(false); + MainWindow::instance()->setEnabledToolbar(false); // only setup the globe for editing if we are editing exactly one existing dive if (amount_selected == 1 && newEditMode != ADD) @@ -781,6 +782,7 @@ void MainTab::acceptChanges() MainWindow::instance()->dive_list()->setFocus(); cylindersModel->changed = false; weightModel->changed = false; + MainWindow::instance()->setEnabledToolbar(true); } void MainTab::resetPallete() @@ -845,6 +847,7 @@ void MainTab::rejectChanges() MainWindow::instance()->globe()->reload(); // show the profile and dive info MainWindow::instance()->graphics()->replot(); + MainWindow::instance()->setEnabledToolbar(true); cylindersModel->changed = false; weightModel->changed = false; cylindersModel->updateDive(); diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index aa9d8c145..1a4594bab 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -1286,3 +1286,13 @@ void MainWindow::on_actionExport_triggered() DiveLogExportDialog diveLogExport; diveLogExport.exec(); } + +void MainWindow::setEnabledToolbar(bool arg1) +{ + QList<QToolButton*> toolBar; toolBar << ui.profCalcAllTissues << ui.profCalcCeiling + << ui.profDcCeiling << ui.profEad << ui.profHR << ui.profIncrement3m + << ui.profMod << ui.profNdl_tts << ui.profNdl_tts << ui.profPhe << ui.profPn2 + << ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled << ui.profTogglePicture; + Q_FOREACH(QToolButton *b, toolBar) + b->setEnabled(arg1); +} diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 6b53babbd..5c0ec8efa 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -156,6 +156,7 @@ slots: void editCurrentDive(); void planCanceled(); void planCreated(); + void setEnabledToolbar(bool arg1); private: Ui::MainWindow ui; |