summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-06 07:51:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-07 08:16:53 -0700
commit0799d046ba976a15fea537ff3dc790b6d9b28cbd (patch)
treeac307106d7f510b67196112e089b70df33e4d4de
parent174b4144366a81a72dea6a77af45dca8575608cb (diff)
downloadsubsurface-0799d046ba976a15fea537ff3dc790b6d9b28cbd.tar.gz
Disable editDiveSiteButton without dive site name
Entering a name first creates and hooks up a dive site which we can then use in the edit dive site dialog to store modifications. This doesn't really fix these two bugs, but it might impact whether they can still be recreated See #633 See #636 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 2d4ba6403..62d818183 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -589,6 +589,7 @@ void MainTab::updateDiveInfo(bool clear)
ui.locationTags->hide();
else
ui.locationTags->show();
+ ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
/* unset the special value text for date and time, just in case someone dove at midnight */
ui.dateEdit->setSpecialValueText(QString(""));
ui.timeEdit->setSpecialValueText(QString(""));
@@ -969,7 +970,7 @@ void MainTab::acceptChanges()
weightModel->changed = false;
MainWindow::instance()->setEnabledToolbar(true);
acceptingEdit = false;
- ui.editDiveSiteButton->setEnabled(true);
+ ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
}
void MainTab::resetPallete()
@@ -1045,7 +1046,7 @@ void MainTab::rejectChanges()
weightModel->changed = false;
cylindersModel->updateDive();
weightModel->updateDive();
- ui.editDiveSiteButton->setEnabled(true);
+ ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
}
#undef EDIT_TEXT2