Added the code to populate the tabs when a dive is selected.

So, this is what happens now:
Every tab should be populated from updateDiveInfo method, it will be
called whenever a new dive is selected
I'm already populating the 'notes' box to show how it can be done.
If you are unsure what's the name of anything, open the file maintab.ui on
the designer, click on the item and check its objectName, the access is
ui->objectName from here on.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-05-06 13:23:14 -03:00 committed by Dirk Hohndel
parent baee897574
commit 06eab74a72
3 changed files with 19 additions and 0 deletions

View file

@ -60,6 +60,22 @@ void MainTab::clearStats()
ui->shortestAllText->setText(QString());
}
void MainTab::updateDiveInfo(int dive)
{
// So, this is what happens now:
// Every tab should be populated from this method,
// it will be called whenever a new dive is selected
// I'm already populating the 'notes' box
// to show how it can be done.
// If you are unsure what's the name of anything,
// open the file maintab.ui on the designer
// click on the item and check its objectName,
// the access is ui->objectName from here on.
struct dive *d = get_dive(dive);
ui->notes->setText(d->notes);
}
void MainTab::on_addCylinder_clicked()
{
if (cylindersModel->rowCount() >= MAX_CYLINDERS)