diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 09:31:18 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 09:33:47 -0800 |
commit | c1bc29bd4b05dafb26dbc1f94ed4070b07612f59 (patch) | |
tree | ba17e5dc91f10bac61a96198f3fee348e0413ca1 /qt-ui | |
parent | a3ea1d51f9a52902fa44a734b98d00b5b71f83af (diff) | |
download | subsurface-c1bc29bd4b05dafb26dbc1f94ed4070b07612f59.tar.gz |
Dive d/l selection UI: show useful data in a useful format
We don't get location data from the dive computer (at least not from
99.99% of the dive computers today). And we really need to show the data
in a human readable format.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 730a7b8a5..94b89ef5b 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -512,7 +512,7 @@ DiveImportedModel::DiveImportedModel(QObject *o) : QAbstractTableModel(o), int DiveImportedModel::columnCount(const QModelIndex& model ) const { - return 5; + return 3; } int DiveImportedModel::rowCount(const QModelIndex& model) const @@ -531,11 +531,9 @@ QVariant DiveImportedModel::data(const QModelIndex& index, int role) const struct dive* d = get_dive( index.row() + firstIndex); if (role == Qt::DisplayRole) { switch(index.column()){ - case 0 : return QVariant((int) d->when); - case 1 : return QVariant(d->duration.seconds); - case 2 : return QVariant(d->maxdepth.mm); - case 3 : return QVariant(d->latitude.udeg); - case 4 : return QVariant(d->longitude.udeg); + case 0 : return QVariant(get_short_dive_date_string(d->when)); + case 1 : return QVariant(get_dive_duration_string(d->duration.seconds, tr("h:"), tr("min"))); + case 2 : return QVariant(get_depth_string(d->maxdepth.mm, true, false)); } } if (role == Qt::CheckStateRole) { |