mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
88fb82411e
commit
3335f083bf
1 changed files with 9 additions and 8 deletions
|
@ -202,24 +202,25 @@ void MainTab::clearStats()
|
|||
ui->timeLimits->clear();
|
||||
}
|
||||
|
||||
#define UPDATE_TEXT(d, field) \
|
||||
#define UPDATE_TEXT(d, field) \
|
||||
if (!d || !d->field) \
|
||||
ui->field->setText(""); \
|
||||
else \
|
||||
else \
|
||||
ui->field->setText(d->field)
|
||||
|
||||
#define UPDATE_TEMP(d, field) \
|
||||
if (!d || d->field.mkelvin == 0) \
|
||||
#define UPDATE_TEMP(d, field) \
|
||||
if (!d || d->field.mkelvin == 0) \
|
||||
ui->field->setText(""); \
|
||||
else \
|
||||
ui->field->setText(get_temperature_string(d->field, TRUE));
|
||||
else \
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue