diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/maintab.cpp | 8 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | qt-ui/models.cpp | 6 |
3 files changed, 14 insertions, 10 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index c684a5bfd..378ba8721 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -135,7 +135,10 @@ void MainTab::updateDiveInfo(int dive) // click on the item and check its objectName, // the access is ui->objectName from here on. volume_t sacVal; + struct dive *prevd; struct dive *d = get_dive(dive); + + process_all_dives(d, &prevd); currentDive = d; UPDATE_TEXT(d, notes); UPDATE_TEXT(d, location); @@ -151,6 +154,11 @@ void MainTab::updateDiveInfo(int dive) ui->waterTemperatureText->setText(get_temperature_string(d->watertemp, TRUE)); ui->airTemperatureText->setText(get_temperature_string(d->airtemp, TRUE)); ui->gasUsedText->setText(get_volume_string(get_gas_used(d), TRUE)); + ui->oxygenHeliumText->setText(get_gaslist(d)); + ui->dateText->setText(get_dive_date_string(d->when)); + ui->diveTimeText->setText(QString::number((int)((d->duration.seconds + 30) / 60))); + if (prevd) + ui->surfaceIntervalText->setText(get_time_string(d->when - (prevd->when + prevd->duration.seconds), 4)); if ((sacVal.mliter = d->sac) > 0) ui->sacText->setText(get_volume_string(sacVal, TRUE).append("/min")); else diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index b60f668e2..eed9aa883 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -126,16 +126,6 @@ void MainWindow::on_actionClose_triggered() ui->ListWidget->reload(); clear_events(); -#if USE_GTK_UI - show_dive_stats(NULL); - - /* redraw the screen */ - //WARNING: Port this to Qt. - dive_list_update_dives(); - - // WARNING? Port this to Qt. - show_dive_info(NULL); -#endif /* USE_GTK_UI */ } void MainWindow::on_actionImport_triggered() diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 9bc8db0bb..90c826331 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -9,6 +9,7 @@ #include <QDebug> #include <QColor> #include <QBrush> +#include <QFont> extern struct tank_info tank_info[100]; @@ -610,6 +611,11 @@ QVariant DiveTripModel::data(const QModelIndex& index, int role) const if (!index.isValid()) return QVariant(); + if (role == Qt::FontRole){ + QFont font; + font.setPointSizeF(font.pointSizeF() * 0.7); + return font; + } TreeItemDT* item = static_cast<TreeItemDT*>(index.internalPointer()); return item->data(index.column(), role); |