diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-23 17:11:43 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-23 14:15:50 -0700 |
commit | 483320a0c094c57c5806fda39bd4a56d29ff7687 (patch) | |
tree | b7c9036e5574cd09cb6835f5f9c58ce4771d61b7 | |
parent | 7426f18a960b7c397842f45a5e0ca72942d04c36 (diff) | |
download | subsurface-483320a0c094c57c5806fda39bd4a56d29ff7687.tar.gz |
Disable edit dive site if already in edit mode
If user selected a new dive site (a dive site that doesn't
exists yet, to be created) and clicked in edit it would edit
the *old* dive site. this is not optimal, but since it
removes a severe regression it will be like this (I won't
change it till 5.0) for a while, until I have time to
actually code something not messy for that.
The current dive location management is *much* nicer than
the old one, code-wise. No more magic numbers, magic codepaths,
magic constants, qt black magic. It's straigth-forward code
simple to follow, simple to edit.
This was something I was actually postponing for 5.0 but I
managed to get a boost of subsurface time at work.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/maintab.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 884ef547d..d1b635095 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -55,7 +55,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.extraData->setModel(extraDataModel); closeMessage(); - ui.editDiveSiteButton->setEnabled(true); connect(ui.editDiveSiteButton, SIGNAL(clicked()), MainWindow::instance(), SIGNAL(startDiveSiteEdit())); QAction *action = new QAction(tr("Apply changes"), this); @@ -331,6 +330,8 @@ void MainTab::enableEdition(EditMode newEditMode) MainWindow::instance()->editCurrentDive(); return; } + + ui.editDiveSiteButton->setEnabled(false); MainWindow::instance()->dive_list()->setEnabled(false); MainWindow::instance()->setEnabledToolbar(false); @@ -1105,6 +1106,7 @@ void MainTab::acceptChanges() weightModel->changed = false; MainWindow::instance()->setEnabledToolbar(true); acceptingEdit = false; + ui.editDiveSiteButton->setEnabled(true); } void MainTab::resetPallete() @@ -1177,6 +1179,7 @@ void MainTab::rejectChanges() cylindersModel->updateDive(); weightModel->updateDive(); extraDataModel->updateDive(); + ui.editDiveSiteButton->setEnabled(true); } #undef EDIT_TEXT2 |