summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-19 00:09:36 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-18 21:30:54 -0700
commit046eacabe529c2b064a89d55a86689ec4dda37e9 (patch)
tree44d67d3b2d13d10e8d443cec3912cd11ee919d00 /qt-ui/maintab.cpp
parent80274b578899772a6c45682029cbce56ebc1eccb (diff)
downloadsubsurface-046eacabe529c2b064a89d55a86689ec4dda37e9.tar.gz
Make impossible to change dives while editing one.
This is to prevent loss of data, so if the user is editing something, either cancel the edition or save it, to continue moving around on the Dive List. - Only the dive list is affected, user can still play with the globe and the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 63e4a33d2..c33ad717b 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -8,8 +8,10 @@
#include "ui_maintab.h"
#include "addcylinderdialog.h"
#include "addweightsystemdialog.h"
+#include "mainwindow.h"
#include "../helpers.h"
#include "../statistics.h"
+#include "divelistview.h"
#include <QLabel>
#include <QDebug>
@@ -218,6 +220,8 @@ void MainTab::on_editNotes_clicked(bool edit)
ui->notes->setReadOnly(!edit);
ui->rating->setReadOnly(!edit);
+ mainWindow()->dive_list()->setEnabled(!edit);
+
if (edit){
ui->diveNotesMessage->setText("This dive is being edited. click on finish / reset when ready.");
ui->diveNotesMessage->animatedShow();
@@ -247,12 +251,13 @@ void MainTab::on_resetNotes_clicked()
ui->editNotes->setChecked(false);
ui->diveNotesMessage->animatedHide();
- ui->location->setReadOnly(false);
- ui->divemaster->setReadOnly(false);
- ui->buddy->setReadOnly(false);
- ui->suit->setReadOnly(false);
- ui->notes->setReadOnly(false);
- ui->rating->setReadOnly(false);
+ ui->location->setReadOnly(true);
+ ui->divemaster->setReadOnly(true);
+ ui->buddy->setReadOnly(true);
+ ui->suit->setReadOnly(true);
+ ui->notes->setReadOnly(true);
+ ui->rating->setReadOnly(true);
+ mainWindow()->dive_list()->setEnabled(true);
}
#define EDIT_NOTES(what, text) \