Disable the info widget when no dive is selected

This solves the odd case when closing the data file that clicking in the
info widget caused the input fields to respond and the little warning icon
to show up.

Also some minor whitespace cleanup for readability.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-09-22 08:19:05 -07:00
parent 88fb82411e
commit 3335f083bf

View file

@ -212,14 +212,15 @@ void MainTab::clearStats()
if (!d || d->field.mkelvin == 0) \
ui->field->setText(""); \
else \
ui->field->setText(get_temperature_string(d->field, TRUE));
ui->field->setText(get_temperature_string(d->field, TRUE))
void MainTab::updateDiveInfo(int dive)
{
if(!isEnabled() && dive != -1)
if (!isEnabled() && dive != -1)
setEnabled(true);
if (isEnabled() && dive == -1)
setEnabled(false);
editMode = NONE;
// This method updates ALL tabs whenever a new dive or trip is
// selected.