mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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:
parent
174b414436
commit
0799d046ba
1 changed files with 3 additions and 2 deletions
|
@ -589,6 +589,7 @@ void MainTab::updateDiveInfo(bool clear)
|
||||||
ui.locationTags->hide();
|
ui.locationTags->hide();
|
||||||
else
|
else
|
||||||
ui.locationTags->show();
|
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 */
|
/* unset the special value text for date and time, just in case someone dove at midnight */
|
||||||
ui.dateEdit->setSpecialValueText(QString(""));
|
ui.dateEdit->setSpecialValueText(QString(""));
|
||||||
ui.timeEdit->setSpecialValueText(QString(""));
|
ui.timeEdit->setSpecialValueText(QString(""));
|
||||||
|
@ -969,7 +970,7 @@ void MainTab::acceptChanges()
|
||||||
weightModel->changed = false;
|
weightModel->changed = false;
|
||||||
MainWindow::instance()->setEnabledToolbar(true);
|
MainWindow::instance()->setEnabledToolbar(true);
|
||||||
acceptingEdit = false;
|
acceptingEdit = false;
|
||||||
ui.editDiveSiteButton->setEnabled(true);
|
ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::resetPallete()
|
void MainTab::resetPallete()
|
||||||
|
@ -1045,7 +1046,7 @@ void MainTab::rejectChanges()
|
||||||
weightModel->changed = false;
|
weightModel->changed = false;
|
||||||
cylindersModel->updateDive();
|
cylindersModel->updateDive();
|
||||||
weightModel->updateDive();
|
weightModel->updateDive();
|
||||||
ui.editDiveSiteButton->setEnabled(true);
|
ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty());
|
||||||
}
|
}
|
||||||
#undef EDIT_TEXT2
|
#undef EDIT_TEXT2
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue