summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-08-25 21:08:05 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-25 18:00:26 -0700
commitb8a09ca5208bca204120620e5bbeae75e6fe76a9 (patch)
tree1efdeac1250009d14e554df9ccea13ee15cc7ee9
parentfc6d819616b69f7c69dc8743bc25aa8ad51708a4 (diff)
downloadsubsurface-b8a09ca5208bca204120620e5bbeae75e6fe76a9.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp5
-rw-r--r--qt-ui/maintab.h1
-rw-r--r--qt-ui/mainwindow.cpp3
3 files changed, 9 insertions, 0 deletions
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)