From b8a09ca5208bca204120620e5bbeae75e6fe76a9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 25 Aug 2015 21:08:05 -0300 Subject: [PATCH] Keep the dive list disabled if editing a dive When, in a dive edit mode user entered a dive site and went to dive site edit mode then finished the ds edit, the app would lose the disabled property of the dive list, making it possible to select a new dive when we where editing another one, complete mess. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 5 +++++ qt-ui/maintab.h | 1 + qt-ui/mainwindow.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 82ab7c7e7..3885cd56c 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -851,6 +851,11 @@ void MainTab::reload() mydive->what = copy_string(displayed_dive.what); \ } +MainTab::EditMode MainTab::getEditMode() const +{ + return editMode; +} + #define EDIT_VALUE(what) \ if (mydive->what == cd->what || copyPaste) { \ mydive->what = displayed_dive.what; \ diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 6a55580b7..eeb19a7c1 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -100,6 +100,7 @@ slots: void enableGeoLookupEdition(); void disableGeoLookupEdition(); void setCurrentLocationIndex(); + EditMode getEditMode() const; private: Ui::MainTab ui; WeightModel *weightModel; diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 99be8422c..23c36adaa 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -258,6 +258,9 @@ PlannerSettingsWidget *MainWindow::divePlannerSettingsWidget() { void MainWindow::setDefaultState() { setApplicationState("Default"); + if (information()->getEditMode() != MainTab::NONE) { + ui.bottomLeft->currentWidget()->setEnabled(false); + } } void MainWindow::setLoadedWithFiles(bool f)