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>
This commit is contained in:
Dirk Hohndel 2017-10-06 07:51:02 -07:00
parent 174b414436
commit 0799d046ba

View file

@ -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