Show extra data in separate tab on MainTab

This way any extra data probided by the dive computer is visible to the
user (without other processing). This data cannot be edited by the user as
it reflects the information given by the dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-11-06 11:24:38 -08:00
parent 4ccddf95d7
commit 45251ec724
5 changed files with 149 additions and 8 deletions

View file

@ -32,6 +32,7 @@
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
weightModel(new WeightModel(this)),
cylindersModel(CylindersModel::instance()),
extraDataModel(new ExtraDataModel(this)),
editMode(NONE),
divePictureModel(DivePictureModel::instance()),
currentTrip(0),
@ -47,6 +48,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.weights->setModel(weightModel);
ui.photosView->setModel(divePictureModel);
connect(ui.photosView, SIGNAL(photoDoubleClicked(QString)), this, SLOT(photoDoubleClicked(QString)));
ui.extraData->setModel(extraDataModel);
closeMessage();
QAction *action = new QAction(tr("Save"), this);
@ -473,6 +475,7 @@ void MainTab::updateDiveInfo(bool clear)
ui.equipmentTab->setEnabled(true);
cylindersModel->updateDive();
weightModel->updateDive();
extraDataModel->updateDive();
taglist_get_tagstring(displayed_dive.tag_list, buf, 1024);
ui.tagWidget->setText(QString(buf));
}
@ -899,6 +902,7 @@ void MainTab::rejectChanges()
weightModel->changed = false;
cylindersModel->updateDive();
weightModel->updateDive();
extraDataModel->updateDive();
}
#undef EDIT_TEXT2