mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a3ea1d51f9
commit
c1bc29bd4b
1 changed files with 4 additions and 6 deletions
|
@ -512,7 +512,7 @@ DiveImportedModel::DiveImportedModel(QObject *o) : QAbstractTableModel(o),
|
||||||
|
|
||||||
int DiveImportedModel::columnCount(const QModelIndex& model ) const
|
int DiveImportedModel::columnCount(const QModelIndex& model ) const
|
||||||
{
|
{
|
||||||
return 5;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DiveImportedModel::rowCount(const QModelIndex& model) const
|
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);
|
struct dive* d = get_dive( index.row() + firstIndex);
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
switch(index.column()){
|
switch(index.column()){
|
||||||
case 0 : return QVariant((int) d->when);
|
case 0 : return QVariant(get_short_dive_date_string(d->when));
|
||||||
case 1 : return QVariant(d->duration.seconds);
|
case 1 : return QVariant(get_dive_duration_string(d->duration.seconds, tr("h:"), tr("min")));
|
||||||
case 2 : return QVariant(d->maxdepth.mm);
|
case 2 : return QVariant(get_depth_string(d->maxdepth.mm, true, false));
|
||||||
case 3 : return QVariant(d->latitude.udeg);
|
|
||||||
case 4 : return QVariant(d->longitude.udeg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (role == Qt::CheckStateRole) {
|
if (role == Qt::CheckStateRole) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue